--- ../src_base/minecraft_server/net/minecraft/src/BlockTallGrass.java 0000-00-00 00:00:00.000000000 -0000 +++ ../src_work/minecraft_server/net/minecraft/src/BlockTallGrass.java 0000-00-00 00:00:00.000000000 -0000 @@ -1,8 +1,12 @@ package net.minecraft.src; +import java.util.ArrayList; import java.util.Random; -public class BlockTallGrass extends BlockFlower +import net.minecraft.src.forge.ForgeHooks; +import net.minecraft.src.forge.IShearable; + +public class BlockTallGrass extends BlockFlower implements IShearable { protected BlockTallGrass(int i, int j) { @@ -33,15 +37,25 @@ public int idDropped(int i, Random random, int j) { - if (random.nextInt(8) == 0) + return -1; + } + + @Override + public ArrayList getBlockDropped(World world, int i, int j, int k, int md, int fortune) + { + ArrayList ret = new ArrayList(); + if (world.rand.nextInt(8) != 0) { - return Item.seeds.shiftedIndex; + return ret; } - else + + ItemStack item = ForgeHooks.getGrassSeed(world); + if (item != null) { - return -1; + ret.add(item); } - } + return ret; + } public int quantityDroppedWithBonus(int i, Random random) { @@ -50,14 +64,20 @@ public void harvestBlock(World world, EntityPlayer entityplayer, int i, int j, int k, int l) { - if (!world.isRemote && entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID == Item.shears.shiftedIndex) - { - entityplayer.addStat(StatList.mineBlockStatArray[blockID], 1); - dropBlockAsItem_do(world, i, j, k, new ItemStack(Block.tallGrass, 1, l)); - } - else - { - super.harvestBlock(world, entityplayer, i, j, k, l); - } + super.harvestBlock(world, entityplayer, i, j, k, l); + } + + @Override + public boolean isShearable(ItemStack item, World world, int X, int Y, int Z) + { + return true; + } + + @Override + public ArrayList onSheared(ItemStack item, World world, int X, int Y, int Z, int fortune) + { + ArrayList ret = new ArrayList(); + ret.add(new ItemStack(Block.tallGrass, 1, world.getBlockMetadata(X, Y, Z))); + return ret; } }