aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Turtle.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Turtle.java.patch')
-rw-r--r--patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Turtle.java.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Turtle.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Turtle.java.patch
new file mode 100644
index 0000000000..2bcafa973e
--- /dev/null
+++ b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Turtle.java.patch
@@ -0,0 +1,45 @@
+--- a/net/minecraft/world/entity/animal/Turtle.java
++++ b/net/minecraft/world/entity/animal/Turtle.java
+@@ -330,7 +307,9 @@
+ protected void ageBoundaryReached() {
+ super.ageBoundaryReached();
+ if (!this.isBaby() && this.level().getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
++ this.forceDrops = true; // CraftBukkit
+ this.spawnAtLocation(Items.SCUTE, 1);
++ this.forceDrops = false; // CraftBukkit
+ }
+
+ }
+@@ -358,9 +335,10 @@
+ }
+
+ @Override
+- @Override
+- public void thunderHit(ServerLevel serverlevel, LightningBolt lightningbolt) {
++ public void thunderHit(ServerLevel level, LightningBolt lightning) {
++ org.bukkit.craftbukkit.event.CraftEventFactory.entityDamage = lightning; // CraftBukkit
+ this.hurt(this.damageSources().lightningBolt(), Float.MAX_VALUE);
++ org.bukkit.craftbukkit.event.CraftEventFactory.entityDamage = null; // CraftBukkit
+ }
+
+ @Override
+@@ -525,12 +495,14 @@
+ } else if (this.turtle.layEggCounter > this.adjustedTickDelay(200)) {
+ Level level = this.turtle.level();
+
+- level.playSound((Player) null, blockpos, SoundEvents.TURTLE_LAY_EGG, SoundSource.BLOCKS, 0.3F, 0.9F + level.random.nextFloat() * 0.2F);
+- BlockPos blockpos1 = this.blockPos.above();
+- BlockState blockstate = (BlockState) Blocks.TURTLE_EGG.defaultBlockState().setValue(TurtleEggBlock.EGGS, this.turtle.random.nextInt(4) + 1);
++ if (org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.turtle, this.blockPos.above(), (IBlockData) Blocks.TURTLE_EGG.defaultBlockState().setValue(TurtleEggBlock.EGGS, this.turtle.random.nextInt(4) + 1))) { // CraftBukkit
++ world.playSound((Player) null, blockposition, SoundEvents.TURTLE_LAY_EGG, SoundSource.BLOCKS, 0.3F, 0.9F + world.random.nextFloat() * 0.2F);
++ BlockPos blockposition1 = this.blockPos.above();
++ IBlockData iblockdata = (IBlockData) Blocks.TURTLE_EGG.defaultBlockState().setValue(TurtleEggBlock.EGGS, this.turtle.random.nextInt(4) + 1);
+
+- level.setBlock(blockpos1, blockstate, 3);
+- level.gameEvent(GameEvent.BLOCK_PLACE, blockpos1, GameEvent.Context.of(this.turtle, blockstate));
++ world.setBlock(blockposition1, iblockdata, 3);
++ world.gameEvent(GameEvent.BLOCK_PLACE, blockposition1, GameEvent.Context.of(this.turtle, iblockdata));
++ } // CraftBukkit
+ this.turtle.setHasEgg(false);
+ this.turtle.setLayingEgg(false);
+ this.turtle.setInLoveTime(600);