Guest User

Asparagus

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