From f4f3c9bd2d3649a6668602030ce2b6629be1e8c8 Mon Sep 17 00:00:00 2001 From: cpw Date: Fri, 15 Feb 2019 21:53:52 -0500 Subject: Fix the MDK.. Signed-off-by: cpw --- src/main/java/com/example/examplemod/ExampleMod.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/main/java/com/example') 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 blockRegistryEvent) { + public static void onBlocksRegistry(final RegistryEvent.Register blockRegistryEvent) { // register a new block here LOGGER.info("HELLO from Register Block"); } -- cgit v1.2.3