Files
CatServer/patches/net/minecraft/entity/passive/EntitySheep.java.patch
2018-09-08 11:39:03 +08:00

35 lines
1.1 KiB
Diff

--- ../src-base/minecraft/net/minecraft/entity/passive/EntitySheep.java
+++ ../src-work/minecraft/net/minecraft/entity/passive/EntitySheep.java
@@ -4,6 +4,10 @@
import java.util.Map;
import java.util.Random;
import javax.annotation.Nullable;
+
+import org.bukkit.event.entity.SheepRegrowWoolEvent;
+import org.bukkit.inventory.InventoryView;
+
import net.minecraft.block.Block;
import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.EntityLiving;
@@ -176,6 +180,7 @@
}
}
+ // TODO: Implement PlayerShearEntityEvent
@SuppressWarnings("unused")
public boolean processInteract(EntityPlayer player, EnumHand hand, @Nullable ItemStack stack)
{
@@ -308,6 +313,12 @@
public void eatGrassBonus()
{
+ // CraftBukkit start
+ SheepRegrowWoolEvent event = new SheepRegrowWoolEvent((org.bukkit.entity.Sheep) this.getBukkitEntity());
+ this.worldObj.getServer().getPluginManager().callEvent(event);
+
+ if (event.isCancelled()) return;
+ // CraftBukkit end
this.setSheared(false);
if (this.isChild())