Fix issues with CreeperIgniteEvent (#7507)
This commit is contained in:
parent
1f671625be
commit
004e444f9b
2 changed files with 12 additions and 1 deletions
|
|
@ -19,7 +19,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+import org.jetbrains.annotations.NotNull;
|
+import org.jetbrains.annotations.NotNull;
|
||||||
+
|
+
|
||||||
+/**
|
+/**
|
||||||
+ * Called when a Creeper is ignite flag is changed (armed/disarmed to explode).
|
+ * Called when a Creeper is ignited either by a
|
||||||
|
+ * flint and steel, {@link Creeper#ignite()} or
|
||||||
|
+ * {@link Creeper#setIgnited(boolean)}.
|
||||||
+ */
|
+ */
|
||||||
+public class CreeperIgniteEvent extends EntityEvent implements Cancellable {
|
+public class CreeperIgniteEvent extends EntityEvent implements Cancellable {
|
||||||
+ private static final HandlerList handlers = new HandlerList();
|
+ private static final HandlerList handlers = new HandlerList();
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,15 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
@@ -0,0 +0,0 @@ public class Creeper extends Monster implements PowerableMob {
|
@@ -0,0 +0,0 @@ public class Creeper extends Monster implements PowerableMob {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nbt.getBoolean("ignited")) {
|
||||||
|
- this.ignite();
|
||||||
|
+ this.entityData.set(Creeper.DATA_IS_IGNITED, true); // Paper - set directly to avoid firing event
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
@@ -0,0 +0,0 @@ public class Creeper extends Monster implements PowerableMob {
|
||||||
|
}
|
||||||
|
|
||||||
public void ignite() {
|
public void ignite() {
|
||||||
- this.entityData.set(Creeper.DATA_IS_IGNITED, true);
|
- this.entityData.set(Creeper.DATA_IS_IGNITED, true);
|
||||||
+ // Paper start
|
+ // Paper start
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue