Guest User

main class

a guest
Nov 5th, 2014
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.00 KB | None | 0 0
  1. package theceruleanflash.TCFMod;
  2.  
  3. import theceruleanflash.TCFMod.item.ItemAmethystArmor;
  4. import theceruleanflash.TCFMod.item.ItemAmethystAxe;
  5. import theceruleanflash.TCFMod.item.ItemAmethystHoe;
  6. import theceruleanflash.TCFMod.item.ItemAmethystPickaxe;
  7. import theceruleanflash.TCFMod.item.ItemAmethystShovel;
  8. import theceruleanflash.TCFMod.item.ItemAmethystSword;
  9. import net.minecraft.block.Block;
  10. import net.minecraft.block.material.Material;
  11. import net.minecraft.creativetab.CreativeTabs;
  12. import net.minecraft.entity.passive.EntityChicken;
  13. import net.minecraft.entity.passive.EntitySheep;
  14. import net.minecraft.init.Blocks;
  15. import net.minecraft.init.Items;
  16. import net.minecraft.item.Item;
  17. import net.minecraft.item.ItemArmor;
  18. import net.minecraft.item.ItemFood;
  19. import net.minecraft.item.ItemSeeds;
  20. import net.minecraft.item.ItemSoup;
  21. import net.minecraft.item.ItemStack;
  22. import net.minecraftforge.common.MinecraftForge;
  23. import net.minecraftforge.common.util.EnumHelper;
  24. import net.minecraftforge.event.entity.living.LivingDropsEvent;
  25. import cpw.mods.fml.common.Mod;
  26. import cpw.mods.fml.common.Mod.EventHandler;
  27. import cpw.mods.fml.common.event.FMLInitializationEvent;
  28. import cpw.mods.fml.common.event.FMLPostInitializationEvent;
  29. import cpw.mods.fml.common.event.FMLPreInitializationEvent;
  30. import cpw.mods.fml.common.registry.GameRegistry;
  31.  
  32. import java.util.Random;
  33.  
  34. import net.minecraft.entity.passive.EntityCow;
  35. import net.minecraft.item.ItemStack;
  36. import net.minecraftforge.event.entity.living.LivingDropsEvent;
  37. import cpw.mods.fml.common.eventhandler.SubscribeEvent;
  38.  
  39.  
  40. @Mod(modid = "tcfm", name = "TCF Mod", version = "1.0")
  41. public class TCFMod {
  42.  
  43. public static Item itemFriedEgg;
  44. public static Item itemCocoaNibs;
  45. public static Item itemChocolateLiquor;
  46. public static Item itemUnsweetenedChocolate;
  47. public static Item itemMilkChocolate;
  48. public static Item itemDarkChocolate;
  49. public static Item itemChickenSandwich;
  50. public static Item itemHamburger;
  51. public static Item itemAmethyst;
  52. public static Block blockAmethystOre;
  53. public static Block cropRice;
  54. public static Item amethystPickaxe;
  55. public static Item amethystSword;
  56. public static Item amethystAxe;
  57. public static Item amethystHoe;
  58. public static Item amethystShovel;
  59. public static Item amethystHelmet;
  60. public static Item amethystChestplate;
  61. public static Item amethystLeggings;
  62. public static Item amethystBoots;
  63. public static Item itemRiceSeed;
  64. public static Item itemRiceCrop;
  65. public static Item itemBowlOfRice;
  66. public static Item itemCactusFruit;
  67. public static Item itemApplePie;
  68. public static Item itemTCFLogo;
  69.  
  70. public static final Item.ToolMaterial amethystToolMaterial = EnumHelper.addToolMaterial("amethystToolMaterial", 2, 400, 7.0F, 2.5F, 14);
  71. public static final ItemArmor.ArmorMaterial amethystArmorMaterial = EnumHelper.addArmorMaterial("amethystArmorMaterial", 390, new int []{2,7,6,2} , 9);
  72.  
  73.  
  74.  
  75.  
  76. @EventHandler
  77. public void preInit(FMLPreInitializationEvent event) {
  78. //Item/Block init and registering
  79. //Config handling
  80. itemFriedEgg = new ItemFood(5, 0.8F, false).setUnlocalizedName("ItemFriedEgg").setTextureName("tcfm:itemfriedegg").setCreativeTab(tabTCFMod);
  81. itemCocoaNibs = new Item().setUnlocalizedName("ItemCocoaNibs").setTextureName("tcfm:itemcocoanibs").setCreativeTab(tabTCFMod).setCreativeTab(CreativeTabs.tabMaterials);
  82. itemChocolateLiquor = new Item().setUnlocalizedName("ItemChocolateLiquor").setTextureName("tcfm:itemchocolateliquor").setCreativeTab(tabTCFMod);
  83. itemUnsweetenedChocolate = new ItemFood(2, 0.3F, false).setUnlocalizedName("ItemUnsweetenedChocolate").setTextureName("tcfm:itemunsweetenedchocolate").setCreativeTab(tabTCFMod);
  84. itemMilkChocolate = new ItemFood(3, 0.5F, false).setUnlocalizedName("ItemMilkChocolate").setTextureName("tcfm:itemmilkchocolate").setCreativeTab(tabTCFMod);
  85. itemDarkChocolate = new ItemFood(3, 0.5F, false).setUnlocalizedName("ItemDarkChocolate").setTextureName("tcfm:itemdarkchocolate").setCreativeTab(tabTCFMod);
  86. itemChickenSandwich = new ItemFood(16, 3.6F, true).setUnlocalizedName("ItemChickenSandwich").setTextureName("tcfm:itemchickensandwich").setCreativeTab(tabTCFMod);
  87. itemHamburger = new ItemFood(20, 4.0F, true).setUnlocalizedName("ItemHamburger").setTextureName("tcfm:itemhamburger").setCreativeTab(tabTCFMod);
  88. itemAmethyst = new Item().setUnlocalizedName("ItemAmethyst").setTextureName("tcfm:itemamethyst").setCreativeTab(tabTCFMod);
  89. itemTCFLogo = new Item().setUnlocalizedName("ItemTCFLogo").setTextureName("tcfm:itemtcflogo").setCreativeTab(tabTCFMod);
  90.  
  91. cropRice = new CropRice().setBlockName("CropRice").setBlockTextureName("tcfm:blockricecrop");
  92. itemRiceCrop = new Item().setUnlocalizedName("ItemRiceCrop").setTextureName("tcfm:itemricecrop").setCreativeTab(tabTCFMod);
  93. itemRiceSeed = new ItemSeeds(cropRice, Blocks.farmland).setUnlocalizedName("ItemRiceSeeds").setTextureName("tcfm:itemriceseeds").setCreativeTab(tabTCFMod);
  94. itemBowlOfRice = new ItemSoup(3).setUnlocalizedName("ItemBowlOfRice").setTextureName("tcfm:itembowlofrice").setCreativeTab(tabTCFMod);
  95.  
  96.  
  97.  
  98. itemCactusFruit = new ItemFood(2, 0.1F, false).setUnlocalizedName("ItemCactusFruit").setTextureName("tcfm:itemcactusfruit").setCreativeTab(tabTCFMod);
  99.  
  100. itemApplePie = new ItemFood(7, 0.6F, false).setUnlocalizedName("ItemApplePie").setTextureName("tcfm:itemapplepie").setCreativeTab(tabTCFMod);
  101.  
  102.  
  103. amethystPickaxe = new ItemAmethystPickaxe(amethystToolMaterial).setUnlocalizedName("ItemAmethystPickaxe").setTextureName("tcfm:itemamethystpickaxe").setCreativeTab(tabTCFMod);
  104. amethystSword = new ItemAmethystSword(amethystToolMaterial).setUnlocalizedName("ItemAmethystSword").setTextureName("tcfm:itemamethystsword").setCreativeTab(tabTCFMod);
  105. amethystAxe = new ItemAmethystAxe(amethystToolMaterial).setUnlocalizedName("ItemAmethystAxe").setTextureName("tcfm:itemamethystaxe").setCreativeTab(tabTCFMod);
  106. amethystHoe = new ItemAmethystHoe(amethystToolMaterial).setUnlocalizedName("ItemAmethystHoe").setTextureName("tcfm:itemamethysthoe").setCreativeTab(tabTCFMod);
  107. amethystShovel = new ItemAmethystShovel(amethystToolMaterial).setUnlocalizedName("ItemAmethystShovel").setTextureName("tcfm:itemamethystshovel").setCreativeTab(tabTCFMod);
  108.  
  109.  
  110. amethystHelmet = new ItemAmethystArmor(amethystArmorMaterial, 0, 0).setUnlocalizedName("ItemAmethystHelmet").setTextureName("tcfm:itemamethysthelmet").setCreativeTab(tabTCFMod);
  111. amethystChestplate = new ItemAmethystArmor(amethystArmorMaterial, 0, 1).setUnlocalizedName("ItemAmethystChestplate").setTextureName("tcfm:itemamethystchestplate").setCreativeTab(tabTCFMod);
  112. amethystLeggings = new ItemAmethystArmor(amethystArmorMaterial, 0, 2).setUnlocalizedName("ItemAmethystLeggings").setTextureName("tcfm:itemamethystleggings").setCreativeTab(tabTCFMod);
  113. amethystBoots = new ItemAmethystArmor(amethystArmorMaterial, 0, 3).setUnlocalizedName("ItemAmethystBoots").setTextureName("tcfm:itemamethystboots").setCreativeTab(tabTCFMod);
  114.  
  115.  
  116.  
  117.  
  118.  
  119. blockAmethystOre = new BlockAmethystOre(Material.rock).setBlockName("BlockAmethystOre").setBlockTextureName("tcfm:blockamethystore").setCreativeTab(tabTCFMod);
  120.  
  121.  
  122.  
  123. GameRegistry.registerItem(itemCocoaNibs, itemCocoaNibs.getUnlocalizedName().substring(5));
  124. GameRegistry.registerItem(itemFriedEgg, itemFriedEgg.getUnlocalizedName().substring(5));
  125. GameRegistry.registerItem(itemChocolateLiquor, itemChocolateLiquor.getUnlocalizedName().substring(5));
  126. GameRegistry.registerItem(itemUnsweetenedChocolate, itemUnsweetenedChocolate.getUnlocalizedName().substring(5));
  127. GameRegistry.registerItem(itemMilkChocolate, itemMilkChocolate.getUnlocalizedName().substring(5));
  128. GameRegistry.registerItem(itemDarkChocolate, itemDarkChocolate.getUnlocalizedName().substring(5));
  129. GameRegistry.registerItem(itemChickenSandwich, itemChickenSandwich.getUnlocalizedName().substring(5));
  130. GameRegistry.registerItem(itemHamburger, itemHamburger.getUnlocalizedName().substring(5));
  131. GameRegistry.registerItem(itemAmethyst, itemAmethyst.getUnlocalizedName().substring(5));
  132. GameRegistry.registerBlock(blockAmethystOre, blockAmethystOre.getUnlocalizedName().substring(5));
  133. System.out.println(blockAmethystOre.getUnlocalizedName().substring(5));
  134. GameRegistry.registerItem(itemTCFLogo, itemTCFLogo.getUnlocalizedName().substring(5));
  135. GameRegistry.registerWorldGenerator(new AmethystGeneration(), 0);
  136.  
  137. GameRegistry.registerItem(amethystPickaxe, amethystPickaxe.getUnlocalizedName().substring(5));
  138. GameRegistry.registerItem(amethystSword, amethystSword.getUnlocalizedName().substring(5));
  139. GameRegistry.registerItem(amethystAxe, amethystAxe.getUnlocalizedName().substring(5));
  140. GameRegistry.registerItem(amethystHoe, amethystHoe.getUnlocalizedName().substring(5));
  141. GameRegistry.registerItem(amethystShovel, amethystShovel.getUnlocalizedName().substring(5));
  142.  
  143. GameRegistry.registerItem(amethystHelmet, amethystHelmet.getUnlocalizedName().substring(5));
  144. GameRegistry.registerItem(amethystChestplate, amethystChestplate.getUnlocalizedName().substring(5));
  145. GameRegistry.registerItem(amethystLeggings, amethystLeggings.getUnlocalizedName().substring(5));
  146. GameRegistry.registerItem(amethystBoots, amethystBoots.getUnlocalizedName().substring(5));
  147.  
  148. GameRegistry.registerItem(itemRiceSeed, itemRiceSeed.getUnlocalizedName().substring(5));
  149. GameRegistry.registerItem(itemRiceCrop, itemRiceCrop.getUnlocalizedName().substring(5));
  150. GameRegistry.registerBlock(cropRice, cropRice.getUnlocalizedName().substring(5));
  151. GameRegistry.registerItem(itemBowlOfRice, itemBowlOfRice.getUnlocalizedName().substring(5));
  152. GameRegistry.registerItem(itemApplePie, itemApplePie.getUnlocalizedName().substring(5));
  153.  
  154.  
  155. GameRegistry.registerItem(itemCactusFruit, itemCactusFruit.getUnlocalizedName().substring(5));
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168. // X * 0.5 = 10 hunger
  169. // beef saturation 0.8F
  170. //hunger, saturation, dog
  171.  
  172.  
  173.  
  174. GameRegistry.addRecipe(new ItemStack(itemUnsweetenedChocolate, 1), new Object[]{"NNN","NLN","NNN",'L', itemChocolateLiquor, 'N', itemCocoaNibs });
  175. GameRegistry.addRecipe(new ItemStack(itemChickenSandwich, 1), new Object[]{" B "," C "," B ",'C', Items.cooked_chicken, 'B', Items.bread });
  176. GameRegistry.addRecipe(new ItemStack(itemHamburger, 1), new Object[]{" B "," S "," B ",'S', Items.cooked_beef, 'B', Items.bread });
  177.  
  178. GameRegistry.addRecipe(new ItemStack(amethystPickaxe, 1), new Object[]{"AAA"," S "," S ",'S', Items.stick, 'A', itemAmethyst });
  179. GameRegistry.addRecipe(new ItemStack(amethystAxe, 1), new Object[]{"AA","AS"," S",'S', Items.stick, 'A', itemAmethyst });
  180. GameRegistry.addRecipe(new ItemStack(amethystShovel, 1), new Object[]{"A","S","S",'S', Items.stick, 'A', itemAmethyst });
  181. GameRegistry.addRecipe(new ItemStack(amethystSword, 1), new Object[]{"A","A","S",'S', Items.stick, 'A', itemAmethyst });
  182. GameRegistry.addRecipe(new ItemStack(amethystHoe, 1), new Object[]{"AA"," S"," S",'S', Items.stick, 'A', itemAmethyst });
  183.  
  184. GameRegistry.addRecipe(new ItemStack(amethystHelmet, 1), new Object[]{"AAA","A A", 'A', itemAmethyst });
  185. GameRegistry.addRecipe(new ItemStack(amethystChestplate, 1), new Object[]{"A A","AAA","AAA", 'A', itemAmethyst });
  186. GameRegistry.addRecipe(new ItemStack(amethystLeggings, 1), new Object[]{"AAA","A A","A A", 'A', itemAmethyst });
  187. GameRegistry.addRecipe(new ItemStack(amethystBoots, 1), new Object[]{"A A","A A", 'A', itemAmethyst });
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196. GameRegistry.addShapelessRecipe(new ItemStack(itemApplePie, 1), new Object[] { new ItemStack(Items.sugar), new ItemStack (Items.apple), new ItemStack (Items.egg)});
  197.  
  198.  
  199. GameRegistry.addShapelessRecipe(new ItemStack(itemMilkChocolate, 1), new Object[] { new ItemStack(itemUnsweetenedChocolate), new ItemStack (Items.milk_bucket)});
  200. GameRegistry.addShapelessRecipe(new ItemStack(itemDarkChocolate, 1), new Object[] { new ItemStack(itemUnsweetenedChocolate), new ItemStack (Items.sugar)});
  201. GameRegistry.addShapelessRecipe(new ItemStack(itemCocoaNibs, 2), new Object[] { new ItemStack(Items.dye, 1, 3) });
  202. GameRegistry.addSmelting(Items.egg, new ItemStack(itemFriedEgg), 5.0F);
  203. GameRegistry.addSmelting(itemCocoaNibs, new ItemStack(itemChocolateLiquor), 5.0F);
  204.  
  205. GameRegistry.addShapelessRecipe(new ItemStack(itemBowlOfRice, 1), new Object[] { new ItemStack(itemRiceCrop), new ItemStack (Items.bowl)});
  206.  
  207. GameRegistry.addShapelessRecipe(new ItemStack(itemCactusFruit, 1), new Object[] { new ItemStack(Blocks.cactus) });
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214. }
  215.  
  216. @EventHandler
  217. public void init(FMLInitializationEvent event) {
  218. //Proxy, TileENtity, entity, GUI and Packet Registering
  219.  
  220.  
  221. MinecraftForge.EVENT_BUS.register(new DropHandler());
  222.  
  223.  
  224.  
  225.  
  226.  
  227. }
  228.  
  229. @EventHandler
  230. public void postInit(FMLPostInitializationEvent event) {
  231.  
  232. }
  233.  
  234. public static CreativeTabs tabTCFMod = new CreativeTabs("tabTCFMod"){
  235. @Override
  236. public Item getTabIconItem(){
  237. return new ItemStack(itemTCFLogo).getItem();
  238. }
  239. };
  240. }
Advertisement
Add Comment
Please, Sign In to add comment