Added support for using static methods as event listeners, Register the .class instead of an instance.

And added an improvement to calltime listener rebuilding.
This commit is contained in:
LexManos committed 2016-07-13 12:08:13 -07:00
1 parent 57ed697cab
commit 5f234fdcf8
4 files changed
+60 -15

No files matched your search

@@ -32,6 +32,7 @@ public class PlayerInteractEventTest
{
logger = event.getModLog();
MinecraftForge.EVENT_BUS.register(this);
MinecraftForge.EVENT_BUS.register(PlayerInteractEventTest.class); // Test Static event listeners
}
@SubscribeEvent(receiveCanceled = true) // this triggers after the subclasses below, and we'd like to log them all
@@ -142,7 +143,7 @@ public class PlayerInteractEventTest
}
@SubscribeEvent
public void interactNormal(PlayerInteractEvent.EntityInteract evt)
public static void interactNormal(PlayerInteractEvent.EntityInteract evt)
{
if (!ENABLE) return;