Fix EntityCombustEvent cancellation cant fully prevent entities from being set on fire

This commit is contained in:
Denery
2022-10-31 14:20:52 +03:00
parent 7c7eff2c01
commit 5ca5bc3d6c
2 changed files with 58 additions and 54 deletions

View File

@@ -16,7 +16,7 @@
if (!entity.fireImmune()) {
if (entity.getRemainingFireTicks() < 0) {
entity.setRemainingFireTicks(entity.getRemainingFireTicks() + 1);
@@ -137,7 +139,14 @@
@@ -137,7 +139,18 @@
}
if (entity.getRemainingFireTicks() >= 0) {
@@ -27,12 +27,16 @@
+
+ if (!event.isCancelled()) {
+ entity.igniteForSeconds(event.getDuration(), false);
+ // Paper start - fix EntityCombustEvent cancellation
+ } else {
+ entity.setRemainingFireTicks(entity.getRemainingFireTicks() - 1);
+ // Paper end - fix EntityCombustEvent cancellation
+ }
+ // CraftBukkit end
}
}
@@ -146,26 +155,26 @@
@@ -146,26 +159,26 @@
}
@Override
@@ -66,7 +70,7 @@
}
@Override
@@ -213,4 +222,12 @@
@@ -213,4 +226,12 @@
}
}
}