Guest User

Asparaguscrop.java

a guest
Dec 21st, 2014
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. package com.morefood.mod.crops;
  2.  
  3. import net.minecraft.block.BlockCrops;
  4. import net.minecraft.client.renderer.texture.IIconRegister;
  5. import net.minecraft.item.Item;
  6. import net.minecraft.util.IIcon;
  7. import net.minecraft.world.IBlockAccess;
  8. import net.minecraft.world.World;
  9. import net.minecraftforge.common.EnumPlantType;
  10.  
  11. import com.morefood.mod.Morefood;
  12.  
  13. import cpw.mods.fml.relauncher.Side;
  14. import cpw.mods.fml.relauncher.SideOnly;
  15.  
  16. public class AspCrop extends BlockCrops
  17. {
  18. @SideOnly(Side.CLIENT)
  19. private IIcon[] iconArray;
  20.  
  21. @Override
  22. public EnumPlantType getPlantType(IBlockAccess world, int x, int y, int z)
  23. {
  24. return EnumPlantType.Crop;
  25. }
  26.  
  27. /**
  28. * Gets the block's texture. Args: side, meta
  29. */
  30. @SideOnly(Side.CLIENT)
  31. public IIcon getIcon(int side, int metadata)
  32. {
  33. if (metadata < 5)
  34. {
  35. return this.iconArray[metadata];
  36. }
  37. else
  38. {
  39. return this.iconArray[4];
  40. }
  41. }
  42.  
  43. protected Item func_149866_i()
  44. {
  45. return Morefood.cropRawAsparagus;
  46. }
  47.  
  48. protected Item func_149865_P()
  49. {
  50. return Morefood.cropRawAsparagus;
  51. }
  52.  
  53. @SideOnly(Side.CLIENT)
  54. public Item getItem(World world, int i, int j, int k)
  55. {
  56. return Morefood.cropRawAsparagus;
  57. }
  58.  
  59. @SideOnly(Side.CLIENT)
  60. public void registerBlockIcons(IIconRegister iconRegister)
  61. {
  62. this.iconArray = new IIcon[5];
  63.  
  64. for (int i = 0; i < this.iconArray.length; ++i)
  65. {
  66. this.iconArray[i] = iconRegister.registerIcon(Morefood.modid + ":" + this.getUnlocalizedName().substring(5) + (i + 1));
  67. }
  68. }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment