fix: TNT NPCs disappear while reached vanilla life limit (#3177)

This commit is contained in:
ZX夏夜之风 2024-11-05 22:59:21 +08:00 committed by GitHub
parent 601068c117
commit 63b0125be7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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();