diff --git a/paper-server/patches/sources/net/minecraft/world/entity/monster/Creeper.java.patch b/paper-server/patches/sources/net/minecraft/world/entity/monster/Creeper.java.patch index e25e7cc3b2..5737767075 100644 --- a/paper-server/patches/sources/net/minecraft/world/entity/monster/Creeper.java.patch +++ b/paper-server/patches/sources/net/minecraft/world/entity/monster/Creeper.java.patch @@ -22,6 +22,15 @@ public Creeper(EntityType type, Level world) { super(type, world); +@@ -125,7 +133,7 @@ + } + + if (nbt.getBoolean("ignited")) { +- this.ignite(); ++ this.entityData.set(Creeper.DATA_IS_IGNITED, true); // Paper - set directly to avoid firing event + } + + } @@ -214,9 +222,20 @@ @Override public void thunderHit(ServerLevel world, LightningBolt lightning) { @@ -99,3 +108,25 @@ } } +@@ -284,9 +315,20 @@ + } + + public void ignite() { +- this.entityData.set(Creeper.DATA_IS_IGNITED, true); ++ // Paper start - CreeperIgniteEvent ++ setIgnited(true); + } + ++ public void setIgnited(boolean ignited) { ++ if (isIgnited() != ignited) { ++ com.destroystokyo.paper.event.entity.CreeperIgniteEvent event = new com.destroystokyo.paper.event.entity.CreeperIgniteEvent((org.bukkit.entity.Creeper) getBukkitEntity(), ignited); ++ if (event.callEvent()) { ++ this.entityData.set(Creeper.DATA_IS_IGNITED, event.isIgnited()); ++ } ++ } ++ // Paper end - CreeperIgniteEvent ++ } ++ + public boolean canDropMobsSkull() { + return this.isPowered() && this.droppedSkulls < 1; + } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java index 15bd44f8bd..42dd26b917 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftCreeper.java @@ -101,4 +101,16 @@ public class CraftCreeper extends CraftMonster implements Creeper { public String toString() { return "CraftCreeper"; } + + // Paper start + @Override + public void setIgnited(boolean ignited) { + getHandle().setIgnited(ignited); + } + + @Override + public boolean isIgnited() { + return getHandle().isIgnited(); + } + // Paper end }