#1209: Clean up various patches

By: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
This commit is contained in:
CraftBukkit/Spigot
2023-06-24 17:15:05 +10:00
parent 0f9e7a497e
commit b97cc9b99f
71 changed files with 662 additions and 719 deletions

View File

@@ -20,20 +20,18 @@
}
private static class e extends ControllerMove {
@@ -487,12 +491,16 @@
@@ -487,12 +491,14 @@
} else if (this.turtle.layEggCounter > this.adjustedTickDelay(200)) {
World world = this.turtle.level();
+ // CraftBukkit start
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.turtle, this.blockPos.above(), (IBlockData) Blocks.TURTLE_EGG.defaultBlockState().setValue(BlockTurtleEgg.EGGS, this.turtle.random.nextInt(4) + 1)).isCancelled()) {
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.turtle, this.blockPos.above(), (IBlockData) Blocks.TURTLE_EGG.defaultBlockState().setValue(BlockTurtleEgg.EGGS, this.turtle.random.nextInt(4) + 1))) { // CraftBukkit
world.playSound((EntityHuman) null, blockposition, SoundEffects.TURTLE_LAY_EGG, SoundCategory.BLOCKS, 0.3F, 0.9F + world.random.nextFloat() * 0.2F);
BlockPosition blockposition1 = this.blockPos.above();
IBlockData iblockdata = (IBlockData) Blocks.TURTLE_EGG.defaultBlockState().setValue(BlockTurtleEgg.EGGS, this.turtle.random.nextInt(4) + 1);
world.setBlock(blockposition1, iblockdata, 3);
world.gameEvent(GameEvent.BLOCK_PLACE, blockposition1, GameEvent.a.of(this.turtle, iblockdata));
+ }
+ // CraftBukkit end
+ } // CraftBukkit
this.turtle.setHasEgg(false);
this.turtle.setLayingEgg(false);
this.turtle.setInLoveTime(600);