File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
src/main/java/gregtech/api/metatileentity Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,9 @@ public void notifyBlockUpdate() {
8181 @ Override
8282 public final void readFromNBT (@ NotNull NBTTagCompound compound ) {
8383 super .readFromNBT (compound );
84- customName = compound .getString (GregtechDataCodes .CUSTOM_NAME );
84+ if (compound .hasKey (GregtechDataCodes .CUSTOM_NAME , Constants .NBT .TAG_STRING )) {
85+ customName = compound .getString (GregtechDataCodes .CUSTOM_NAME );
86+ }
8587 if (compound .hasKey ("MetaId" , Constants .NBT .TAG_STRING )) {
8688 readMTETag (compound .getCompoundTag ("MetaTileEntity" ));
8789 if (Mods .AppliedEnergistics2 .isModLoaded ()) {
@@ -94,7 +96,9 @@ public final void readFromNBT(@NotNull NBTTagCompound compound) {
9496 @ Override
9597 public final NBTTagCompound writeToNBT (@ NotNull NBTTagCompound compound ) {
9698 super .writeToNBT (compound );
97- compound .setString (GregtechDataCodes .CUSTOM_NAME , getName ());
99+ if (hasCustomName ()) {
100+ compound .setString (GregtechDataCodes .CUSTOM_NAME , getName ());
101+ }
98102 compound .setString ("MetaId" , getMetaID ().toString ());
99103 NBTTagCompound metaTileEntityData = new NBTTagCompound ();
100104 writeMTETag (metaTileEntityData );
You can’t perform that action at this time.
0 commit comments