mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-23 21:49:58 +00:00
Fix for Farming Station Upgrading
* Farming station slot shifting had an off-by-one error that destroyed installed capacitors * Also added some sanity checks that would have prevented item loss
This commit is contained in:
1 parent
e08aa9c533
commit
9555f5b91f
1 file changed
+6
-3
@@ -646,10 +646,13 @@ public class TileFarmStation extends AbstractPoweredTaskEntity {
|
||||
}
|
||||
int slotLayoutVersion = nbtRoot.getInteger("slotLayoutVersion");
|
||||
if (slotLayoutVersion < 1) {
|
||||
for (int i = 9; i >= 2; i--) {
|
||||
inventory[i+1] = inventory[i];
|
||||
for (int i = inventory.length - 2; i >= 2; i--) {
|
||||
if (inventory[i+1] == null) {
|
||||
// Should always be true, but better safe than deleting items
|
||||
inventory[i+1] = inventory[i];
|
||||
inventory[i] = null;
|
||||
}
|
||||
}
|
||||
inventory[2] = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user