Initial commit (Forge 1291).
This commit is contained in:
28
patches/net/minecraft/item/ItemShears.java.patch
Normal file
28
patches/net/minecraft/item/ItemShears.java.patch
Normal file
@ -0,0 +1,28 @@
|
||||
--- ../src-base/minecraft/net/minecraft/item/ItemShears.java
|
||||
+++ ../src-work/minecraft/net/minecraft/item/ItemShears.java
|
||||
@@ -3,6 +3,8 @@
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
+import org.bukkit.event.player.PlayerShearEntityEvent;
|
||||
+
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
@@ -61,6 +63,16 @@
|
||||
IShearable target = (IShearable)entity;
|
||||
if (target.isShearable(itemstack, entity.worldObj, (int)entity.posX, (int)entity.posY, (int)entity.posZ))
|
||||
{
|
||||
+ // Cauldron start
|
||||
+ PlayerShearEntityEvent event = new PlayerShearEntityEvent((org.bukkit.entity.Player) player.getBukkitEntity(), entity.getBukkitEntity());
|
||||
+ player.worldObj.getServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (event.isCancelled())
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ // Cauldron end
|
||||
ArrayList<ItemStack> drops = target.onSheared(itemstack, entity.worldObj, (int)entity.posX, (int)entity.posY, (int)entity.posZ,
|
||||
EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, itemstack));
|
||||
|
Reference in New Issue
Block a user