diff options
Diffstat (limited to 'src/main/java')
| -rw-r--r-- | src/main/java/com/example/examplemod/ExampleMod.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main/java/com/example/examplemod/ExampleMod.java b/src/main/java/com/example/examplemod/ExampleMod.java index 88204a0..d0fa6c8 100644 --- a/src/main/java/com/example/examplemod/ExampleMod.java +++ b/src/main/java/com/example/examplemod/ExampleMod.java @@ -35,7 +35,7 @@ public class ExampleMod // Register the doClientStuff method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff); - // Register ourselves for server, registry and other game events we are interested in + // Register ourselves for server and other game events we are interested in MinecraftForge.EVENT_BUS.register(this); } @@ -54,7 +54,7 @@ public class ExampleMod private void enqueueIMC(final InterModEnqueueEvent event) { // some example code to dispatch IMC to another mod - InterModComms.sendTo("forge", "helloworld", () -> { LOGGER.info("Hello world"); return "Hello world";}); + InterModComms.sendTo("examplemod", "helloworld", () -> { LOGGER.info("Hello world from the MDK"); return "Hello world";}); } private void processIMC(final InterModProcessEvent event) @@ -66,16 +66,17 @@ public class ExampleMod } // You can use SubscribeEvent and let the Event Bus discover methods to call @SubscribeEvent - public static void onServerStarting(FMLServerStartingEvent event) { + public void onServerStarting(FMLServerStartingEvent event) { // do something when the server starts LOGGER.info("HELLO from server starting"); } - // You can use EventBusSubscriber to automatically subscribe events on the contained class (this is subscribing to the MOD event bus + // You can use EventBusSubscriber to automatically subscribe events on the contained class (this is subscribing to the MOD + // Event bus for receiving Registry Events) @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) public static class RegistryEvents { @SubscribeEvent - public void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) { + public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) { // register a new block here LOGGER.info("HELLO from Register Block"); } |
