diff options
author | Glease <4586901+Glease@users.noreply.github.com> | 2021-12-16 01:20:23 +0800 |
---|---|---|
committer | Glease <4586901+Glease@users.noreply.github.com> | 2021-12-16 01:22:15 +0800 |
commit | e05aadf2752c27a66822e7d4b92693a88ec4470e (patch) | |
tree | 28da59379b736d7b7e3d6f96a2155422caae33e5 /src | |
parent | 6dccf8f21e43aaa39f13358665aded2cd6188283 (diff) | |
download | GT5-Unofficial-e05aadf2752c27a66822e7d4b92693a88ec4470e.tar.gz GT5-Unofficial-e05aadf2752c27a66822e7d4b92693a88ec4470e.tar.bz2 GT5-Unofficial-e05aadf2752c27a66822e7d4b92693a88ec4470e.zip |
Fix oversight in cover NBT migration
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java | 6 | ||||
-rw-r--r-- | src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java | 6 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java index fc5fa64d91..806b0c6e53 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaPipeEntity.java @@ -901,14 +901,16 @@ public class BaseMetaPipeEntity extends BaseTileEntity implements IGregTechTileE ItemStack rStack = new ItemStack(GregTech_API.sBlockMachines, 1, mID); NBTTagCompound tNBT = new NBTTagCompound(); if (mStrongRedstone > 0) tNBT.setByte("mStrongRedstone", mStrongRedstone); + boolean hasCover = false; for (byte i = 0; i < mCoverSides.length; i++) { if (mCoverSides[i] != 0) { if (mCoverData[i] != null) // this really shouldn't be null if a cover is there already, but whatever tNBT.setTag(COVER_DATA_NBT_KEYS[i], mCoverData[i].saveDataToNBT()); - tNBT.setIntArray("mCoverSides", mCoverSides); - break; + hasCover = true; } } + if (hasCover) + tNBT.setIntArray("mCoverSides", mCoverSides); if (hasValidMetaTileEntity()) mMetaTileEntity.setItemNBT(tNBT); if (!tNBT.hasNoTags()) rStack.setTagCompound(tNBT); return new ArrayList<ItemStack>(Arrays.asList(rStack)); diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java index f2514f1290..585f8394d3 100644 --- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java @@ -1439,14 +1439,16 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE if (mColor > 0) tNBT.setByte("mColor", mColor); if (mOtherUpgrades > 0) tNBT.setByte("mOtherUpgrades", mOtherUpgrades); if (mStrongRedstone > 0) tNBT.setByte("mStrongRedstone", mStrongRedstone); + boolean hasCover = false; for (byte i = 0; i < mCoverSides.length; i++) { if (mCoverSides[i] != 0) { if (mCoverData[i] != null) // this really shouldn't be null if a cover is there already, but whatever tNBT.setTag(COVER_DATA_NBT_KEYS[i], mCoverData[i].saveDataToNBT()); - tNBT.setIntArray("mCoverSides", mCoverSides); - break; + hasCover = true; } } + if (hasCover) + tNBT.setIntArray("mCoverSides", mCoverSides); if (hasValidMetaTileEntity()) mMetaTileEntity.setItemNBT(tNBT); if (!tNBT.hasNoTags()) rStack.setTagCompound(tNBT); return new ArrayList<ItemStack>(Arrays.asList(rStack)); |