添加cannon的默认血量

This commit is contained in:
17146 2024-11-10 02:30:56 +08:00
parent 6f33b4aa5d
commit 86d415cee3
2 changed files with 10 additions and 2 deletions

View file

@ -79,7 +79,11 @@ public class Mk42Entity extends Entity implements GeoEntity, ICannonEntity {
public void readAdditionalSaveData(CompoundTag compound) {
this.entityData.set(COOL_DOWN, compound.getInt("CoolDown"));
this.entityData.set(TYPE, compound.getInt("Type"));
if (compound.contains("Health")) {
this.entityData.set(HEALTH, compound.getFloat("Health"));
} else {
this.entityData.set(HEALTH, MAX_HEALTH);
}
}
@Override

View file

@ -85,7 +85,11 @@ public class Mle1934Entity extends Entity implements GeoEntity, ICannonEntity {
public void readAdditionalSaveData(CompoundTag compound) {
this.entityData.set(COOL_DOWN, compound.getInt("CoolDown"));
this.entityData.set(TYPE, compound.getInt("Type"));
if (compound.contains("Health")) {
this.entityData.set(HEALTH, compound.getFloat("Health"));
} else {
this.entityData.set(HEALTH, MAX_HEALTH);
}
}
@Override