aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/api')
-rw-r--r--src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java
index a2971e0e86..ab6ba80f1b 100644
--- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java
+++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_Hatch_DataAccess.java
@@ -12,6 +12,7 @@ import gregtech.api.util.GT_AssemblyLineUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
import static gregtech.api.enums.Textures.BlockIcons.OVERLAY_DATA_ACCESS;
@@ -125,6 +126,23 @@ public class GT_MetaTileEntity_Hatch_DataAccess extends GT_MetaTileEntity_Hatch
}
@Override
+ public void loadNBTData(NBTTagCompound aNBT) {
+ super.loadNBTData(aNBT);
+ if (aNBT.getByte("mSticksUpdated") != 1) {
+ for (int i = 0; i < getSizeInventory(); i++) {
+ GT_AssemblyLineUtils.processDataStick(getStackInSlot(i));
+ }
+ }
+ }
+
+ @Override
+ public void saveNBTData(NBTTagCompound aNBT) {
+ super.saveNBTData(aNBT);
+ // reminder: remove this marker after many years
+ aNBT.setByte("mSticksUpdated", (byte) 1);
+ }
+
+ @Override
public void setInventorySlotContents(int aIndex, ItemStack aStack) {
super.setInventorySlotContents(aIndex, aStack);
GT_AssemblyLineUtils.processDataStick(aStack);