Advertisement
Guest User

Untitled

a guest
Dec 15th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.53 KB | None | 0 0
  1. package mymod;
  2.  
  3. import mymod.blocks.MyBlock;
  4. import mymod.items.MyFood;
  5. import mymod.items.MyItem;
  6. import mymod.items.MyPickaxe;
  7. import mymod.items.MySword;
  8. import mymod.proxies.CommonProxy;
  9. import net.minecraft.item.EnumToolMaterial;
  10. import net.minecraft.item.Item;
  11. import net.minecraft.item.ItemStack;
  12. import net.minecraftforge.common.EnumHelper;
  13. import cpw.mods.fml.common.Mod;
  14. import cpw.mods.fml.common.Mod.EventHandler;
  15. import cpw.mods.fml.common.SidedProxy;
  16. import cpw.mods.fml.common.event.FMLInitializationEvent;
  17. import cpw.mods.fml.common.event.FMLPostInitializationEvent;
  18. import cpw.mods.fml.common.event.FMLPreInitializationEvent;
  19. import cpw.mods.fml.common.network.NetworkMod;
  20. import cpw.mods.fml.common.registry.GameRegistry;
  21. import cpw.mods.fml.common.registry.LanguageRegistry;
  22. import net.minecraft.creativetab.CreativeTabs;
  23. import net.minecraft.block.Block;
  24. import net.minecraft.block.material.Material;
  25. import net.minecraftforge.common.MinecraftForge;
  26.  
  27.  
  28. /* MOD INFO */
  29. @Mod( modid = "mymod", name = "Sword Mod", version = "1.0")
  30. @NetworkMod(clientSideRequired=true, serverSideRequired=false)
  31.  
  32.  
  33. public class Main {
  34.  
  35. private static final CreativeTabs Materials = null;
  36.  
  37.  
  38. /* PROXY INFO */
  39. @SidedProxy(clientSide = "mymod.proxies.ClientProxy", serverSide = "mymod.proxies.CommonProxy")
  40. public static CommonProxy proxy;
  41.  
  42.  
  43. /**
  44. * DECLARATION SECTION
  45. * *********************************************************** */
  46. // DECLARE NEW TOOL MATERIAL
  47. public static EnumToolMaterial MyToolMaterial = EnumHelper.addToolMaterial("Awesomeness", 3, 100, 80.0F, 30.0F, 10);
  48. /**HARVEST LEVEL,MAX USES,EFFICENCY(F) , DAMAGE(F)*/
  49. // DECLARE THE SWORD
  50. public static Item MySword_1;
  51.  
  52. // DECLARE THE PICKAXE
  53. public static Item MyPickaxe_1;
  54.  
  55. // DECLARE THE ITEM
  56. public static Item MyItem_1;
  57.  
  58. // DECLARE THE FOOD
  59. public static Item MyFood_1;
  60.  
  61. // DECLARE THE BLOCK
  62. public static Block MyBlock_1;
  63.  
  64.  
  65.  
  66.  
  67. /* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
  68.  
  69.  
  70. @EventHandler
  71. public void preInit( FMLPreInitializationEvent event )
  72. {
  73. /**
  74. * LOAD SECTION
  75. * *********************************************************** */
  76.  
  77. // LOAD THE FOOD
  78. MyFood_1 = new MyFood(10, 30, 30.0F, true, "MyFood_1");
  79.  
  80. GameRegistry.registerItem(MyFood_1, "MyFood_1");
  81. LanguageRegistry.addName(MyFood_1, "Nether Gem Bread");
  82.  
  83. // LOAD THE SWORD
  84. MySword_1 = new MySword(2021, MyToolMaterial, "MySword_1");
  85. GameRegistry.registerItem(MySword_1, "MySword_1");
  86. LanguageRegistry.addName(MySword_1, "Nether Gem Sword");
  87.  
  88. // LOAD THE PICKAXE
  89. MyPickaxe_1 = new MyPickaxe(2022, MyToolMaterial, "MyPickaxe_1");
  90. GameRegistry.registerItem(MyPickaxe_1, "MyPickaxe_1");
  91. LanguageRegistry.addName(MyPickaxe_1, "Nether Gem Pickaxe");
  92.  
  93. // LOAD THE ITEM
  94. MyItem_1 = new MyItem(2030, "MyItem_1").setCreativeTab(CreativeTabs.tabMaterials).setMaxStackSize(64);
  95. GameRegistry.registerItem(MyItem_1, "MyItem_1");
  96. LanguageRegistry.addName(MyItem_1, "Nether Gem");
  97. }
  98. /* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
  99.  
  100.  
  101. @EventHandler
  102. public static void init( FMLInitializationEvent event )
  103. {
  104.  
  105. /**
  106. * RECIPES SECTION
  107. * *********************************************************** */
  108.  
  109. // SWORD RECIPE
  110. GameRegistry.addRecipe(new ItemStack(MySword_1, 1), new Object[]
  111. {
  112. "X",
  113. "X",
  114. "S",
  115. 'S', Item.stick,
  116. 'X',MyItem_1 ,
  117. });
  118.  
  119. // PICKAXE RECIPE
  120. GameRegistry.addRecipe(new ItemStack(MyPickaxe_1, 1), new Object[]
  121. {
  122. "XXX",
  123. " S ",
  124. " S ",
  125. 'S', Item.stick,
  126. 'X',MyItem_1 ,
  127. });
  128.  
  129.  
  130.  
  131. // FOOD RECIPE
  132. GameRegistry.addRecipe(new ItemStack(MyFood_1, 1), new Object[]
  133. {
  134.  
  135.  
  136. "SSS",
  137.  
  138.  
  139.  
  140.  
  141. 'S', MyItem_1,
  142. });
  143.  
  144.  
  145. // SMELTING RECIPE
  146. GameRegistry.addSmelting(MyBlock_1.blockID, (new ItemStack(MyItem_1, 16)), 9999999.0F);
  147.  
  148.  
  149. /* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
  150.  
  151.  
  152. /**
  153. * EXTRA METHODS SECTION
  154. * *********************************************************** */
  155.  
  156.  
  157.  
  158.  
  159.  
  160. /* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ */
  161.  
  162.  
  163. }
  164.  
  165. @EventHandler
  166. public static void postInit( FMLPostInitializationEvent event )
  167. {
  168.  
  169. }
  170.  
  171. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement