aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java')
-rw-r--r--src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
index bd2dbcd630..f2514f1290 100644
--- a/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
+++ b/src/main/java/gregtech/api/metatileentity/BaseMetaTileEntity.java
@@ -270,7 +270,7 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
for (int i = 0; i < tItemList.tagCount(); i++) {
NBTTagCompound tTag = tItemList.getCompoundTagAt(i);
int tSlot = tTag.getInteger("IntSlot");
- tSlot = shiftInventoryIndex(tSlot, nbtVersion);
+ tSlot = migrateInventoryIndex(tSlot, nbtVersion);
if (tSlot >= 0 && tSlot < mMetaTileEntity.getRealInventory().length) {
mMetaTileEntity.getRealInventory()[tSlot] = GT_Utility.loadItem(tTag);
}
@@ -2309,9 +2309,13 @@ public class BaseMetaTileEntity extends BaseTileEntity implements IGregTechTileE
* @param nbtVersion The GregTech version in which the original Inventory Index was saved.
* @return The corrected Inventory index
*/
- private int shiftInventoryIndex(int slotIndex, int nbtVersion){
+ private int migrateInventoryIndex(int slotIndex, int nbtVersion){
int oldInputSize, newInputSize, oldOutputSize, newOutputSize;
int chemistryUpdateVersion = GT_Mod.calculateTotalGTVersion(509, 31);
+ int configCircuitAdditionVersion = GT_Mod.calculateTotalGTVersion(509, 40);
+ // 4 is old GT_MetaTileEntity_BasicMachine.OTHER_SLOT_COUNT
+ if (nbtVersion < configCircuitAdditionVersion && getMetaTileEntity() instanceof GT_MetaTileEntity_BasicMachine && slotIndex >= 4)
+ slotIndex += 1;
if (mID >= 211 && mID <= 218) {//Assembler
if (nbtVersion < chemistryUpdateVersion) {
oldInputSize = 2;