 +        }
 +
 +        ListIterator<L> iterator = listeners.listIterator();
-+
-+        while (iterator.hasNext() && iterator.next().getPriority() <= listener.getPriority()) {
-+
-+        }
-+
-+        if (iterator.hasPrevious()) {
++        boolean higherPriority = true;
++
++        while (iterator.hasNext() && (higherPriority = iterator.next().getPriority() <= listener.getPriority())) {
++
++        }
++
++        if (!higherPriority) {
 +            iterator.previous();
 +        }
 +

From e796f588ef3a71fe1e572add56f0edcabf1ebde0 Mon Sep 17 00:00:00 2001
From: stonar96 <minecraft.stonar96@gmail.com>
Date: Sun, 9 Sep 2018 03:39:59 +0200
Subject: [PATCH] Add basic event system

+}
diff --git a/sources/minecraft_server/com/vanillage/utils/event/EventManager.java b/sources/minecraft_server/com/vanillage/utils/event/EventManager.java
new file mode 100644
index 0000000..25716b3
--- /dev/null
+++ b/sources/minecraft_server/com/vanillage/utils/event/EventManager.java
@@ -0,0 +1,50 @@
+package com.vanillage.utils.event;
+
+import java.util.LinkedList;
