Skip to content

Commit 07dfb7a

Browse files
authored
Fix saving/loading of the machine owner UUID to NBT (GregTechCEu#2783)
1 parent be51cb0 commit 07dfb7a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/main/java/gregtech/api/metatileentity/MetaTileEntity.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,8 +1326,11 @@ public NBTTagCompound writeToNBT(NBTTagCompound data) {
13261326

13271327
data.setBoolean(TAG_KEY_MUFFLED, muffled);
13281328

1329-
if (owner != null)
1330-
data.setUniqueId("Owner", owner);
1329+
if (owner != null) {
1330+
NBTTagCompound ownerTag = new NBTTagCompound();
1331+
ownerTag.setUniqueId("UUID", owner);
1332+
data.setTag("Owner", ownerTag);
1333+
}
13311334

13321335
return data;
13331336
}
@@ -1355,8 +1358,9 @@ public void readFromNBT(NBTTagCompound data) {
13551358
CoverSaveHandler.readCoverNBT(data, this, covers::put);
13561359
this.muffled = data.getBoolean(TAG_KEY_MUFFLED);
13571360

1358-
if (data.hasKey("Owner"))
1359-
this.owner = data.getUniqueId("Owner");
1361+
if (data.hasKey("Owner", 10)) {
1362+
this.owner = data.getCompoundTag("Owner").getUniqueId("UUID");
1363+
}
13601364
}
13611365

13621366
@Override

0 commit comments

Comments
 (0)