Guest User

Untitled

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