summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntitySheep.patch
diff options
context:
space:
mode:
authorThinkofdeath <thinkofdeath@spigotmc.org>2014-11-26 08:32:16 +1100
committermd_5 <git@md-5.net>2014-11-28 17:16:30 +1100
commit24557bc2b37deb6a0edf497d547471832457b1dd (patch)
treec560572889a3b0b34964a0cddb35dc87fda3c914 /nms-patches/EntitySheep.patch
parenta4805dbd77da057cc1ea0bf344379bc6e53ca1f6 (diff)
downloadcraftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar
craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.gz
craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.lz
craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.tar.xz
craftbukkit-24557bc2b37deb6a0edf497d547471832457b1dd.zip
Update to Minecraft 1.8
For more information please see http://www.spigotmc.org/
Diffstat (limited to 'nms-patches/EntitySheep.patch')
-rw-r--r--nms-patches/EntitySheep.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/nms-patches/EntitySheep.patch b/nms-patches/EntitySheep.patch
new file mode 100644
index 00000000..b1737592
--- /dev/null
+++ b/nms-patches/EntitySheep.patch
@@ -0,0 +1,54 @@
+--- ../work/decompile-bb26c12b/net/minecraft/server/EntitySheep.java 2014-11-27 08:59:46.725421741 +1100
++++ src/main/java/net/minecraft/server/EntitySheep.java 2014-11-27 08:42:10.124850965 +1100
+@@ -4,6 +4,11 @@
+ import java.util.Map;
+ import java.util.Random;
+
++// CraftBukkit start
++import org.bukkit.event.entity.SheepRegrowWoolEvent;
++import org.bukkit.event.player.PlayerShearEntityEvent;
++// CraftBukkit end
++
+ public class EntitySheep extends EntityAnimal {
+
+ private final InventoryCrafting bk = new InventoryCrafting(new ContainerSheepBreed(this), 2, 1);
+@@ -30,6 +35,7 @@
+ this.goalSelector.a(8, new PathfinderGoalRandomLookaround(this));
+ this.bk.setItem(0, new ItemStack(Items.DYE, 1, 0));
+ this.bk.setItem(1, new ItemStack(Items.DYE, 1, 0));
++ this.bk.resultInventory = new InventoryCraftResult(); // CraftBukkit - add result slot for event
+ }
+
+ protected void E() {
+@@ -82,6 +88,15 @@
+
+ if (itemstack != null && itemstack.getItem() == Items.SHEARS && !this.isSheared() && !this.isBaby()) {
+ if (!this.world.isStatic) {
++ // CraftBukkit start
++ PlayerShearEntityEvent event = new PlayerShearEntityEvent((org.bukkit.entity.Player) entityhuman.getBukkitEntity(), this.getBukkitEntity());
++ this.world.getServer().getPluginManager().callEvent(event);
++
++ if (event.isCancelled()) {
++ return false;
++ }
++ // CraftBukkit end
++
+ this.setSheared(true);
+ int i = 1 + this.random.nextInt(3);
+
+@@ -169,7 +184,14 @@
+ }
+
+ public void v() {
+- this.setSheared(false);
++ // CraftBukkit start
++ SheepRegrowWoolEvent event = new SheepRegrowWoolEvent((org.bukkit.entity.Sheep) this.getBukkitEntity());
++ this.world.getServer().getPluginManager().callEvent(event);
++
++ if (!event.isCancelled()) {
++ this.setSheared(false);
++ }
++ // CraftBukkit end
+ if (this.isBaby()) {
+ this.setAge(60);
+ }