Skip to content
This repository has been archived by the owner on Jan 26, 2019. It is now read-only.

Commit

Permalink
Fix #220
Browse files Browse the repository at this point in the history
  • Loading branch information
robotia committed Mar 13, 2016
1 parent 3d347ed commit c9fc16c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions patches/net/minecraft/item/ItemShears.java.patch
@@ -1,17 +1,18 @@
--- ../src-base/minecraft/net/minecraft/item/ItemShears.java
+++ ../src-work/minecraft/net/minecraft/item/ItemShears.java
@@ -3,7 +3,10 @@
@@ -3,7 +3,11 @@
import java.util.ArrayList;
import java.util.Random;

+import org.bukkit.event.player.PlayerShearEntityEvent;
+
import net.minecraft.block.Block;
+import net.minecraft.block.BlockLeaves;
+import net.minecraft.block.BlockLeavesBase;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.enchantment.Enchantment;
@@ -61,6 +64,16 @@
@@ -61,6 +65,16 @@
IShearable target = (IShearable)entity;
if (target.isShearable(itemstack, entity.worldObj, (int)entity.posX, (int)entity.posY, (int)entity.posZ))
{
Expand All @@ -28,12 +29,12 @@
ArrayList<ItemStack> drops = target.onSheared(itemstack, entity.worldObj, (int)entity.posX, (int)entity.posY, (int)entity.posZ,
EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack));

@@ -87,14 +100,14 @@
@@ -87,14 +101,14 @@
return false;
}
Block block = player.worldObj.getBlock(x, y, z);
- if (block instanceof IShearable)
+ if (block instanceof IShearable && !(block instanceof BlockLeaves))
+ if (block instanceof IShearable && !(block instanceof BlockLeavesBase))
{
IShearable target = (IShearable)block;
if (target.isShearable(itemstack, player.worldObj, x, y, z))
Expand Down

0 comments on commit c9fc16c

Please sign in to comment.