From 63b0125be7e53ba1354c8aaf321ad734cb42a93e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?ZX=E5=A4=8F=E5=A4=9C=E4=B9=8B=E9=A3=8E?= Date: Tue, 5 Nov 2024 22:59:21 +0800 Subject: [PATCH] fix: TNT NPCs disappear while reached vanilla life limit (#3177) --- .../nms/v1_21_R2/entity/nonliving/TNTPrimedController.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/v1_21_R2/src/main/java/net/citizensnpcs/nms/v1_21_R2/entity/nonliving/TNTPrimedController.java b/v1_21_R2/src/main/java/net/citizensnpcs/nms/v1_21_R2/entity/nonliving/TNTPrimedController.java index 8226b8340..883ee7b30 100644 --- a/v1_21_R2/src/main/java/net/citizensnpcs/nms/v1_21_R2/entity/nonliving/TNTPrimedController.java +++ b/v1_21_R2/src/main/java/net/citizensnpcs/nms/v1_21_R2/entity/nonliving/TNTPrimedController.java @@ -106,9 +106,16 @@ public class TNTPrimedController extends MobEntityController { return NMSImpl.teleportAcrossWorld(this, transition); } + private int fuseRenewalDelay = 9; // give client some time to make the animation look vanilla-like @Override public void tick() { if (npc != null) { + if (fuseRenewalDelay-- <= 0) { + // DataWatcher refuses to mark dirty if we don't give different values + setFuse(Integer.MAX_VALUE - 1); + setFuse(Integer.MAX_VALUE); + fuseRenewalDelay = 9; + } npc.update(); } else { super.tick();