private final CoreRoutedPipe pipe;
public GuiPipeController(final EntityPlayer player, final CoreRoutedPipe pipe) {
super(180, 220, 0, 0);
this.pipe = pipe;
DummyContainer dummy = new DummyContainer(player, null, pipe.getUpgradeManager().getGuiController());
dummy.addNormalSlotsForPlayerInventory(10, 135);
// TAB_1 SLOTS
for(int pipeSlot = 0; pipeSlot < 9; pipeSlot++) {
TAB_SLOTS_1_1.add(dummy.addRestrictedSlot(pipeSlot, pipe.getUpgradeManager().getInv(), 10 + pipeSlot * 18, 42, new ISlotCheck() {
@Override
public boolean isStackAllowed(ItemStack itemStack) {
if(itemStack == null) return false;
if(itemStack.getItem() == LogisticsPipes.UpgradeItem) {
if(!LogisticsPipes.UpgradeItem.getUpgradeForItem(itemStack, null).isAllowed(pipe)) return false;
} else {
return false;
}
return true;
}
}));
}
for(int pipeSlot = 0; pipeSlot < 9; pipeSlot++) {
TAB_SLOTS_1_2.add(dummy.addRestrictedSlot(pipeSlot, pipe.getUpgradeManager().getSneakyInv(), 10 + pipeSlot * 18, 78, new ISlotCheck() {
@Override
public boolean isStackAllowed(ItemStack itemStack) {
if(itemStack == null) return false;
if(itemStack.getItem() == LogisticsPipes.UpgradeItem) {
IPipeUpgrade upgrade = LogisticsPipes.UpgradeItem.getUpgradeForItem(itemStack, null);
if(!(upgrade instanceof SneakyUpgrade)) return false;
if(!upgrade.isAllowed(pipe)) return false;
} else {
return false;
}
return true;
}
}));
}
// TAB_2 SLOTS
TAB_SLOTS_2.add(dummy.addStaticRestrictedSlot(0, pipe.getUpgradeManager().getSecInv(), 10, 42, new ISlotCheck() {
@Override
public boolean isStackAllowed(ItemStack itemStack) {
if(itemStack == null) return false;
if(itemStack.getItem() != LogisticsPipes.LogisticsItemCard) return false;
if(itemStack.getItemDamage() != LogisticsItemCard.SEC_CARD) return false;
if(!SimpleServiceLocator.securityStationManager.isAuthorized(UUID.fromString(itemStack.getTagCompound().getString("UUID")))) return false;
return true;
}
}, 1));
TAB_SLOTS_4.add(dummy.addRestrictedSlot(0, pipe.container.logicController.diskInv, 14, 36, LogisticsPipes.LogisticsItemDisk));
this.inventorySlots = dummy;
}