diff options
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/Turtle.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/Turtle.java.patch | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/Turtle.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/Turtle.java.patch new file mode 100644 index 0000000000..485d31894e --- /dev/null +++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/Turtle.java.patch @@ -0,0 +1,46 @@ +--- a/net/minecraft/world/entity/animal/Turtle.java ++++ b/net/minecraft/world/entity/animal/Turtle.java +@@ -305,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 + } + } + +@@ -330,7 +336,9 @@ + + @Override + 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 +@@ -431,13 +495,17 @@ + posTowards = DefaultRandomPos.getPosTowards(this.turtle, 8, 7, vec3, (float) (Math.PI / 2)); + } + +- if (posTowards != null && !flag && !this.turtle.level().getBlockState(BlockPos.containing(posTowards)).is(Blocks.WATER)) { +- posTowards = DefaultRandomPos.getPosTowards(this.turtle, 16, 5, vec3, (float) (Math.PI / 2)); +- } ++ 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); + +- if (posTowards == null) { +- this.stuck = true; +- return; ++ 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); + } + + this.turtle.getNavigation().moveTo(posTowards.x, posTowards.y, posTowards.z, this.speedModifier); |