From a7ce4d1a3f92c8c296c948bcefa01b5d7cd4227b Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sun, 11 Jun 2023 17:30:03 +1000 Subject: [PATCH] SPIGOT-7382: Player still on fire after respawn By: md_5 --- .../net/minecraft/server/level/EntityPlayer.patch | 2 +- .../nms-patches/net/minecraft/world/entity/Entity.patch | 9 +++++++++ .../java/org/bukkit/craftbukkit/entity/CraftEntity.java | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/paper-server/nms-patches/net/minecraft/server/level/EntityPlayer.patch b/paper-server/nms-patches/net/minecraft/server/level/EntityPlayer.patch index ac9d837860..63a7e9fc5f 100644 --- a/paper-server/nms-patches/net/minecraft/server/level/EntityPlayer.patch +++ b/paper-server/nms-patches/net/minecraft/server/level/EntityPlayer.patch @@ -1090,7 +1090,7 @@ + + this.setHealth(this.getMaxHealth()); + this.stopUsingItem(); // CraftBukkit - SPIGOT-6682: Clear active item on reset -+ this.remainingFireTicks = 0; ++ this.setRemainingFireTicks(0); + this.fallDistance = 0; + this.foodData = new FoodMetaData(this); + this.experienceLevel = this.newLevel; diff --git a/paper-server/nms-patches/net/minecraft/world/entity/Entity.patch b/paper-server/nms-patches/net/minecraft/world/entity/Entity.patch index 1cb796e2ec..029ec51f7f 100644 --- a/paper-server/nms-patches/net/minecraft/world/entity/Entity.patch +++ b/paper-server/nms-patches/net/minecraft/world/entity/Entity.patch @@ -67,6 +67,15 @@ private static final Logger LOGGER = LogUtils.getLogger(); public static final String ID_TAG = "id"; public static final String PASSENGERS_TAG = "Passengers"; +@@ -190,7 +248,7 @@ + public boolean noPhysics; + protected final RandomSource random; + public int tickCount; +- public int remainingFireTicks; ++ private int remainingFireTicks; + public boolean wasTouchingWater; + protected Object2DoubleMap> fluidHeight; + protected boolean wasEyeInWater; @@ -240,6 +298,25 @@ public boolean hasVisualFire; @Nullable diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index 2d79f30b95..bf03b0bc94 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -580,7 +580,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @Override public int getFireTicks() { - return entity.remainingFireTicks; + return entity.getRemainingFireTicks(); } @Override @@ -590,7 +590,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { @Override public void setFireTicks(int ticks) { - entity.remainingFireTicks = ticks; + entity.setRemainingFireTicks(ticks); } @Override