change nbt format

This commit is contained in:
Sen 2025-05-27 21:25:11 +02:00
parent ad4949af16
commit 17aad1f023
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
124 changed files with 2063 additions and 2986 deletions

View file

@ -755,11 +755,11 @@ public abstract class EntityCart extends Entity implements IWorldNameable
*/
protected void readEntityFromNBT(NBTTagCompound tagCompund)
{
if (tagCompund.getBoolean("CustomDisplayTile"))
if (tagCompund.getBool("CustomDisplayTile"))
{
int i = tagCompund.getInteger("DisplayData");
int i = tagCompund.getInt("DisplayData");
if (tagCompund.hasKey("DisplayTile", 8))
if (tagCompund.hasString("DisplayTile"))
{
Block block = BlockRegistry.getByIdFallback(tagCompund.getString("DisplayTile"));
@ -774,7 +774,7 @@ public abstract class EntityCart extends Entity implements IWorldNameable
}
else
{
Block block1 = BlockRegistry.getBlockById(tagCompund.getInteger("DisplayTile"));
Block block1 = BlockRegistry.getBlockById(tagCompund.getInt("DisplayTile"));
if (block1 == null)
{
@ -786,10 +786,10 @@ public abstract class EntityCart extends Entity implements IWorldNameable
}
}
this.setDisplayTileOffset(tagCompund.getInteger("DisplayOffset"));
this.setDisplayTileOffset(tagCompund.getInt("DisplayOffset"));
}
if (tagCompund.hasKey("CustomName", 8) && tagCompund.getString("CustomName").length() > 0)
if (tagCompund.hasString("CustomName") && tagCompund.getString("CustomName").length() > 0)
{
this.entityName = tagCompund.getString("CustomName");
}
@ -802,12 +802,12 @@ public abstract class EntityCart extends Entity implements IWorldNameable
{
if (this.hasDisplayTile())
{
tagCompound.setBoolean("CustomDisplayTile", true);
tagCompound.setBool("CustomDisplayTile", true);
State iblockstate = this.getDisplayTile();
String resourcelocation = BlockRegistry.REGISTRY.getNameForObject(iblockstate.getBlock());
tagCompound.setString("DisplayTile", resourcelocation == null ? "" : resourcelocation.toString());
tagCompound.setInteger("DisplayData", iblockstate.getBlock().getMetaFromState(iblockstate));
tagCompound.setInteger("DisplayOffset", this.getDisplayTileOffset());
tagCompound.setInt("DisplayData", iblockstate.getBlock().getMetaFromState(iblockstate));
tagCompound.setInt("DisplayOffset", this.getDisplayTileOffset());
}
if (this.entityName != null && this.entityName.length() > 0)