@@ -341,8 +341,6 @@ public IWidget createRecipeMemoryGrid(PanelSyncManager syncManager) {
341341 }
342342
343343 public IWidget createInventoryPage (PanelSyncManager syncManager ) {
344- var connected = new SlotGroup ("connected_inventory" , 8 , true );
345- syncManager .registerSlotGroup (connected );
346344
347345 if (this .connectedInventory .getSlots () == 0 ) {
348346 return Flow .column ()
@@ -358,6 +356,10 @@ public IWidget createInventoryPage(PanelSyncManager syncManager) {
358356 // but that causes problems
359357 List <ItemSlot > list = new ArrayList <>(this .connectedInventory .getSlots ());
360358
359+ int rowSize = Math .min (this .connectedInventory .getSlots (), 8 );
360+ var connected = new SlotGroup ("connected_inventory" , rowSize , true );
361+ syncManager .registerSlotGroup (connected );
362+
361363 for (int i = 0 ; i < this .connectedInventory .getSlots (); i ++) {
362364 list .add (new ItemSlot ()
363365 .setEnabledIf (itemSlot -> {
@@ -387,10 +389,9 @@ public IWidget createInventoryPage(PanelSyncManager syncManager) {
387389 .background (GTGuiTextures .DISPLAY )
388390 .child (new Grid ()
389391 .scrollable (new VerticalScrollData (), null )
390- .coverChildrenWidth ( )
392+ .width ( 18 * 8 + 4 )
391393 .height (18 * 6 )
392- .minElementMargin (0 , 0 )
393- .mapTo (8 , list , (index , value ) -> value ));
394+ .mapTo (rowSize , list ));
394395 }
395396
396397 public void sendHandlerToClient (PacketBuffer buffer ) {
0 commit comments