Paper/patches/server/0919-Fix-EntityCombustEvent-cancellation-cant-fully-preve.patch
Jake Potrebic 9147456fc9
Updated Upstream (CraftBukkit/Spigot) (#8815)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

CraftBukkit Changes:
ab8ace685 SPIGOT-7236: Bone meal doesn't increase use statistic
7dcb59b8e Avoid switch on material in previous commit

Spigot Changes:
19641c75 SPIGOT-7235: World.Spigot#strikeLightningEffect doesn't do anything
2023-01-27 12:52:04 -08:00

38 lines
2.0 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Denery <dorofeevij@gmail.com>
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 10d8e11ea1e851b19f038230a9b1fb5c3a024f25..7443fb7fae30f22b2eaa2727c383c56891904068 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3164,6 +3164,10 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
pluginManager.callEvent(entityCombustEvent);
if (!entityCombustEvent.isCancelled()) {
this.setSecondsOnFire(entityCombustEvent.getDuration(), false);
+ // Paper start - fix EntityCombustEvent cancellation.
+ } else {
+ this.setRemainingFireTicks(this.remainingFireTicks - 1);
+ // Paper end
}
// 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 a76c452dc5c2069a3071aec31bfb3e977867161e..2ca656b1323f38eac419563a8306a9d86eaca29f 100644
--- a/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/BaseFireBlock.java
@@ -131,6 +131,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
}
// CraftBukkit end
}