private InvBlockInfo getSelectedContainer() { int selected = storageList.getSelected(); if (selected != -1) { SyncedValueList<InvBlockInfo> inventories = tileEntity.getInventories(); if (selected < inventories.size()) { InvBlockInfo invBlockInfo = inventories.get(selected); return invBlockInfo; } } return null; }