Scissors/patches/server/0020-Fix-negative-death-times.patch

20 lines
1.0 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Telesphoreo <me@telesphoreo.me>
Date: Sat, 10 Dec 2022 23:23:52 -0600
Subject: [PATCH] Fix negative death times
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index e9d3e34520b706627205e0d5b17b25e09f198e7e..36b1fcc106909aa7305d63bb4710b4330cb9bc6a 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -612,7 +612,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
protected void tickDeath() {
++this.deathTime;
- if (this.deathTime >= 20 && !this.level.isClientSide() && !this.isRemoved()) {
+ if ((this.deathTime >= 20 || this.deathTime <= 0) && !this.level.isClientSide() && !this.isRemoved()) {
this.level.broadcastEntityEvent(this, (byte) 60);
this.remove(Entity.RemovalReason.KILLED);
}