Advertisement
Guest User

Untitled

a guest
Aug 1st, 2017
101
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.mod.drakania;
  2.  
  3.  
  4. import com.mod.drakania.ChestFinder.ItemTileEntityFinder;
  5. import com.mod.drakania.cutommenu.GuiCustomMainMenu;
  6. import com.mod.drakania.init.BlockMod;
  7. import com.mod.drakania.init.Craft;
  8. import com.mod.drakania.init.ItemMod;
  9. import com.mod.drakania.inventory.EmotionGuiHandler;
  10. import com.mod.drakania.inventory.EventBackPack;
  11. import com.mod.drakania.items.EntityDynamite;
  12. import com.mod.drakania.items.RenderDynamite;
  13. import com.mod.drakania.proxy.ClientProxy;
  14. import com.mod.drakania.world.WorldRegister;
  15.  
  16. import cpw.mods.fml.client.FMLClientHandler;
  17. import cpw.mods.fml.client.registry.RenderingRegistry;
  18. import cpw.mods.fml.common.FMLCommonHandler;
  19. import cpw.mods.fml.common.Mod;
  20. import cpw.mods.fml.common.Mod.EventHandler;
  21. import cpw.mods.fml.common.Mod.Instance;
  22. import cpw.mods.fml.common.SidedProxy;
  23. import cpw.mods.fml.common.event.FMLInitializationEvent;
  24. import cpw.mods.fml.common.event.FMLPostInitializationEvent;
  25. import cpw.mods.fml.common.event.FMLPreInitializationEvent;
  26. import cpw.mods.fml.common.eventhandler.SubscribeEvent;
  27. import cpw.mods.fml.common.gameevent.TickEvent;
  28. import cpw.mods.fml.common.network.NetworkRegistry;
  29. import cpw.mods.fml.common.registry.EntityRegistry;
  30. import cpw.mods.fml.common.registry.GameRegistry;
  31. import cpw.mods.fml.relauncher.Side;
  32. import cpw.mods.fml.relauncher.SideOnly;
  33. import net.minecraft.client.Minecraft;
  34. import net.minecraft.client.gui.GuiMainMenu;
  35. import net.minecraft.creativetab.CreativeTabs;
  36. import net.minecraft.item.Item;
  37. import net.minecraftforge.common.MinecraftForge;
  38. import net.minecraftforge.fluids.Fluid;
  39. import net.minecraftforge.fluids.FluidRegistry;
  40.  
  41. @Mod(modid = References.MOD_ID, name = References.MOD_NAME, version = References.VERSION)
  42.  
  43.  
  44.  
  45.  
  46. public class DrakaMod
  47. {
  48. public static Item tileEntityFinder;
  49.  
  50.  
  51. @Instance (References.MOD_ID)
  52. public static DrakaMod instance;
  53.  
  54.  
  55.  
  56. @SidedProxy(clientSide = References.CLIENT_PROXY, serverSide = References.SERVER_PROXY)
  57. public static ClientProxy proxy;
  58.  
  59. public static CreativeTabs drakaModTab = new CreativeTabs ("drakamod")
  60. {
  61. @SideOnly(Side.CLIENT)
  62. public Item getTabIconItem()
  63. {
  64. return ItemMod.drakanium_ingot;
  65. }
  66.  
  67.  
  68. };
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75. @EventHandler
  76. public void preInit(FMLPreInitializationEvent event)
  77. {
  78.  
  79. BlockMod.init();
  80. BlockMod.register();
  81. ItemMod.init();
  82. ItemMod.register();
  83. WorldRegister.mainRegistry();
  84. Craft.init();
  85. Craft.register();
  86. tileEntityFinder= new ItemTileEntityFinder().setUnlocalizedName("tileEntityFinder");
  87.  
  88. GameRegistry.registerItem(tileEntityFinder, "tileEntityFinder");
  89.  
  90.  
  91.  
  92. }
  93.  
  94. @EventHandler
  95. public void Init(FMLInitializationEvent event)
  96.  
  97. {
  98.  
  99.  
  100. if(event.getSide().isClient())
  101. {
  102. FMLCommonHandler.instance().bus().register(this);
  103.  
  104. }
  105. NetworkRegistry.INSTANCE.registerGuiHandler(instance, new EmotionGuiHandler());
  106. proxy.registerRenders();
  107. EntityRegistry.registerModEntity(EntityDynamite.class, "EntityDynamite", 420, DrakaMod.instance, 32, 20, false);
  108.  
  109.  
  110.  
  111. }
  112.  
  113. @SubscribeEvent
  114. @SideOnly(Side.CLIENT)
  115. public void onTick(TickEvent.ClientTickEvent event)
  116. {
  117. Minecraft mc = FMLClientHandler.instance().getClient();
  118. if(mc.currentScreen != null && mc.currentScreen.getClass().equals(GuiMainMenu.class))
  119. {
  120. mc.displayGuiScreen(new GuiCustomMainMenu());
  121. }
  122.  
  123. proxy.registerRenders();
  124. }@EventHandler
  125. public void postInit(FMLPostInitializationEvent event)
  126. {
  127. MinecraftForge.EVENT_BUS.register(new EventBackPack());
  128.  
  129. }
  130.  
  131. }
Advertisement
RAW Paste Data Copied
Advertisement