Guest User

Untitled

a guest
Nov 1st, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.18 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.  
  67.  
  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.5F, 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(4, 0.3F, false).setUnlocalizedName("ItemUnsweetenedChocolate").setTextureName("tcfm:itemunsweetenedchocolate").setCreativeTab(tabTCFMod);
  84. itemMilkChocolate = new ItemFood(6, 0.5F, false).setUnlocalizedName("ItemMilkChocolate").setTextureName("tcfm:itemmilkchocolate").setCreativeTab(tabTCFMod);
  85. itemDarkChocolate = new ItemFood(6, 0.5F, false).setUnlocalizedName("ItemDarkChocolate").setTextureName("tcfm:itemdarkchocolate").setCreativeTab(tabTCFMod);
  86. itemChickenSandwich = new ItemFood(16, 1.0F, true).setUnlocalizedName("ItemChickenSandwich").setTextureName("tcfm:itemchickensandwich").setCreativeTab(tabTCFMod);
  87. itemHamburger = new ItemFood(20, 1.1F, 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").setCreativeTab(tabTCFMod).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(2).setUnlocalizedName("ItemBowlOfRice").setTextureName("tcfm:itembowlofrice").setCreativeTab(tabTCFMod);
  95.  
  96.  
  97.  
  98.  
  99. amethystPickaxe = new ItemAmethystPickaxe(amethystToolMaterial).setUnlocalizedName("ItemAmethystPickaxe").setTextureName("tcfm:itemamethystpickaxe").setCreativeTab(tabTCFMod);
  100. amethystSword = new ItemAmethystSword(amethystToolMaterial).setUnlocalizedName("ItemAmethystSword").setTextureName("tcfm:itemamethystsword").setCreativeTab(tabTCFMod);
  101. amethystAxe = new ItemAmethystAxe(amethystToolMaterial).setUnlocalizedName("ItemAmethystAxe").setTextureName("tcfm:itemamethystaxe").setCreativeTab(tabTCFMod);
  102. amethystHoe = new ItemAmethystHoe(amethystToolMaterial).setUnlocalizedName("ItemAmethystHoe").setTextureName("tcfm:itemamethysthoe").setCreativeTab(tabTCFMod);
  103. amethystShovel = new ItemAmethystShovel(amethystToolMaterial).setUnlocalizedName("ItemAmethystShovel").setTextureName("tcfm:itemamethystshovel").setCreativeTab(tabTCFMod);
  104.  
  105.  
  106. amethystHelmet = new ItemAmethystArmor(amethystArmorMaterial, 0, 0).setUnlocalizedName("ItemAmethystHelmet").setTextureName("tcfm:itemamethysthelmet").setCreativeTab(tabTCFMod);
  107. amethystChestplate = new ItemAmethystArmor(amethystArmorMaterial, 0, 1).setUnlocalizedName("ItemAmethystChestplate").setTextureName("tcfm:itemamethystchestplate").setCreativeTab(tabTCFMod);
  108. amethystLeggings = new ItemAmethystArmor(amethystArmorMaterial, 0, 2).setUnlocalizedName("ItemAmethystLeggings").setTextureName("tcfm:itemamethystleggings").setCreativeTab(tabTCFMod);
  109. amethystBoots = new ItemAmethystArmor(amethystArmorMaterial, 0, 3).setUnlocalizedName("ItemAmethystBoots").setTextureName("tcfm:itemamethystboots").setCreativeTab(tabTCFMod);
  110.  
  111.  
  112.  
  113.  
  114.  
  115. blockAmethystOre = new BlockAmethystOre(Material.rock).setBlockName("BlockAmethystOre").setBlockTextureName("tcfm:blockamethystore").setCreativeTab(tabTCFMod);
  116.  
  117.  
  118.  
  119. GameRegistry.registerItem(itemCocoaNibs, itemCocoaNibs.getUnlocalizedName().substring(5));
  120. GameRegistry.registerItem(itemFriedEgg, itemFriedEgg.getUnlocalizedName().substring(5));
  121. GameRegistry.registerItem(itemChocolateLiquor, itemChocolateLiquor.getUnlocalizedName().substring(5));
  122. GameRegistry.registerItem(itemUnsweetenedChocolate, itemUnsweetenedChocolate.getUnlocalizedName().substring(5));
  123. GameRegistry.registerItem(itemMilkChocolate, itemMilkChocolate.getUnlocalizedName().substring(5));
  124. GameRegistry.registerItem(itemDarkChocolate, itemDarkChocolate.getUnlocalizedName().substring(5));
  125. GameRegistry.registerItem(itemChickenSandwich, itemChickenSandwich.getUnlocalizedName().substring(5));
  126. GameRegistry.registerItem(itemHamburger, itemHamburger.getUnlocalizedName().substring(5));
  127. GameRegistry.registerItem(itemAmethyst, itemAmethyst.getUnlocalizedName().substring(5));
  128. GameRegistry.registerBlock(blockAmethystOre, blockAmethystOre.getUnlocalizedName().substring(5));
  129. System.out.println(blockAmethystOre.getUnlocalizedName().substring(5));
  130. GameRegistry.registerItem(itemTCFLogo, itemTCFLogo.getUnlocalizedName().substring(5));
  131. GameRegistry.registerWorldGenerator(new AmethystGeneration(), 0);
  132.  
  133. GameRegistry.registerItem(amethystPickaxe, amethystPickaxe.getUnlocalizedName().substring(5));
  134. GameRegistry.registerItem(amethystSword, amethystSword.getUnlocalizedName().substring(5));
  135. GameRegistry.registerItem(amethystAxe, amethystAxe.getUnlocalizedName().substring(5));
  136. GameRegistry.registerItem(amethystHoe, amethystHoe.getUnlocalizedName().substring(5));
  137. GameRegistry.registerItem(amethystShovel, amethystShovel.getUnlocalizedName().substring(5));
  138.  
  139. GameRegistry.registerItem(amethystHelmet, amethystHelmet.getUnlocalizedName().substring(5));
  140. GameRegistry.registerItem(amethystChestplate, amethystChestplate.getUnlocalizedName().substring(5));
  141. GameRegistry.registerItem(amethystLeggings, amethystLeggings.getUnlocalizedName().substring(5));
  142. GameRegistry.registerItem(amethystBoots, amethystBoots.getUnlocalizedName().substring(5));
  143.  
  144. GameRegistry.registerItem(itemRiceSeed, itemRiceSeed.getUnlocalizedName().substring(5));
  145. GameRegistry.registerItem(itemRiceCrop, itemRiceCrop.getUnlocalizedName().substring(5));
  146. GameRegistry.registerBlock(cropRice, cropRice.getUnlocalizedName().substring(5));
  147. GameRegistry.registerItem(itemBowlOfRice, itemBowlOfRice.getUnlocalizedName().substring(5));
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159. // X * 0.5 = 10 hunger
  160. // beef saturation 0.8F
  161. //hunger, saturation, dog
  162.  
  163.  
  164.  
  165. GameRegistry.addRecipe(new ItemStack(itemUnsweetenedChocolate, 1), new Object[]{"NNN","NLN","NNN",'L', itemChocolateLiquor, 'N', itemCocoaNibs });
  166. GameRegistry.addRecipe(new ItemStack(itemChickenSandwich, 1), new Object[]{" B "," C "," B ",'C', Items.cooked_chicken, 'B', Items.bread });
  167. GameRegistry.addRecipe(new ItemStack(itemHamburger, 1), new Object[]{" B "," S "," B ",'S', Items.cooked_beef, 'B', Items.bread });
  168.  
  169. GameRegistry.addRecipe(new ItemStack(amethystPickaxe, 1), new Object[]{"AAA"," S "," S ",'S', Items.stick, 'A', itemAmethyst });
  170. GameRegistry.addRecipe(new ItemStack(amethystAxe, 1), new Object[]{"AA","AS"," S",'S', Items.stick, 'A', itemAmethyst });
  171. GameRegistry.addRecipe(new ItemStack(amethystShovel, 1), new Object[]{"A","S","S",'S', Items.stick, 'A', itemAmethyst });
  172. GameRegistry.addRecipe(new ItemStack(amethystSword, 1), new Object[]{"A","A","S",'S', Items.stick, 'A', itemAmethyst });
  173. GameRegistry.addRecipe(new ItemStack(amethystHoe, 1), new Object[]{"AA"," S"," S",'S', Items.stick, 'A', itemAmethyst });
  174.  
  175. GameRegistry.addRecipe(new ItemStack(amethystHelmet, 1), new Object[]{"AAA","A A", 'A', itemAmethyst });
  176. GameRegistry.addRecipe(new ItemStack(amethystChestplate, 1), new Object[]{"A A","AAA","AAA", 'A', itemAmethyst });
  177. GameRegistry.addRecipe(new ItemStack(amethystLeggings, 1), new Object[]{"AAA","A A","A A", 'A', itemAmethyst });
  178. GameRegistry.addRecipe(new ItemStack(amethystBoots, 1), new Object[]{"A A","A A", 'A', itemAmethyst });
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189. GameRegistry.addShapelessRecipe(new ItemStack(itemMilkChocolate, 1), new Object[] { new ItemStack(itemUnsweetenedChocolate), new ItemStack (Items.milk_bucket)});
  190. GameRegistry.addShapelessRecipe(new ItemStack(itemDarkChocolate, 1), new Object[] { new ItemStack(itemUnsweetenedChocolate), new ItemStack (Items.sugar)});
  191. GameRegistry.addShapelessRecipe(new ItemStack(itemCocoaNibs, 2), new Object[] { new ItemStack(Items.dye, 1, 3) });
  192. GameRegistry.addSmelting(Items.egg, new ItemStack(itemFriedEgg), 5.0F);
  193. GameRegistry.addSmelting(itemCocoaNibs, new ItemStack(itemChocolateLiquor), 5.0F);
  194.  
  195. GameRegistry.addShapelessRecipe(new ItemStack(itemBowlOfRice, 1), new Object[] { new ItemStack(itemRiceCrop), new ItemStack (Items.bowl)});
  196.  
  197.  
  198.  
  199.  
  200.  
  201. }
  202.  
  203. @EventHandler
  204. public void init(FMLInitializationEvent event) {
  205. //Proxy, TileENtity, entity, GUI and Packet Registering
  206.  
  207.  
  208. MinecraftForge.EVENT_BUS.register(new DropHandler());
  209.  
  210.  
  211.  
  212.  
  213.  
  214. }
  215.  
  216. @EventHandler
  217. public void postInit(FMLPostInitializationEvent event) {
  218.  
  219. }
  220.  
  221. public static CreativeTabs tabTCFMod = new CreativeTabs("tabTCFMod"){
  222. @Override
  223. public Item getTabIconItem(){
  224. return new ItemStack(itemTCFLogo).getItem();
  225. }
  226. };
  227. }
Advertisement
Add Comment
Please, Sign In to add comment