mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-04 02:01:44 +01:00
SPIGOT-4278: EntityChangeBlockEvent for turtles laying eggs
This commit is contained in:
parent
1728eb298e
commit
b865db3b2a
1 changed files with 14 additions and 0 deletions
|
@ -20,3 +20,17 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
public void die(DamageSource damagesource) {
|
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);
|
||||||
|
|
Loading…
Reference in a new issue