diff options
Diffstat (limited to 'patches/server/0807-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch')
-rw-r--r-- | patches/server/0807-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/patches/server/0807-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch b/patches/server/0807-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch new file mode 100644 index 0000000000..efc81025ac --- /dev/null +++ b/patches/server/0807-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch @@ -0,0 +1,37 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Denery <[email protected]> +Date: Mon, 31 Oct 2022 14:20:52 +0300 +Subject: [PATCH] Fix EntityCombustEvent cancellation cant fully prevent + entities from being set on fire + + +diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java +index 45a7b217ab6ef3a7c4ad1c07824d7185d4847086..ea65396e55476dc4e91fe2c26a5c5bd658184d5e 100644 +--- a/src/main/java/net/minecraft/world/entity/Entity.java ++++ b/src/main/java/net/minecraft/world/entity/Entity.java +@@ -3111,6 +3111,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S + pluginManager.callEvent(entityCombustEvent); + if (!entityCombustEvent.isCancelled()) { + this.setSecondsOnFire(entityCombustEvent.getDuration(), false); ++ // Paper start - fix EntityCombustEvent cancellation ++ } else { ++ this.setRemainingFireTicks(this.remainingFireTicks - 1); ++ // Paper end - fix EntityCombustEvent cancellation + } + // CraftBukkit end + } +diff --git a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java b/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java +index ceb5f9867f714b3b6a4602c787574dfa83c006f6..bd7cb2ddcac5cdc1d61899d12fc3383fd00598b1 100644 +--- a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java ++++ b/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java +@@ -134,6 +134,10 @@ public abstract class BaseFireBlock extends Block { + + if (!event.isCancelled()) { + entity.setSecondsOnFire(event.getDuration(), false); ++ // Paper start - fix EntityCombustEvent cancellation ++ } else { ++ entity.setRemainingFireTicks(entity.getRemainingFireTicks() - 1); ++ // Paper end - fix EntityCombustEvent cancellation + } + // CraftBukkit end + } |