/** * @param subcontainer The container to add * @param preferForShiftClick If true shift clicking on slots of the main-container will try to move to this module before the player inventory */ public void addSubContainer(Container subcontainer, boolean preferForShiftClick) { if(subContainers.isEmpty()) { subContainerSlotStart = inventorySlots.size(); } subContainers.add(subcontainer); if(preferForShiftClick) { shiftClickContainers.add(subcontainer); } int begin = inventorySlots.size(); for(Object slot : subcontainer.inventorySlots) { SlotWrapper wrapper = new SlotWrapper((Slot) slot); addSlotToContainer(wrapper); slotContainerMap.put(wrapper.slotNumber, subcontainer); } int end = inventorySlots.size(); subContainerSlotRanges.put(subcontainer, Pair.of(begin, end)); }