summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntityRabbit.patch
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2016-06-30 16:15:38 +1000
committermd_5 <git@md-5.net>2016-06-30 16:15:38 +1000
commit8db0dbfc44231627c6095a72fcc8eebe04e5fd3e (patch)
treeb58b4c996a3eb9b85175a54e998d7b32401e0128 /nms-patches/EntityRabbit.patch
parent121dfc098a882c8fb157e8232001ce19c9846ccf (diff)
downloadcraftbukkit-8db0dbfc44231627c6095a72fcc8eebe04e5fd3e.tar
craftbukkit-8db0dbfc44231627c6095a72fcc8eebe04e5fd3e.tar.gz
craftbukkit-8db0dbfc44231627c6095a72fcc8eebe04e5fd3e.tar.lz
craftbukkit-8db0dbfc44231627c6095a72fcc8eebe04e5fd3e.tar.xz
craftbukkit-8db0dbfc44231627c6095a72fcc8eebe04e5fd3e.zip
SPIGOT-1405: Call EntityChangeBlockEvent for Rabbits eating Carrots
Diffstat (limited to 'nms-patches/EntityRabbit.patch')
-rw-r--r--nms-patches/EntityRabbit.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/nms-patches/EntityRabbit.patch b/nms-patches/EntityRabbit.patch
index b9bcabf1..0ecf7855 100644
--- a/nms-patches/EntityRabbit.patch
+++ b/nms-patches/EntityRabbit.patch
@@ -15,3 +15,27 @@
protected void r() {
this.goalSelector.a(1, new PathfinderGoalFloat(this));
+@@ -412,9 +418,23 @@
+ Integer integer = (Integer) iblockdata.get(BlockCarrots.AGE);
+
+ if (integer.intValue() == 0) {
++ // CraftBukkit start
++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.c, blockposition.getX(), blockposition.getY(), blockposition.getZ(), Blocks.AIR, 0).isCancelled()) {
++ return;
++ }
++ // CraftBukkit end
+ world.setTypeAndData(blockposition, Blocks.AIR.getBlockData(), 2);
+ world.setAir(blockposition, true);
+ } else {
++ // CraftBukkit start
++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(
++ this.c,
++ blockposition.getX(), blockposition.getY(), blockposition.getZ(),
++ block, block.toLegacyData(iblockdata.set(BlockCarrots.AGE, Integer.valueOf(integer.intValue() - 1)))
++ ).isCancelled()) {
++ return;
++ }
++ // CraftBukkit end
+ world.setTypeAndData(blockposition, iblockdata.set(BlockCarrots.AGE, Integer.valueOf(integer.intValue() - 1)), 2);
+ world.triggerEffect(2001, blockposition, Block.getCombinedId(iblockdata));
+ }