From 90766787c614c2c5a573ec466e3c2c3ba495b91b Mon Sep 17 00:00:00 2001 From: Light_Quanta Date: Thu, 26 Jun 2025 19:39:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BD=BD=E5=85=B7Health?= =?UTF-8?q?=E8=AF=BB=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../superbwarfare/entity/vehicle/base/VehicleEntity.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/VehicleEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/VehicleEntity.java index b112f4d38..ee86c822a 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/VehicleEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/VehicleEntity.java @@ -356,7 +356,12 @@ public abstract class VehicleEntity extends Entity { protected void readAdditionalSaveData(CompoundTag compound) { this.entityData.set(LAST_ATTACKER_UUID, compound.getString("LastAttacker")); this.entityData.set(LAST_DRIVER_UUID, compound.getString("LastDriver")); - this.entityData.set(HEALTH, compound.getFloat("Health")); + + if (compound.contains("Health")) { + this.entityData.set(HEALTH, compound.getFloat("Health")); + } else { + this.entityData.set(HEALTH, this.getMaxHealth()); + } this.entityData.set(TURRET_HEALTH, compound.getFloat("TurretHealth")); this.entityData.set(L_WHEEL_HEALTH, compound.getFloat("LeftWheelHealth"));