添加cannon的默认血量
This commit is contained in:
parent
6f33b4aa5d
commit
86d415cee3
2 changed files with 10 additions and 2 deletions
|
@ -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"));
|
||||
this.entityData.set(HEALTH, compound.getFloat("Health"));
|
||||
if (compound.contains("Health")) {
|
||||
this.entityData.set(HEALTH, compound.getFloat("Health"));
|
||||
} else {
|
||||
this.entityData.set(HEALTH, MAX_HEALTH);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -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"));
|
||||
this.entityData.set(HEALTH, compound.getFloat("Health"));
|
||||
if (compound.contains("Health")) {
|
||||
this.entityData.set(HEALTH, compound.getFloat("Health"));
|
||||
} else {
|
||||
this.entityData.set(HEALTH, MAX_HEALTH);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue