Part Data Texture Fix for Upgrading from CNPC

Issue where already saved NPCs cannot locate texture if upgrading from CNPC to CNPC+
This commit is contained in:
KAMKEEL committed 2022-01-19 18:21:12 -05:00
1 parent dff71c5a98
commit 8a9defd3a1
1 file changed
+5 -1
+5 -1
View File
@@ -24,8 +24,9 @@ public class ModelPartData {
NBTTagCompound compound = new NBTTagCompound();
compound.setByte("Type", type);
compound.setInteger("Color", color);
if(texture != null && !texture.isEmpty())
if(texture != null && !texture.isEmpty()) {
compound.setString("Texture", texture);
}
compound.setBoolean("PlayerTexture", playerTexture);
return compound;
}
@@ -34,6 +35,9 @@ public class ModelPartData {
type = compound.getByte("Type");
color = compound.getInteger("Color");
texture = compound.getString("Texture");
if(texture.contains("moreplayermodels:textures")){
texture = texture.replace("moreplayermodels:textures", "customnpcs:textures/parts");
}
playerTexture = compound.getBoolean("PlayerTexture");
location = null;
}