diff options
| author | cpw <cpw+github@weeksfamily.ca> | 2019-02-15 21:53:52 -0500 |
|---|---|---|
| committer | cpw <cpw+github@weeksfamily.ca> | 2019-02-15 21:56:54 -0500 |
| commit | f4f3c9bd2d3649a6668602030ce2b6629be1e8c8 (patch) | |
| tree | ecc83bbcfa4c839d0e54ae307e1409984028e6fc /src/main/java/com/example | |
| parent | f71f34708248aa36cb2947547be6884757fb577e (diff) | |
Fix the MDK..
Signed-off-by: cpw <cpw+github@weeksfamily.ca>
Diffstat (limited to 'src/main/java/com/example')
| -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"); } |
