Advertisement
Guest User

Custom Crop

a guest
Jan 2nd, 2015
247
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.11 KB | None | 0 0
  1. package maniamsmart.FoodAddOn;
  2.  
  3. import java.util.Random;
  4.  
  5. import cpw.mods.fml.relauncher.Side;
  6. import cpw.mods.fml.relauncher.SideOnly;
  7. import net.minecraft.block.BlockCrops;
  8. import net.minecraft.util.IIcon;
  9. import net.minecraft.client.renderer.texture.IIconRegister;
  10. import net.minecraft.item.Item;
  11.  
  12. public class CustomCrop extends BlockCrops{
  13.  
  14.     @SideOnly(Side.CLIENT)
  15.     private IIcon[] iconarray;
  16.    
  17.     @SideOnly(Side.CLIENT)
  18.     public void registerBlockIcons(IIconRegister iconRegister){
  19.         this.iconarray = new IIcon[4];
  20.        
  21.         for (int i = 0; i < this.iconarray.length; i++)
  22.         {
  23.             this.iconarray[i] = iconRegister.registerIcon("fao:" + this.getUnlocalizedName().substring(5) + (i + 1));
  24.         }
  25.     }
  26.    
  27.     public IIcon getIcon(int side, int metadata){
  28.         if (metadata < 7)
  29.         {
  30.                 if (metadata == 6)
  31.                 {
  32.                     metadata = 5;
  33.                 }
  34.             return this.iconarray[metadata >> 1];
  35.         }
  36.    
  37.     return this.iconarray[3];
  38. }
  39.  
  40. public int quantityDropped (Random random)
  41. {
  42.     return 1;
  43. }
  44.  
  45. protected Item func_149866_i(){
  46.     return FoodAddOn.itemOatsSeeds;
  47. }
  48.  
  49. protected Item func_149865_P(){
  50.     return FoodAddOn.itemOats;
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement