Guest User

Untitled

a guest
Sep 25th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.78 KB | None | 0 0
  1. package de.krokoyt.gswords;
  2.  
  3. import net.minecraft.client.settings.KeyBinding;
  4. import net.minecraft.command.ServerCommandManager;
  5. import net.minecraft.creativetab.CreativeTabs;
  6. import net.minecraft.init.Blocks;
  7. import net.minecraft.init.Items;
  8. import net.minecraft.item.Item;
  9. import net.minecraft.item.Item.ToolMaterial;
  10. import net.minecraft.item.ItemStack;
  11. import net.minecraftforge.common.MinecraftForge;
  12. import net.minecraftforge.common.util.EnumHelper;
  13.  
  14. import org.lwjgl.input.Keyboard;
  15.  
  16. import cpw.mods.fml.client.registry.ClientRegistry;
  17. import cpw.mods.fml.common.FMLCommonHandler;
  18. import cpw.mods.fml.common.Mod;
  19. import cpw.mods.fml.common.Mod.EventHandler;
  20. import cpw.mods.fml.common.Mod.Instance;
  21. import cpw.mods.fml.common.SidedProxy;
  22. import cpw.mods.fml.common.event.FMLInitializationEvent;
  23. import cpw.mods.fml.common.event.FMLPostInitializationEvent;
  24. import cpw.mods.fml.common.event.FMLPreInitializationEvent;
  25. import cpw.mods.fml.common.event.FMLServerStartingEvent;
  26. import cpw.mods.fml.common.registry.GameRegistry;
  27. import de.krokoyt.gswords.Items.*;
  28. import de.krokoyt.gswords.commands.Level;
  29. import de.krokoyt.gswords.events.AddPackets;
  30. import de.krokoyt.gswords.events.Events;
  31. import de.krokoyt.gswords.events.KeyList;
  32. import de.krokoyt.gswords.events.ModLivingDropsEvent;
  33. import de.krokoyt.gswords.events.QuitAndJoin;
  34.  
  35. @Mod(modid = GiantSword.MODID, version = GiantSword.VERSION)
  36. public class GiantSword
  37. {
  38. public static final String MODID = "gswords";
  39. public static final String VERSION = "1.0";
  40. public static final String MOD_NAME = "GiantSword";
  41.  
  42. public static final String CLIENT_PROXY = "de.krokoyt.gswords.ClientProxy";
  43. public static final String SERVER_PROXY = "de.krokoyt.gswords.ServerProxy";
  44.  
  45. @Instance(MODID)
  46. public static GiantSword modInstance;
  47.  
  48. @SidedProxy(clientSide = GiantSword.CLIENT_PROXY, serverSide = GiantSword.SERVER_PROXY)
  49. public static CommonProxy proxy;
  50.  
  51. public static KeyBinding keyBinding = new KeyBinding("Show Skills", Keyboard.KEY_0, MOD_NAME);
  52.  
  53. public static Item WoodenGiantSword;
  54. public static Item StoneGiantSword;
  55. public static Item IronGiantSword;
  56. public static Item GoldenGiantSword;
  57. public static Item DiamondGiantSword;
  58. public static Item NetherGiantSword;
  59. public static Item SkullGiantSword;
  60. public static Item EnderGiantSword;
  61.  
  62. public static Item ZombieLeg;
  63.  
  64. public static Item Heartstone;
  65.  
  66. //(String name, int harvestLevel, int maxUses, float efficiency, float damage, int enchantability)
  67. public static ToolMaterial diagsword = EnumHelper.addToolMaterial("DiaGSword", 3, 2000, 50.0F, 4.5F, 50);
  68. public static ToolMaterial stonegsword = EnumHelper.addToolMaterial("StoneGSword", 3, 500, 50.0F, 2.0F, 50);
  69. public static ToolMaterial woodengsword = EnumHelper.addToolMaterial("WoodenGSword", 3, 400, 50.0F, 1.0F, 50);
  70. public static ToolMaterial goldgsword = EnumHelper.addToolMaterial("GoldGSword", 3, 300, 50.0F, 0.0F, 50);
  71. public static ToolMaterial endergsword = EnumHelper.addToolMaterial("EnderGSword", 3, 5000, 50.0F, 11.0F, 50);
  72. public static ToolMaterial skullgsword = EnumHelper.addToolMaterial("SkullGSword", 3, 2500, 50.0F, 8.0F, 50);
  73. public static ToolMaterial irongsword = EnumHelper.addToolMaterial("IronGSword", 3, 600, 50.0F, 3.0F, 50);
  74. public static ToolMaterial nethergsword = EnumHelper.addToolMaterial("NetherGSword", 3, 2500, 50.0F, 6.0F, 50);
  75.  
  76. public static ToolMaterial zombieleg = EnumHelper.addToolMaterial("ZombieLeg", 3, 900, 50.0F, 1.0F, 50);
  77.  
  78. public static GiantSword instance;
  79.  
  80. @EventHandler
  81. public void preInit(FMLPreInitializationEvent e) {
  82. AddPackets.init();
  83. WoodenGiantSword = new IronGiantSword(woodengsword).setUnlocalizedName("woodensword").setTextureName("gswords:GiantSwordWood").setCreativeTab(CreativeTabs.tabCombat);
  84. StoneGiantSword = new IronGiantSword(stonegsword).setUnlocalizedName("stonesword").setTextureName("gswords:GiantSwordStone").setCreativeTab(CreativeTabs.tabCombat);
  85. IronGiantSword = new IronGiantSword(irongsword).setUnlocalizedName("irongsword").setTextureName("gswords:GiantSwordIron").setCreativeTab(CreativeTabs.tabCombat);
  86. GoldenGiantSword = new GoldenGiantSword(goldgsword).setUnlocalizedName("goldgsword").setTextureName("gswords:GiantSwordGold").setCreativeTab(CreativeTabs.tabCombat);
  87. DiamondGiantSword = new DiamondGiantSword(diagsword).setUnlocalizedName("diagsword").setTextureName("gswords:GiantSwordDiamond").setCreativeTab(CreativeTabs.tabCombat);
  88. NetherGiantSword = new NetherGiantSword(nethergsword).setUnlocalizedName("nethergsword").setTextureName("gswords:GiantSwordNether").setCreativeTab(CreativeTabs.tabCombat);
  89. SkullGiantSword = new SkullGiantSword(skullgsword).setUnlocalizedName("skullgsword").setTextureName("gswords:GiantSwordSkull").setCreativeTab(CreativeTabs.tabCombat);
  90. EnderGiantSword = new EnderGiantSword(endergsword).setUnlocalizedName("endergsword").setTextureName("gswords:GiantSwordEnder").setCreativeTab(CreativeTabs.tabCombat);
  91.  
  92. ZombieLeg = new ZombieLeg(zombieleg).setUnlocalizedName("zombieleg").setTextureName("gswords:ZombieLeg").setCreativeTab(CreativeTabs.tabCombat);
  93.  
  94. Heartstone = new Heartstone().setUnlocalizedName("heartstone").setTextureName("gswords:heartStone").setCreativeTab(CreativeTabs.tabMisc);
  95.  
  96. GameRegistry.registerItem(WoodenGiantSword, "Wooden Giant Sword");
  97. GameRegistry.registerItem(StoneGiantSword, "Stone Giant Sword");
  98. GameRegistry.registerItem(IronGiantSword, "Iron Giant Sword");
  99. GameRegistry.registerItem(GoldenGiantSword, "Golden Giant Sword");
  100. GameRegistry.registerItem(DiamondGiantSword, "Diamond Giant Sword");
  101. GameRegistry.registerItem(NetherGiantSword, "Nether Giant Sword");
  102. GameRegistry.registerItem(SkullGiantSword, "Skull Giant Sword");
  103. GameRegistry.registerItem(EnderGiantSword, "Ender Giant Sword");
  104.  
  105. GameRegistry.registerItem(ZombieLeg, "Zombie leg");
  106.  
  107. GameRegistry.registerItem(Heartstone, "Heartstone");
  108.  
  109. ItemStack stick = new ItemStack(Items.stick, 1);
  110. ItemStack rod = new ItemStack(Items.blaze_rod, 1);
  111. ItemStack wood = new ItemStack(Blocks.planks, 1);
  112. ItemStack stone = new ItemStack(Blocks.cobblestone, 1);
  113. ItemStack iron = new ItemStack(Items.iron_ingot, 1);
  114. ItemStack gold = new ItemStack(Items.gold_ingot, 1);
  115. ItemStack dia = new ItemStack(Items.diamond, 1);
  116. ItemStack quarz = new ItemStack(Items.quartz, 1);
  117. ItemStack bone = new ItemStack(Items.bone, 1);
  118. ItemStack skull = new ItemStack(Items.skull, 1);
  119. ItemStack obsidian = new ItemStack(Blocks.obsidian, 1);
  120. ItemStack endereye = new ItemStack(Items.ender_eye, 1);
  121.  
  122. ItemStack woodGiant = new ItemStack(WoodenGiantSword);
  123.  
  124. GameRegistry.addRecipe(woodGiant, " ww","www","tw ", 'w', wood, 't', stick);
  125.  
  126. ItemStack stoneGiant = new ItemStack(StoneGiantSword);
  127.  
  128. GameRegistry.addRecipe(stoneGiant, " ss","sss","ts ", 's', stone, 't', stick);
  129.  
  130. ItemStack ironGiant = new ItemStack(IronGiantSword);
  131.  
  132. GameRegistry.addRecipe(ironGiant, " ii","iii","ti ", 'i', iron, 't', stick);
  133.  
  134. ItemStack goldGiant = new ItemStack(GoldenGiantSword);
  135.  
  136. GameRegistry.addRecipe(goldGiant, " gg","ggg","tg ", 'g', gold, 't', stick);
  137.  
  138. ItemStack diamondGiant = new ItemStack(DiamondGiantSword);
  139.  
  140. GameRegistry.addRecipe(diamondGiant, " dd","ddd","td ", 'd', dia, 't', stick);
  141.  
  142. ItemStack netherGiant = new ItemStack(NetherGiantSword);
  143.  
  144. GameRegistry.addRecipe(netherGiant, " qq","qqq","bq ", 'q', quarz, 'b', rod);
  145.  
  146. ItemStack SkullGiant = new ItemStack(SkullGiantSword);
  147.  
  148. GameRegistry.addRecipe(SkullGiant, " bb","bkb","tb ", 'b', bone,'k',skull, 't', stick);
  149.  
  150. ItemStack EnderGiant = new ItemStack(EnderGiantSword);
  151.  
  152. GameRegistry.addRecipe(EnderGiant, " oo","oeo","bo ", 'o', obsidian,'e',endereye, 'b', rod);
  153.  
  154. MinecraftForge.EVENT_BUS.register(new ModLivingDropsEvent());
  155. MinecraftForge.EVENT_BUS.register(new Events());
  156. MinecraftForge.EVENT_BUS.register(new QuitAndJoin());
  157. FMLCommonHandler.instance().bus().register(new KeyList());
  158.  
  159. ClientRegistry.registerKeyBinding(keyBinding);
  160. }
  161.  
  162. @EventHandler
  163. public void registerCommands(FMLServerStartingEvent e) {
  164. ServerCommandManager manager = (ServerCommandManager) e.getServer().getCommandManager();
  165. manager.registerCommand(new Level());
  166. }
  167.  
  168. @EventHandler
  169. public void init(FMLInitializationEvent event)
  170. {
  171.  
  172. proxy.registerRenders();
  173. }
  174.  
  175. @EventHandler
  176. public void postInit(FMLPostInitializationEvent e) {
  177. //Blocks and Items from other Mods
  178. }
  179. }
Add Comment
Please, Sign In to add comment