2021-03-15 23:00:00 +01:00
|
|
|
--- a/net/minecraft/world/entity/animal/EntityTurtle.java
|
|
|
|
+++ b/net/minecraft/world/entity/animal/EntityTurtle.java
|
2023-09-21 18:40:00 +02:00
|
|
|
@@ -312,7 +312,9 @@
|
2021-11-21 23:00:00 +01:00
|
|
|
protected void ageBoundaryReached() {
|
|
|
|
super.ageBoundaryReached();
|
2023-06-07 17:30:00 +02:00
|
|
|
if (!this.isBaby() && this.level().getGameRules().getBoolean(GameRules.RULE_DOMOBLOOT)) {
|
2018-08-26 04:00:00 +02:00
|
|
|
+ this.forceDrops = true; // CraftBukkit
|
2021-11-21 23:00:00 +01:00
|
|
|
this.spawnAtLocation(Items.SCUTE, 1);
|
2018-08-26 04:00:00 +02:00
|
|
|
+ this.forceDrops = false; // CraftBukkit
|
|
|
|
}
|
2018-07-24 14:22:56 +02:00
|
|
|
|
2018-08-26 04:00:00 +02:00
|
|
|
}
|
2023-09-21 18:40:00 +02:00
|
|
|
@@ -339,7 +341,9 @@
|
2018-07-21 06:55:07 +02:00
|
|
|
|
2019-04-23 04:00:00 +02:00
|
|
|
@Override
|
2021-11-21 23:00:00 +01:00
|
|
|
public void thunderHit(WorldServer worldserver, EntityLightning entitylightning) {
|
2018-07-21 06:55:07 +02:00
|
|
|
+ org.bukkit.craftbukkit.event.CraftEventFactory.entityDamage = entitylightning; // CraftBukkit
|
2023-03-14 17:30:00 +01:00
|
|
|
this.hurt(this.damageSources().lightningBolt(), Float.MAX_VALUE);
|
2018-07-21 06:55:07 +02:00
|
|
|
+ org.bukkit.craftbukkit.event.CraftEventFactory.entityDamage = null; // CraftBukkit
|
|
|
|
}
|
|
|
|
|
2023-09-21 18:40:00 +02:00
|
|
|
@Override
|
|
|
|
@@ -496,12 +500,14 @@
|
2021-11-21 23:00:00 +01:00
|
|
|
} else if (this.turtle.layEggCounter > this.adjustedTickDelay(200)) {
|
2023-06-07 17:30:00 +02:00
|
|
|
World world = this.turtle.level();
|
2018-08-16 12:27:16 +02:00
|
|
|
|
2023-06-24 09:15:05 +02:00
|
|
|
+ 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
|
2021-06-11 07:00:00 +02:00
|
|
|
world.playSound((EntityHuman) null, blockposition, SoundEffects.TURTLE_LAY_EGG, SoundCategory.BLOCKS, 0.3F, 0.9F + world.random.nextFloat() * 0.2F);
|
2023-03-14 17:30:00 +01:00
|
|
|
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));
|
2023-06-24 09:15:05 +02:00
|
|
|
+ } // CraftBukkit
|
2021-06-11 07:00:00 +02:00
|
|
|
this.turtle.setHasEgg(false);
|
2021-11-21 23:00:00 +01:00
|
|
|
this.turtle.setLayingEgg(false);
|
|
|
|
this.turtle.setInLoveTime(600);
|