Advertisement
Guest User

Asparaguscrop.java

a guest
Dec 20th, 2014
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. package com.morefood.mod.crops;
  2.  
  3. import com.morefood.mod.Morefood;
  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.client.renderer.texture.IIconRegister;
  9. import net.minecraft.init.Items;
  10. import net.minecraft.item.Item;
  11. import net.minecraft.util.IIcon;
  12.  
  13. public class AspCrop extends BlockCrops
  14. {
  15. @SideOnly(Side.CLIENT)
  16. private IIcon[] iconArray;
  17.  
  18. /**
  19. * Gets the block's texture. Args: side, meta
  20. */
  21. @SideOnly(Side.CLIENT)
  22. public IIcon getIcon(int side, int metadata)
  23. {
  24. if (metadata < 7)
  25. {
  26. if (metadata == 6)
  27. {
  28. metadata = 5;
  29. }
  30.  
  31. return this.iconArray[metadata >> 1];
  32. }
  33. else
  34. {
  35. return this.iconArray[3];
  36. }
  37. }
  38.  
  39. protected Item func_149866_i()
  40. {
  41. return Morefood.cropRawAsparagus;
  42. }
  43.  
  44. protected Item func_149865_P()
  45. {
  46. return Morefood.cropRawAsparagus;
  47. }
  48.  
  49. @SideOnly(Side.CLIENT)
  50. public void registerBlockIcons(IIconRegister iconRegister)
  51. {
  52. this.iconArray = new IIcon[5];
  53.  
  54. for (int i = 0; i < this.iconArray.length; ++i)
  55. {
  56. this.iconArray[i] = iconRegister.registerIcon(Morefood.modid + ":" + this.getUnlocalizedName().substring(5) + (i + 1));
  57. }
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement