Advertisement
jayhillx

Main Class

Dec 14th, 2020
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. @Mod("mysticsbiomes")
  2. public class MysticsBiomes
  3. {
  4. private static final Logger LOGGER = LogManager.getLogger();
  5. public static final String MOD_ID = "mysticsbiomes";
  6.  
  7. public MysticsBiomes() {
  8. IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
  9.  
  10. DistExecutor.runWhenOn(Dist.CLIENT, () -> () -> {
  11. modEventBus.addListener(EventPriority.LOWEST, this::clientSetup);
  12.  
  13. });
  14. modEventBus.addListener(EventPriority.LOWEST, this::commonSetup);
  15.  
  16. modEventBus.addGenericListener(Biome.class, ModBiomes::registerBiomes);
  17.  
  18. ModBlocks.BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus());
  19. ModItems.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
  20.  
  21. MinecraftForge.EVENT_BUS.register(this);
  22. }
  23.  
  24. private void commonSetup(final FMLCommonSetupEvent event)
  25. {
  26. DeferredWorkQueue.runLater(() ->
  27. {
  28. VanillaCompatibility.registerCompostables();
  29.  
  30. ModBiomes.load();
  31. });
  32. }
  33.  
  34. private void clientSetup(final FMLClientSetupEvent event)
  35. {
  36. DeferredWorkQueue.runLater(VanillaCompatibility::setupVanillaCompatibilityClient);
  37. }
  38.  
  39. public static final ItemGroup TAB = new ItemGroup("mysticsbiomesTab") {
  40. @Override
  41. public ItemStack createIcon() {
  42. return new ItemStack(ModItems.ICON.get());
  43. }
  44. };
  45. }
  46.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement