diff options
Diffstat (limited to 'src/main')
-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)); |