mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 11:05:40 +00:00
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:
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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user