3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-24 15:20:11 +01:00
Paper/nms-patches/EntityTurtle.patch

45 Zeilen
2.2 KiB
Diff

--- a/net/minecraft/server/EntityTurtle.java
+++ b/net/minecraft/server/EntityTurtle.java
2020-06-25 02:00:00 +02:00
@@ -252,7 +252,9 @@
protected void m() {
super.m();
2019-06-21 12:00:00 +02:00
if (!this.isBaby() && this.world.getGameRules().getBoolean(GameRules.DO_MOB_LOOT)) {
2018-08-26 04:00:00 +02:00
+ this.forceDrops = true; // CraftBukkit
this.a((IMaterial) Items.SCUTE, 1);
+ this.forceDrops = false; // CraftBukkit
}
2018-07-24 14:22:56 +02:00
2018-08-26 04:00:00 +02:00
}
2020-06-25 02:00:00 +02:00
@@ -279,7 +281,9 @@
2019-04-23 04:00:00 +02:00
@Override
2020-08-11 23:00:00 +02:00
public void onLightningStrike(WorldServer worldserver, EntityLightning entitylightning) {
+ org.bukkit.craftbukkit.event.CraftEventFactory.entityDamage = entitylightning; // CraftBukkit
this.damageEntity(DamageSource.LIGHTNING, Float.MAX_VALUE);
+ org.bukkit.craftbukkit.event.CraftEventFactory.entityDamage = null; // CraftBukkit
}
2019-04-23 04:00:00 +02:00
static class g extends NavigationGuardian {
2020-06-25 02:00:00 +02:00
@@ -438,8 +442,12 @@
2020-08-11 23:00:00 +02:00
} else if (this.g.bv > 200) {
2019-04-23 04:00:00 +02:00
World world = this.g.world;
+ // CraftBukkit start
2019-04-23 04:00:00 +02:00
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(this.g, this.e.up(), (IBlockData) Blocks.TURTLE_EGG.getBlockData().set(BlockTurtleEgg.b, this.g.random.nextInt(4) + 1)).isCancelled()) {
2019-07-20 01:00:00 +02:00
world.playSound((EntityHuman) null, blockposition, SoundEffects.ENTITY_TURTLE_LAY_EGG, SoundCategory.BLOCKS, 0.3F, 0.9F + world.random.nextFloat() * 0.2F);
2019-04-23 04:00:00 +02:00
world.setTypeAndData(this.e.up(), (IBlockData) Blocks.TURTLE_EGG.getBlockData().set(BlockTurtleEgg.b, this.g.random.nextInt(4) + 1), 3);
+ }
+ // CraftBukkit end
2020-06-25 02:00:00 +02:00
this.g.setHasEgg(false);
this.g.u(false);
2019-04-23 04:00:00 +02:00
this.g.setLoveTicks(600);
2020-06-25 02:00:00 +02:00
@@ -519,7 +527,7 @@
2019-04-23 04:00:00 +02:00
--this.e;
return false;
} else {
- this.d = this.b.world.a(EntityTurtle.i.a, (EntityLiving) this.b);
+ this.d = this.b.world.a(this.a, (EntityLiving) this.b); // CraftBukkit - decompile error
return this.d == null ? false : this.a(this.d.getItemInMainHand()) || this.a(this.d.getItemInOffHand());
}
}