Drowning Compatibility

This commit is contained in:
KAMKEEL committed 2022-07-02 23:38:20 -04:00
1 parent b08f63c4b6
commit 545db302ad
2 files changed
+8 -7

No files matched your search

+2 -7
View File
@@ -30,7 +30,7 @@ public class DataStats {
public boolean immuneToFire = false;
public boolean potionImmune = false;
public int drowningType = 1; //0 - Never, 1 - Water, 2 - Air
public int drowningType = 1; // 0 - Never, 1 - Water, 2 - Air
public boolean burnInSun = false;
public boolean noFallDamage = false;
public float healthRegen = 1;
@@ -164,12 +164,7 @@ public class DataStats {
immuneToFire = compound.getBoolean("ImmuneToFire");
potionImmune = compound.getBoolean("PotionImmune");
//canDrown = compound.getBoolean("CanDrown");
if (!compound.hasKey("DrowningType") && compound.hasKey("CanDrown")) {
drowningType = compound.getBoolean("CanDrown") ? 1 : 0;
} else {
drowningType = compound.getInteger("DrowningType");
}
drowningType = compound.getInteger("DrowningType");
burnInSun = compound.getBoolean("BurnInSun");
noFallDamage = compound.getBoolean("NoFallDamage");
@@ -24,6 +24,12 @@ public class VersionCompatibility {
String texture = compound.getString("Texture");
texture = texture.replace("64-Textures/", "");
compound.setString("Texture", texture);
if (compound.hasKey("CanDrown")) {
compound.setInteger("DrowningType", (compound.getBoolean("CanDrown") ? 1 : 0));
compound.removeTag("CanDrown");
}
}
if(npc.npcVersion < 18){
// Fix CloakTexture (Reorganization)