Advertisement
jayhillx

main class

Dec 10th, 2020
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. package com.meepshadow.mysticsbiomes.core;
  2.  
  3. import com.meepshadow.mysticsbiomes.core.other.VanillaCompatibility;
  4. import com.meepshadow.mysticsbiomes.core.registry.ModBiomes;
  5. import com.meepshadow.mysticsbiomes.core.registry.ModBlocks;
  6. import com.meepshadow.mysticsbiomes.core.registry.ModItems;
  7. import net.minecraft.item.ItemGroup;
  8. import net.minecraft.item.ItemStack;
  9. import net.minecraftforge.api.distmarker.Dist;
  10. import net.minecraftforge.common.MinecraftForge;
  11. import net.minecraftforge.eventbus.api.EventPriority;
  12. import net.minecraftforge.eventbus.api.IEventBus;
  13. import net.minecraftforge.fml.DistExecutor;
  14. import net.minecraftforge.fml.common.Mod;
  15. import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
  16. import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
  17. import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
  18. import org.apache.logging.log4j.LogManager;
  19. import org.apache.logging.log4j.Logger;
  20.  
  21. @Mod("mysticsbiomes")
  22. public class MysticsBiomes
  23. {
  24. private static final Logger LOGGER = LogManager.getLogger();
  25. public static final String MOD_ID = "mysticsbiomes";
  26.  
  27. public MysticsBiomes() {
  28. IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
  29.  
  30. DistExecutor.safeRunWhenOn(Dist.CLIENT, () -> () -> {
  31. modEventBus.addListener(EventPriority.LOWEST, this::clientSetup);
  32.  
  33. });
  34. modEventBus.addListener(EventPriority.LOWEST, this::commonSetup);
  35.  
  36. ModBlocks.BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus());
  37. ModItems.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
  38.  
  39. MinecraftForge.EVENT_BUS.register(this);
  40. }
  41.  
  42. private void commonSetup(final FMLCommonSetupEvent event) { }
  43.  
  44. private void clientSetup(final FMLClientSetupEvent event) {
  45. VanillaCompatibility.setupVanillaCompatibilityClient();
  46. }
  47.  
  48. public static final ItemGroup TAB = new ItemGroup("mysticsbiomesTab") {
  49. @Override
  50. public ItemStack createIcon() {
  51. return new ItemStack(ModItems.ICON.get());
  52. }
  53. };
  54. }
  55.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement