Files
MinecraftForge/forge/patches/minecraft/net/minecraft/src/BlockVine.java.patch
T

46 lines
1.5 KiB
Diff

--- ../src_base/minecraft/net/minecraft/src/BlockVine.java 0000-00-00 00:00:00.000000000 -0000
+++ ../src_work/minecraft/net/minecraft/src/BlockVine.java 0000-00-00 00:00:00.000000000 -0000
@@ -1,8 +1,11 @@
package net.minecraft.src;
+import java.util.ArrayList;
import java.util.Random;
-public class BlockVine extends Block
+import net.minecraft.src.forge.IShearable;
+
+public class BlockVine extends Block implements IShearable
{
public BlockVine(int i)
{
@@ -345,14 +348,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.vine, 1, 0));
- }
- 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<ItemStack> onSheared(ItemStack item, World world, int X, int Y, int Z, int fortune)
+ {
+ ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
+ ret.add(new ItemStack(Block.vine, 1, 0));
+ return ret;
}
}