Fix CombatTracker stale on death (#12562)
This commit is contained in:
@@ -10,8 +10,6 @@ import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import net.minecraft.Optionull;
|
||||
import io.papermc.paper.world.damagesource.CombatTracker;
|
||||
import io.papermc.paper.world.damagesource.PaperCombatTrackerWrapper;
|
||||
import io.papermc.paper.world.damagesource.FallLocationType;
|
||||
import net.minecraft.core.component.DataComponents;
|
||||
import net.minecraft.network.protocol.game.ClientboundHurtAnimationPacket;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
@@ -94,14 +92,11 @@ import org.bukkit.util.Vector;
|
||||
|
||||
public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
|
||||
private final PaperCombatTrackerWrapper combatTracker;
|
||||
private CraftEntityEquipment equipment;
|
||||
|
||||
public CraftLivingEntity(final CraftServer server, final net.minecraft.world.entity.LivingEntity entity) {
|
||||
super(server, entity);
|
||||
|
||||
this.combatTracker = new PaperCombatTrackerWrapper(entity.getCombatTracker());
|
||||
|
||||
if (entity instanceof Mob || entity instanceof ArmorStand) {
|
||||
this.equipment = new CraftEntityEquipment(this);
|
||||
}
|
||||
@@ -1168,6 +1163,6 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
|
||||
@Override
|
||||
public CombatTracker getCombatTracker() {
|
||||
return this.combatTracker;
|
||||
return this.getHandle().getCombatTracker().paperCombatTracker;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user