Guest User

Main Class

a guest
Jan 2nd, 2015
504
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.64 KB | None | 0 0
  1. package maniamsmart.FoodAddOn;
  2.  
  3. import net.minecraft.block.Block;
  4. import net.minecraft.block.material.Material;
  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.ItemFood;
  10. import net.minecraft.item.ItemSeeds;
  11. import net.minecraft.item.ItemStack;
  12. import cpw.mods.fml.common.Mod;
  13. import cpw.mods.fml.common.Mod.EventHandler;
  14. import cpw.mods.fml.common.event.FMLInitializationEvent;
  15. import cpw.mods.fml.common.event.FMLPostInitializationEvent;
  16. import cpw.mods.fml.common.event.FMLPreInitializationEvent;
  17. import cpw.mods.fml.common.registry.GameRegistry;
  18.  
  19. @Mod(modid = "fao", name = "Damian's Food Add On", version = "1.5")
  20. public class FoodAddOn {
  21.    
  22.     public static Item itemOatmeal;
  23.     public static Block blockRainbowWool;
  24.     public static Item itemIceCream;
  25.     public static Item itemPudding;
  26.     public static Item itemOats;
  27.     public static Block blockOatsPlant;
  28.     public static Item itemOatsSeeds;
  29.    
  30.     @EventHandler
  31.     public void preInit(FMLPreInitializationEvent event){
  32.         //Item/Block Init and Regist
  33.         //Config Handling
  34.         itemOatmeal = new ItemFood(6, 0.8F, false).setUnlocalizedName("itemOatmeal").setTextureName("fao:itemoatmeal").setCreativeTab(tabFoodAddOnMod);
  35.         blockRainbowWool = new BlockRainbowWool(Material.cloth).setBlockName("blockRainbowWool").setBlockTextureName("fao:blockrainbowwool").setCreativeTab(tabFoodAddOnMod);
  36.         itemIceCream = new ItemFood(5, 0.5F, false).setUnlocalizedName("itemIceCream").setTextureName("fao:itemicecream").setCreativeTab(tabFoodAddOnMod);
  37.         itemPudding = new ItemFood(10, 0.6F, false).setUnlocalizedName("itemPudding").setTextureName("fao:itempudding").setCreativeTab(tabFoodAddOnMod);
  38.         blockOatsPlant = new CustomCrop().setBlockName("blockOatsPlant");
  39.         itemOatsSeeds = new ItemSeeds(blockOatsPlant, Blocks.farmland).setUnlocalizedName("itemOatsSeeds").setTextureName("fao:itemoatsseeds").setCreativeTab(tabFoodAddOnMod);
  40.         itemOats = new ItemFood(4, 0.5F, false).setUnlocalizedName("itemOats").setTextureName("fao:itemoats").setCreativeTab(tabFoodAddOnMod);
  41.        
  42.         GameRegistry.registerItem(itemOatmeal, itemOatmeal.getUnlocalizedName().substring(5));
  43.         GameRegistry.registerBlock(blockRainbowWool, blockRainbowWool.getUnlocalizedName().substring(5));
  44.         GameRegistry.registerItem(itemIceCream, itemIceCream.getUnlocalizedName().substring(5));
  45.         GameRegistry.registerItem(itemPudding, itemPudding.getUnlocalizedName().substring(5));
  46.         GameRegistry.registerItem(itemOatsSeeds, itemOatsSeeds.getUnlocalizedName().substring(5));
  47.         GameRegistry.registerItem(itemOats, itemOats.getUnlocalizedName().substring(5));
  48.         GameRegistry.registerBlock(blockOatsPlant, blockOatsPlant.getUnlocalizedName().substring(5));
  49.        
  50.         GameRegistry.addSmelting(itemIceCream, new ItemStack(itemPudding), 5.0F);
  51.         TMHooks.mainRegistry();
  52.     }
  53.    
  54.     @EventHandler
  55.     public void init(FMLInitializationEvent event){
  56.         //Proxy, TileEntity, entitry, GUI and Packet regis
  57.         GameRegistry.addRecipe(new ItemStack(itemOatmeal), new Object[]{" M "," W "," B ", 'B', Items.bowl, 'M', Items.milk_bucket, 'W', Items.wheat});
  58.         GameRegistry.addRecipe(new ItemStack(blockRainbowWool), new Object[]{"R G","   ","B Y", 'R', new ItemStack(Blocks.wool, 1, 14), 'G', new ItemStack(Blocks.wool, 1, 5), 'B', new ItemStack(Blocks.wool, 1, 3), 'Y', new ItemStack(Blocks.wool, 1, 4)});
  59.     }
  60.    
  61.     @EventHandler
  62.     public void postInit(FMLPostInitializationEvent event){
  63.        
  64.     }
  65.    
  66.     public static CreativeTabs tabFoodAddOnMod = new CreativeTabs("tabFoodAddOnMod"){
  67.         @Override
  68.         public Item getTabIconItem(){
  69.             return new ItemStack(blockRainbowWool).getItem();
  70.         }
  71.     };
  72. }
Advertisement
Add Comment
Please, Sign In to add comment