summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-08-16 20:27:16 +1000
committermd_5 <git@md-5.net>2018-08-16 20:27:16 +1000
commitb865db3b2a525c952cd7b4a915d1e452966c2e42 (patch)
tree10d33521dab5ddb0aae3fa524336317905924e32 /nms-patches
parent1728eb298e598d17729ac16638b207218681147f (diff)
downloadcraftbukkit-b865db3b2a525c952cd7b4a915d1e452966c2e42.tar
craftbukkit-b865db3b2a525c952cd7b4a915d1e452966c2e42.tar.gz
craftbukkit-b865db3b2a525c952cd7b4a915d1e452966c2e42.tar.lz
craftbukkit-b865db3b2a525c952cd7b4a915d1e452966c2e42.tar.xz
craftbukkit-b865db3b2a525c952cd7b4a915d1e452966c2e42.zip
SPIGOT-4278: EntityChangeBlockEvent for turtles laying eggs
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/EntityTurtle.patch14
1 files changed, 14 insertions, 0 deletions
diff --git a/nms-patches/EntityTurtle.patch b/nms-patches/EntityTurtle.patch
index 0a4df965..14feb6f6 100644
--- a/nms-patches/EntityTurtle.patch
+++ b/nms-patches/EntityTurtle.patch
@@ -20,3 +20,17 @@
}
public void die(DamageSource damagesource) {
+@@ -438,8 +442,12 @@
+ } else if (this.f.bK > 200) {
+ World world = this.f.world;
+
++ // CraftBukkit start
++ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.f, this.d.up(), Blocks.TURTLE_EGG.getBlockData().set(BlockTurtleEgg.b, Integer.valueOf(this.f.random.nextInt(4) + 1))).isCancelled()) {
+ world.a((EntityHuman) null, blockposition, SoundEffects.ENTITY_TURTLE_LAY_EGG, SoundCategory.BLOCKS, 0.3F, 0.9F + world.random.nextFloat() * 0.2F);
+- world.setTypeAndData(this.d.up(), (IBlockData) Blocks.TURTLE_EGG.getBlockData().set(BlockTurtleEgg.b, Integer.valueOf(this.f.random.nextInt(4) + 1)), 3);
++ world.setTypeAndData(this.d.up(), (IBlockData) Blocks.TURTLE_EGG.getBlockData().set(BlockTurtleEgg.b, Integer.valueOf(this.f.random.nextInt(4) + 1)), 3);
++ }
++ // CraftBukkit end
+ this.f.s(false);
+ this.f.t(false);
+ this.f.e(600);