Skip to content

Commit

Permalink
Add temporary debug information for detecting Inventory Tweaks crash, #…
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Apr 26, 2017
1 parent 7fbda3d commit 5703e9f
Showing 1 changed file with 19 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -296,17 +296,25 @@ public void updateCraftingInventory(EntityPlayerMP player, List<ItemStack> allIt
*/
@ContainerSectionCallback
public Map<ContainerSection, List<Slot>> getContainerSelection() {
Map<ContainerSection, List<Slot>> selection = Maps.newHashMap();
List<Slot> chest = Lists.newArrayList();
List<Slot> playerInventory = Lists.newArrayList();
for(int i = 0; i < getSizeInventory(); i++) {
chest.add(this.getSlot(i));
}
for(int i = getSizeInventory(); i < getSizeInventory() + player.inventory.mainInventory.length; i++) {
playerInventory.add(this.getSlot(i));
try {
Map<ContainerSection, List<Slot>> selection = Maps.newHashMap();
List<Slot> chest = Lists.newArrayList();
List<Slot> playerInventory = Lists.newArrayList();
for (int i = 0; i < getSizeInventory(); i++) {
chest.add(this.getSlot(i));
}

for (int i = getSizeInventory(); i < getSizeInventory() + player.inventory.mainInventory.length; i++) {
playerInventory.add(this.getSlot(i));
}
selection.put(ContainerSection.CHEST, chest);
selection.put(ContainerSection.INVENTORY, playerInventory);
return selection;
} catch (RuntimeException e) {
System.out.println("Size inv " + getSizeInventory());
System.out.println("Player size inv " + player.inventory.mainInventory.length);
System.out.println("Available slots " + inventorySlots.size());
throw e;
}
selection.put(ContainerSection.CHEST, chest);
selection.put(ContainerSection.INVENTORY, playerInventory);
return selection;
}
}

0 comments on commit 5703e9f

Please sign in to comment.