fix: expose plain inventory slots to automation

This commit is contained in:
Algent committed 2026-09-14 19:49:13 +02:00
1 parent 9688f0da19
commit e7aa53694f
2 files changed
+6 -2

No files matched your search

@@ -170,7 +170,7 @@ class TIInventoryTileFunctionalTest {
}
@Test
void accessibleSlotsIncludeOnlySidedInventoriesWithGlobalOffsets() {
void accessibleSlotsIncludePlainInventoriesAndRespectSidedRestrictionsWithGlobalOffsets() {
TileMultipart tile = newInventoryTile();
InventoryPart plainFirst = new InventoryPart("plain_first", 2);
SidedInventoryPart sidedFirst = new SidedInventoryPart("sided_first", 1, new int[] { 0 });
@@ -181,7 +181,7 @@ class TIInventoryTileFunctionalTest {
tile.bindPart(plainSecond);
tile.bindPart(sidedSecond);
assertArrayEquals(new int[] { 2, 6, 4 }, inventory(tile).getAccessibleSlotsFromSide(5));
assertArrayEquals(new int[] { 0, 1, 2, 3, 6, 4 }, inventory(tile).getAccessibleSlotsFromSide(5));
assertEquals(5, sidedFirst.lastAccessibleSide);
assertEquals(5, sidedSecond.lastAccessibleSide);
}
@@ -186,6 +186,10 @@ public class JInventoryTile extends TileMultipart implements TIInventoryTile {
for (int localSlot : localSlots) {
accessibleSlots.add(Integer.valueOf(localSlot + base));
}
} else {
for (int localSlot = 0; localSlot < inventory.getSizeInventory(); localSlot++) {
accessibleSlots.add(Integer.valueOf(localSlot + base));
}
}
base += inventory.getSizeInventory();
}