Advertisement
Guest User

Leaves Block Class

a guest
Sep 28th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.32 KB | None | 0 0
  1. package com.AdamDoesMods.Biomes.features;
  2.  
  3. import java.util.List;
  4.  
  5. import net.minecraft.block.BlockLeaves;
  6. import net.minecraft.client.renderer.texture.IIconRegister;
  7. import net.minecraft.creativetab.CreativeTabs;
  8. import net.minecraft.init.Items;
  9. import net.minecraft.item.Item;
  10. import net.minecraft.item.ItemStack;
  11. import net.minecraft.util.IIcon;
  12. import net.minecraft.world.World;
  13.  
  14. public class ADMLeaves extends BlockLeaves {
  15.    
  16.     public static final String[][] myStringArray = new String[][] {{"LeafAphock", "LeafDlelbone", "LeafOotriacca","LeafPhalea", "LeafPutridBunya" },{"LeafAphockOpqaue", "LeafDlelboneOpaque", "LeafOotriaccaOpqaue", "LeafPhaleaOpqaue", "LeafPutridBunyaOpaque"}};                                                                                        
  17.     public static final String[] myStringArray2 = new String[] {"Aphock", "Dlelbone", "Ootriacca", "Phalea", "Putrid Bunya"};
  18.    
  19.     protected void func_150124_c(World world, int x, int y, int z, int side, int meta)
  20.     {
  21.         if ((side & 3) == 1 && world.rand.nextInt(meta) == 0)
  22.         {
  23.             this.dropBlockAsItem(world, x, y, z, new ItemStack(Items.apple, 1, 0));
  24.         }
  25.     }
  26.  
  27.    
  28.     public int damageDropped(int i)
  29.     {
  30.         return super.damageDropped(i) + 4;
  31.     }
  32.  
  33.    
  34.     public int getDamageValue(World world, int x, int y, int z)
  35.     {
  36.         return world.getBlockMetadata(x, y, z) & 3;
  37.     }
  38.  
  39.    
  40.    
  41.  
  42.     public void getSubBlocks(Item item, CreativeTabs tabs, List list)
  43.     {
  44.         for(int i = 0; i < myStringArray2.length; i++) {
  45.             list.add(new ItemStack(item, 1, i));
  46.         }
  47.     }
  48.  
  49.     public void registerBlockIcons(IIconRegister register)
  50.     {
  51.         for (int var2 = 0; var2 < myStringArray.length; ++var2)
  52.         {
  53.             this.field_150129_M[var2] = new IIcon[myStringArray[var2].length];
  54.  
  55.             for (int var3 = 0; var3 < myStringArray[var2].length; ++var3)
  56.             {
  57.                 this.field_150129_M[var2][var3] = register.registerIcon(myStringArray[var2][var3]);
  58.             }
  59.         }
  60.     }
  61.  
  62.  
  63.     @Override
  64.     public IIcon getIcon(int side, int meta) {
  65.        
  66.         return (meta & 3) == 1 ? this.field_150129_M[this.field_150127_b][1] : this.field_150129_M[this.field_150127_b][0];
  67.     }
  68.     @Override
  69.     public String[] func_150125_e() {
  70.        
  71.         return myStringArray2;
  72.     }
  73.  
  74.  
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement