Guest User

CadeMod.java

a guest
Jun 22nd, 2019
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.50 KB | None | 0 0
  1. package com.cademissner.cademod;
  2.  
  3. import net.minecraft.block.Block;
  4. import net.minecraftforge.common.MinecraftForge;
  5. import net.minecraftforge.event.RegistryEvent;
  6. import net.minecraftforge.eventbus.api.SubscribeEvent;
  7. import net.minecraftforge.fml.common.Mod;
  8. import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
  9. import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
  10. import org.apache.logging.log4j.LogManager;
  11. import org.apache.logging.log4j.Logger;
  12.  
  13. // The value here should match an entry in the META-INF/mods.toml file
  14. @Mod("cademod")
  15. public class CadeMod {
  16.     // Directly reference a log4j logger.
  17.     private static final Logger LOGGER = LogManager.getLogger();
  18.  
  19.     public CadeMod() {
  20.         // Register the setup method for modloading
  21.         FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
  22.         // Register ourselves for server and other game events we are interested in
  23.         MinecraftForge.EVENT_BUS.register(this);
  24.     }
  25.  
  26.     private void setup(final FMLCommonSetupEvent event) {
  27.  
  28.     }
  29.  
  30.     // You can use EventBusSubscriber to automatically subscribe events on the
  31.     // contained class (this is subscribing to the MOD
  32.     // Event bus for receiving Registry Events)
  33.     @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
  34.     public static class RegistryEvents {
  35.         @SubscribeEvent
  36.         public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) {
  37.             // register a new block here
  38.             LOGGER.info("HELLO from Register Block");
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment