Search in sources :

Example 1 with PipeItemsFluidSupplier

use of logisticspipes.pipes.PipeItemsFluidSupplier in project LogisticsPipes by RS485.

the class LogisticsTriggerProvider method getInternalTriggers.

@Override
public Collection<ITriggerInternal> getInternalTriggers(IStatementContainer pipe) {
    if (pipe.getTile() instanceof LPBCTileGenericPipe) {
        LogisticsTileGenericPipe lPipe = ((LPBCTileGenericPipe) pipe.getTile()).getLpPipe();
        LinkedList<ITriggerInternal> triggers = new LinkedList<>();
        if (lPipe.pipe instanceof PipeItemsSupplierLogistics || lPipe.pipe instanceof PipeItemsFluidSupplier) {
            triggers.add(BuildCraftProxy.LogisticsFailedTrigger);
        }
        if (lPipe.pipe instanceof PipeItemsCraftingLogistics) {
            triggers.add(BuildCraftProxy.LogisticsCraftingTrigger);
        }
        if (lPipe.pipe instanceof CoreRoutedPipe) {
            //Only show this conditional on Gates that can accept parameters
            triggers.add(BuildCraftProxy.LogisticsHasDestinationTrigger);
        }
        if (!triggers.isEmpty()) {
            return triggers;
        }
    }
    return null;
}
Also used : PipeItemsCraftingLogistics(logisticspipes.pipes.PipeItemsCraftingLogistics) PipeItemsFluidSupplier(logisticspipes.pipes.PipeItemsFluidSupplier) LogisticsTileGenericPipe(logisticspipes.pipes.basic.LogisticsTileGenericPipe) PipeItemsSupplierLogistics(logisticspipes.pipes.PipeItemsSupplierLogistics) CoreRoutedPipe(logisticspipes.pipes.basic.CoreRoutedPipe) LPBCTileGenericPipe(logisticspipes.proxy.buildcraft.subproxies.LPBCTileGenericPipe) LinkedList(java.util.LinkedList) ITriggerInternal(buildcraft.api.statements.ITriggerInternal)

Example 2 with PipeItemsFluidSupplier

use of logisticspipes.pipes.PipeItemsFluidSupplier in project LogisticsPipes by RS485.

the class FluidSupplierMode method processPacket.

@Override
public void processPacket(EntityPlayer player) {
    final LogisticsTileGenericPipe pipe = this.getPipe(player.world);
    if (pipe == null) {
        return;
    }
    if (MainProxy.isClient(player.world)) {
        if (pipe.pipe instanceof PipeItemsFluidSupplier) {
            ((PipeItemsFluidSupplier) pipe.pipe).setRequestingPartials((getInteger() % 10) == 1);
        }
        if (pipe.pipe instanceof PipeFluidSupplierMk2) {
            ((PipeFluidSupplierMk2) pipe.pipe).setRequestingPartials((getInteger() % 10) == 1);
        }
    } else {
        if (pipe.pipe instanceof PipeItemsFluidSupplier) {
            PipeItemsFluidSupplier liquid = (PipeItemsFluidSupplier) pipe.pipe;
            liquid.setRequestingPartials((getInteger() % 10) == 1);
        }
        if (pipe.pipe instanceof PipeFluidSupplierMk2) {
            PipeFluidSupplierMk2 liquid = (PipeFluidSupplierMk2) pipe.pipe;
            liquid.setRequestingPartials((getInteger() % 10) == 1);
        }
    }
}
Also used : PipeFluidSupplierMk2(logisticspipes.pipes.PipeFluidSupplierMk2) PipeItemsFluidSupplier(logisticspipes.pipes.PipeItemsFluidSupplier) LogisticsTileGenericPipe(logisticspipes.pipes.basic.LogisticsTileGenericPipe)

Example 3 with PipeItemsFluidSupplier

use of logisticspipes.pipes.PipeItemsFluidSupplier in project LogisticsPipes by RS485.

the class PipeTransportLogistics method handleTileReachedServer_internal.

protected final void handleTileReachedServer_internal(LPTravelingItemServer arrivingItem, TileEntity tile, ForgeDirection dir) {
    if (isRouted && getPipe().container.tilePart.getBCPipePluggable(dir) != null && getPipe().container.tilePart.getBCPipePluggable(dir).isAcceptingItems(arrivingItem)) {
        LPTravelingItemServer remainingItem = getPipe().container.tilePart.getBCPipePluggable(dir).handleItem(arrivingItem);
        if (remainingItem != null) {
            getRoutedPipe().getRouter().update(true, getRoutedPipe());
            this.injectItem(remainingItem, dir);
        }
        return;
    }
    if (getPipe() instanceof PipeItemsFluidSupplier) {
        ((PipeItemsFluidSupplier) getPipe()).endReached(arrivingItem, tile);
        if (arrivingItem.getItemIdentifierStack().getStackSize() <= 0) {
            return;
        }
    }
    markChunkModified(tile);
    if (MainProxy.isServer(getWorld()) && arrivingItem.getInfo() != null && arrivingItem.getArrived() && isRouted) {
        getRoutedPipe().notifyOfItemArival(arrivingItem.getInfo());
    }
    if (getPipe() instanceof FluidRoutedPipe) {
        if (((FluidRoutedPipe) getPipe()).endReached(arrivingItem, tile)) {
            return;
        }
    }
    boolean isSpecialConnectionInformationTransition = false;
    if (MainProxy.isServer(getWorld())) {
        if (SimpleServiceLocator.specialtileconnection.needsInformationTransition(tile)) {
            isSpecialConnectionInformationTransition = true;
            SimpleServiceLocator.specialtileconnection.transmit(tile, arrivingItem);
        }
    }
    if (SimpleServiceLocator.pipeInformationManager.isItemPipe(tile)) {
        if (passToNextPipe(arrivingItem, tile)) {
            return;
        }
    } else if (tile instanceof IInventory && isRouted) {
        getRoutedPipe().getCacheHolder().trigger(CacheTypes.Inventory);
        // items.scheduleRemoval(arrivingItem);
        if (MainProxy.isServer(getWorld())) {
            // destroy the item on exit if it isn't exitable
            if (!isSpecialConnectionInformationTransition && !isItemExitable(arrivingItem.getItemIdentifierStack())) {
                return;
            }
            // last chance for chassi to back out
            if (arrivingItem != null) {
                if (arrivingItem.getTransportMode() != TransportMode.Active && !getRoutedPipe().getTransportLayer().stillWantItem(arrivingItem)) {
                    reverseItem(arrivingItem);
                    return;
                }
            }
            ISlotUpgradeManager slotManager;
            {
                ModulePositionType slot = null;
                int positionInt = -1;
                if (arrivingItem.getInfo().targetInfo instanceof ChassiTargetInformation) {
                    positionInt = ((ChassiTargetInformation) arrivingItem.getInfo().targetInfo).getModuleSlot();
                    slot = ModulePositionType.SLOT;
                } else if (LPConstants.DEBUG && container.pipe instanceof PipeLogisticsChassi) {
                    System.out.println(arrivingItem);
                    new RuntimeException("[ItemInsertion] Information weren't ment for a chassi pipe").printStackTrace();
                }
                slotManager = getRoutedPipe().getUpgradeManager(slot, positionInt);
            }
            boolean tookSome = false;
            if (arrivingItem.getAdditionalTargetInformation() instanceof ITargetSlotInformation) {
                ITargetSlotInformation information = (ITargetSlotInformation) arrivingItem.getAdditionalTargetInformation();
                IInventory inv = (IInventory) tile;
                if (inv instanceof ISidedInventory) {
                    inv = new SidedInventoryMinecraftAdapter((ISidedInventory) inv, ForgeDirection.UNKNOWN, false);
                }
                IInventoryUtil util = SimpleServiceLocator.inventoryUtilFactory.getInventoryUtil(inv);
                if (util instanceof ISpecialInsertion) {
                    int slot = information.getTargetSlot();
                    int amount = information.getAmount();
                    if (util.getSizeInventory() > slot) {
                        ItemStack content = util.getStackInSlot(slot);
                        ItemStack toAdd = arrivingItem.getItemIdentifierStack().makeNormalStack();
                        toAdd.stackSize = Math.min(toAdd.stackSize, Math.max(0, amount - (content != null ? content.stackSize : 0)));
                        if (toAdd.stackSize > 0) {
                            if (util.getSizeInventory() > slot) {
                                int added = ((ISpecialInsertion) util).addToSlot(toAdd, slot);
                                arrivingItem.getItemIdentifierStack().lowerStackSize(added);
                                if (added > 0) {
                                    tookSome = true;
                                }
                            }
                        }
                    }
                    if (information.isLimited()) {
                        if (arrivingItem.getItemIdentifierStack().getStackSize() > 0) {
                            reverseItem(arrivingItem);
                        }
                        return;
                    }
                }
            }
            // sneaky insertion
            if (!getRoutedPipe().getUpgradeManager().hasCombinedSneakyUpgrade() || slotManager.hasOwnSneakyUpgrade()) {
                ForgeDirection insertion = arrivingItem.output.getOpposite();
                if (slotManager.hasSneakyUpgrade()) {
                    insertion = slotManager.getSneakyOrientation();
                }
                ItemStack added = InventoryHelper.getTransactorFor(tile, insertion).add(arrivingItem.getItemIdentifierStack().makeNormalStack(), insertion, true);
                arrivingItem.getItemIdentifierStack().lowerStackSize(added.stackSize);
                if (added.stackSize > 0 && arrivingItem instanceof IRoutedItem) {
                    tookSome = true;
                    arrivingItem.setBufferCounter(0);
                }
                ItemRoutingInformation info;
                if (arrivingItem.getItemIdentifierStack().getStackSize() > 0) {
                    // we have some leftovers, we are splitting the stack, we need to clone the info
                    info = arrivingItem.getInfo().clone();
                    // For InvSysCon
                    info.getItem().setStackSize(added.stackSize);
                    insertedItemStack(info, tile);
                } else {
                    info = arrivingItem.getInfo();
                    info.getItem().setStackSize(added.stackSize);
                    // For InvSysCon
                    insertedItemStack(info, tile);
                    // every item has been inserted.
                    return;
                }
            } else {
                ForgeDirection[] dirs = getRoutedPipe().getUpgradeManager().getCombinedSneakyOrientation();
                for (ForgeDirection insertion : dirs) {
                    if (insertion == null) {
                        continue;
                    }
                    ItemStack added = InventoryHelper.getTransactorFor(tile, insertion).add(arrivingItem.getItemIdentifierStack().makeNormalStack(), insertion, true);
                    arrivingItem.getItemIdentifierStack().lowerStackSize(added.stackSize);
                    if (added.stackSize > 0) {
                        tookSome = true;
                        arrivingItem.setBufferCounter(0);
                    }
                    ItemRoutingInformation info;
                    if (arrivingItem.getItemIdentifierStack().getStackSize() > 0) {
                        // we have some leftovers, we are splitting the stack, we need to clone the info
                        info = arrivingItem.getInfo().clone();
                        // For InvSysCon
                        info.getItem().setStackSize(added.stackSize);
                        insertedItemStack(info, tile);
                    } else {
                        info = arrivingItem.getInfo();
                        info.getItem().setStackSize(added.stackSize);
                        // For InvSysCon
                        insertedItemStack(info, tile);
                        // every item has been inserted.
                        return;
                    }
                }
            }
            if (arrivingItem.getItemIdentifierStack().getStackSize() > 0) {
                reverseItem(arrivingItem);
            }
        }
        // the item is handled
        return;
    }
    // end of insert into IInventory
    dropItem(arrivingItem);
}
Also used : IInventory(net.minecraft.inventory.IInventory) ITargetSlotInformation(logisticspipes.interfaces.routing.ITargetSlotInformation) SidedInventoryMinecraftAdapter(logisticspipes.utils.SidedInventoryMinecraftAdapter) FluidRoutedPipe(logisticspipes.pipes.basic.fluid.FluidRoutedPipe) IInventoryUtil(logisticspipes.interfaces.IInventoryUtil) ModulePositionType(logisticspipes.modules.abstractmodules.LogisticsModule.ModulePositionType) ISidedInventory(net.minecraft.inventory.ISidedInventory) PipeItemsFluidSupplier(logisticspipes.pipes.PipeItemsFluidSupplier) ISpecialInsertion(logisticspipes.interfaces.ISpecialInsertion) ChassiTargetInformation(logisticspipes.pipes.PipeLogisticsChassi.ChassiTargetInformation) PipeLogisticsChassi(logisticspipes.pipes.PipeLogisticsChassi) IRoutedItem(logisticspipes.logisticspipes.IRoutedItem) ItemRoutingInformation(logisticspipes.routing.ItemRoutingInformation) ForgeDirection(net.minecraftforge.common.util.ForgeDirection) ItemStack(net.minecraft.item.ItemStack) ISlotUpgradeManager(logisticspipes.interfaces.ISlotUpgradeManager) LPTravelingItemServer(logisticspipes.transport.LPTravelingItem.LPTravelingItemServer)

Example 4 with PipeItemsFluidSupplier

use of logisticspipes.pipes.PipeItemsFluidSupplier in project LogisticsPipes by RS485.

the class PipeTransportLogistics method handleTileReachedServer_internal.

protected final void handleTileReachedServer_internal(LPTravelingItemServer arrivingItem, TileEntity tile, EnumFacing dir) {
    if (getPipe() instanceof PipeItemsFluidSupplier) {
        ((PipeItemsFluidSupplier) getPipe()).endReached(arrivingItem, tile);
        if (arrivingItem.getItemIdentifierStack().getStackSize() <= 0) {
            return;
        }
    }
    markChunkModified(tile);
    if (arrivingItem.getInfo() != null && arrivingItem.getArrived() && isRouted) {
        getRoutedPipe().notifyOfItemArival(arrivingItem.getInfo());
    }
    if (getPipe() instanceof FluidRoutedPipe) {
        if (((FluidRoutedPipe) getPipe()).endReached(arrivingItem, tile)) {
            return;
        }
    }
    boolean isSpecialConnectionInformationTransition = false;
    if (SimpleServiceLocator.specialtileconnection.needsInformationTransition(tile)) {
        isSpecialConnectionInformationTransition = true;
        SimpleServiceLocator.specialtileconnection.transmit(tile, arrivingItem);
    }
    if (SimpleServiceLocator.pipeInformationManager.isItemPipe(tile)) {
        if (passToNextPipe(arrivingItem, tile)) {
            return;
        }
    } else {
        IInventoryUtil util = SimpleServiceLocator.inventoryUtilFactory.getInventoryUtil(tile, dir.getOpposite());
        if (util != null && isRouted) {
            getRoutedPipe().getCacheHolder().trigger(CacheTypes.Inventory);
            // destroy the item on exit if it isn't exitable
            if (!isSpecialConnectionInformationTransition && isItemUnwanted(arrivingItem.getItemIdentifierStack())) {
                return;
            }
            // last chance for chassi to back out
            if (arrivingItem.getTransportMode() != TransportMode.Active && !getRoutedPipe().getTransportLayer().stillWantItem(arrivingItem)) {
                reverseItem(arrivingItem);
                return;
            }
            final ISlotUpgradeManager slotManager;
            {
                ModulePositionType slot = null;
                int positionInt = -1;
                if (arrivingItem.getInfo().targetInfo instanceof ChassiTargetInformation) {
                    positionInt = ((ChassiTargetInformation) arrivingItem.getInfo().targetInfo).getModuleSlot();
                    slot = ModulePositionType.SLOT;
                } else if (LogisticsPipes.isDEBUG() && container.pipe instanceof PipeLogisticsChassis) {
                    System.out.println(arrivingItem);
                    new RuntimeException("[ItemInsertion] Information weren't ment for a chassi pipe").printStackTrace();
                }
                slotManager = getRoutedPipe().getUpgradeManager(slot, positionInt);
            }
            if (arrivingItem.getAdditionalTargetInformation() instanceof ITargetSlotInformation) {
                ITargetSlotInformation information = (ITargetSlotInformation) arrivingItem.getAdditionalTargetInformation();
                if (util instanceof ISpecialInsertion) {
                    int slot = information.getTargetSlot();
                    int amount = information.getAmount();
                    if (util.getSizeInventory() > slot) {
                        ItemStack content = util.getStackInSlot(slot);
                        ItemStack toAdd = arrivingItem.getItemIdentifierStack().makeNormalStack();
                        final int amountLeft = Math.max(0, amount - content.getCount());
                        toAdd.setCount(Math.min(toAdd.getCount(), amountLeft));
                        if (toAdd.getCount() > 0) {
                            if (util.getSizeInventory() > slot) {
                                int added = ((ISpecialInsertion) util).addToSlot(toAdd, slot);
                                arrivingItem.getItemIdentifierStack().lowerStackSize(added);
                            }
                        }
                    }
                    if (information.isLimited()) {
                        if (arrivingItem.getItemIdentifierStack().getStackSize() > 0) {
                            reverseItem(arrivingItem);
                        }
                        return;
                    }
                }
            }
            // sneaky insertion
            if (!getRoutedPipe().getUpgradeManager().hasCombinedSneakyUpgrade() || slotManager.hasOwnSneakyUpgrade()) {
                EnumFacing insertion = arrivingItem.output.getOpposite();
                if (slotManager.hasSneakyUpgrade()) {
                    insertion = slotManager.getSneakyOrientation();
                }
                if (insertArrivingItem(arrivingItem, tile, insertion))
                    return;
            } else {
                EnumFacing[] dirs = getRoutedPipe().getUpgradeManager().getCombinedSneakyOrientation();
                for (EnumFacing insertion : dirs) {
                    if (insertion == null) {
                        continue;
                    }
                    if (insertArrivingItem(arrivingItem, tile, insertion))
                        return;
                }
            }
            if (arrivingItem.getItemIdentifierStack().getStackSize() > 0) {
                reverseItem(arrivingItem);
            }
            // the item is handled
            return;
        }
    // end of insert into IInventory
    }
    dropItem(arrivingItem);
}
Also used : ITargetSlotInformation(logisticspipes.interfaces.routing.ITargetSlotInformation) FluidRoutedPipe(logisticspipes.pipes.basic.fluid.FluidRoutedPipe) IInventoryUtil(logisticspipes.interfaces.IInventoryUtil) EnumFacing(net.minecraft.util.EnumFacing) PipeLogisticsChassis(logisticspipes.pipes.PipeLogisticsChassis) ModulePositionType(logisticspipes.modules.LogisticsModule.ModulePositionType) PipeItemsFluidSupplier(logisticspipes.pipes.PipeItemsFluidSupplier) ISpecialInsertion(logisticspipes.interfaces.ISpecialInsertion) ChassiTargetInformation(logisticspipes.pipes.PipeLogisticsChassis.ChassiTargetInformation) ItemStack(net.minecraft.item.ItemStack) ISlotUpgradeManager(logisticspipes.interfaces.ISlotUpgradeManager)

Example 5 with PipeItemsFluidSupplier

use of logisticspipes.pipes.PipeItemsFluidSupplier in project LogisticsPipes by RS485.

the class GuiHandler method getServerGuiElement.

@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, final int x, final int y, final int z) {
    TileEntity tile = null;
    if (y != -1) {
        tile = world.getTileEntity(new BlockPos(x, y, z));
    }
    LogisticsTileGenericPipe pipe = null;
    if (tile instanceof LogisticsTileGenericPipe) {
        pipe = (LogisticsTileGenericPipe) tile;
    }
    final LogisticsTileGenericPipe fpipe = pipe;
    DummyContainer dummy;
    int xOffset;
    int yOffset;
    if (ID > 10000) {
        ID -= 10000;
    }
    // Handle Module Configuration
    if (ID == -1) {
        return getServerGuiElement(100 * -20 + x, player, world, 0, -1, z);
    }
    if (ID < 110 && ID > 0) {
        switch(ID) {
            case GuiIDs.GUI_FluidSupplier_ID:
                if (pipe == null || !(pipe.pipe instanceof PipeItemsFluidSupplier)) {
                    return null;
                }
                dummy = new DummyContainer(player.inventory, ((PipeItemsFluidSupplier) pipe.pipe).getDummyInventory());
                dummy.addNormalSlotsForPlayerInventory(18, 97);
                xOffset = 72;
                yOffset = 18;
                for (int row = 0; row < 3; row++) {
                    for (int column = 0; column < 3; column++) {
                        dummy.addDummySlot(column + row * 3, xOffset + column * 18, yOffset + row * 18);
                    }
                }
                MainProxy.sendPacketToPlayer(PacketHandler.getPacket(FluidSupplierMode.class).setInteger((((PipeItemsFluidSupplier) pipe.pipe).isRequestingPartials() ? 1 : 0)).setBlockPos(pipe.getPos()), player);
                return dummy;
            case GuiIDs.GUI_FluidSupplier_MK2_ID:
                if (pipe == null || !(pipe.pipe instanceof PipeFluidSupplierMk2)) {
                    return null;
                }
                dummy = new DummyContainer(player.inventory, ((PipeFluidSupplierMk2) pipe.pipe).getDummyInventory());
                dummy.addNormalSlotsForPlayerInventory(18, 97);
                dummy.addFluidSlot(0, ((PipeFluidSupplierMk2) pipe.pipe).getDummyInventory(), 0, 0);
                MainProxy.sendPacketToPlayer(PacketHandler.getPacket(FluidSupplierMode.class).setInteger((((PipeFluidSupplierMk2) pipe.pipe).isRequestingPartials() ? 1 : 0)).setBlockPos(pipe.getPos()), player);
                MainProxy.sendPacketToPlayer(PacketHandler.getPacket(FluidSupplierMinMode.class).setInteger(((PipeFluidSupplierMk2) pipe.pipe).getMinMode().ordinal()).setBlockPos(pipe.getPos()), player);
                return dummy;
            case GuiIDs.GUI_SatellitePipe_ID:
                if (pipe != null && pipe.pipe instanceof PipeItemsSatelliteLogistics) {
                    return new DummyContainer(player.inventory, null);
                }
                if (pipe != null && pipe.pipe instanceof PipeFluidSatellite) {
                    return new DummyContainer(player.inventory, null);
                }
            case GuiIDs.GUI_Normal_Orderer_ID:
                if (pipe == null || !(pipe.pipe instanceof CoreRoutedPipe)) {
                    return null;
                }
                return new DummyContainer(player.inventory, null);
            case GuiIDs.GUI_Normal_Mk2_Orderer_ID:
                if (pipe == null || !(pipe.pipe instanceof PipeItemsRequestLogisticsMk2)) {
                    return null;
                }
                return new DummyContainer(player.inventory, null);
            case GuiIDs.GUI_Fluid_Orderer_ID:
                if (pipe == null || !(pipe.pipe instanceof PipeFluidRequestLogistics)) {
                    return null;
                }
                return new DummyContainer(player.inventory, null);
            case GuiIDs.GUI_Freq_Card_ID:
                if (pipe == null || !((pipe.pipe instanceof PipeItemsSystemEntranceLogistics) || (pipe.pipe instanceof PipeItemsSystemDestinationLogistics))) {
                    return null;
                }
                IInventory inv = null;
                if (pipe.pipe instanceof PipeItemsSystemEntranceLogistics) {
                    inv = ((PipeItemsSystemEntranceLogistics) pipe.pipe).inv;
                } else if (pipe.pipe instanceof PipeItemsSystemDestinationLogistics) {
                    inv = ((PipeItemsSystemDestinationLogistics) pipe.pipe).inv;
                }
                dummy = new DummyContainer(player.inventory, inv);
                dummy.addRestrictedSlot(0, inv, 40, 40, itemStack -> {
                    if (itemStack.isEmpty()) {
                        return false;
                    }
                    if (itemStack.getItem() != LPItems.itemCard) {
                        return false;
                    }
                    return itemStack.getItemDamage() == LogisticsItemCard.FREQ_CARD;
                });
                dummy.addNormalSlotsForPlayerInventory(0, 0);
                return dummy;
            case GuiIDs.GUI_HUD_Settings:
                dummy = new DummyContainer(player.inventory, null);
                dummy.addRestrictedHotbarForPlayerInventory(10, 160);
                dummy.addRestrictedArmorForPlayerInventory(10, 60);
                return dummy;
            case GuiIDs.GUI_Fluid_Basic_ID:
                if (pipe == null || !((pipe.pipe instanceof PipeFluidBasic))) {
                    return null;
                }
                dummy = new DummyContainer(player, ((PipeFluidBasic) pipe.pipe).getSinkInv(), new IGuiOpenControler() {

                    @Override
                    public void guiOpenedByPlayer(EntityPlayer player) {
                        ((PipeFluidBasic) fpipe.pipe).guiOpenedByPlayer(player);
                    }

                    @Override
                    public void guiClosedByPlayer(EntityPlayer player) {
                        ((PipeFluidBasic) fpipe.pipe).guiClosedByPlayer(player);
                    }
                });
                dummy.addFluidSlot(0, ((PipeFluidBasic) pipe.pipe).getSinkInv(), 28, 15);
                dummy.addNormalSlotsForPlayerInventory(10, 45);
                return dummy;
            case GuiIDs.GUI_Fluid_Terminus_ID:
                if (pipe == null || !((pipe.pipe instanceof PipeFluidTerminus))) {
                    return null;
                }
                dummy = new DummyContainer(player, ((PipeFluidTerminus) pipe.pipe).getSinkInv(), new IGuiOpenControler() {

                    @Override
                    public void guiOpenedByPlayer(EntityPlayer player) {
                        ((PipeFluidTerminus) fpipe.pipe).guiOpenedByPlayer(player);
                    }

                    @Override
                    public void guiClosedByPlayer(EntityPlayer player) {
                        ((PipeFluidTerminus) fpipe.pipe).guiClosedByPlayer(player);
                    }
                });
                for (int i = 0; i < 9; i++) {
                    dummy.addFluidSlot(i, ((PipeFluidTerminus) pipe.pipe).getSinkInv(), 8 + i * 18, 13);
                }
                dummy.addNormalSlotsForPlayerInventory(10, 45);
                return dummy;
            case GuiIDs.GUI_FIREWALL:
                if (pipe == null || !((pipe.pipe instanceof PipeItemsFirewall))) {
                    return null;
                }
                dummy = new DummyContainer(player.inventory, ((PipeItemsFirewall) pipe.pipe).inv);
                dummy.addNormalSlotsForPlayerInventory(33, 147);
                for (int i = 0; i < 6; i++) {
                    for (int j = 0; j < 6; j++) {
                        dummy.addDummySlot(i * 6 + j, 0, 0);
                    }
                }
                return dummy;
            case GuiIDs.GUI_Request_Table_ID:
                if (pipe == null || !(pipe.pipe instanceof PipeBlockRequestTable)) {
                    return null;
                }
                dummy = new DummyContainer(player, ((PipeBlockRequestTable) pipe.pipe).matrix, (PipeBlockRequestTable) pipe.pipe);
                int i = 0;
                for (int Y = 0; Y < 3; Y++) {
                    for (int X = 0; X < 9; X++) {
                        dummy.addNormalSlot(i++, ((PipeBlockRequestTable) pipe.pipe).inv, 0, 0);
                    }
                }
                i = 0;
                for (int Y = 0; Y < 3; Y++) {
                    for (int X = 0; X < 3; X++) {
                        dummy.addDummySlot(i++, 0, 0);
                    }
                }
                dummy.addCallableSlotHandler(0, ((PipeBlockRequestTable) pipe.pipe).resultInv, 0, 0, () -> ((PipeBlockRequestTable) fpipe.pipe).getResultForClick());
                dummy.addNormalSlot(0, ((PipeBlockRequestTable) pipe.pipe).toSortInv, 0, 0);
                dummy.addNormalSlot(0, ((PipeBlockRequestTable) pipe.pipe).diskInv, 0, 0);
                dummy.addNormalSlotsForPlayerInventory(0, 0);
                return dummy;
            default:
                break;
        }
    }
    return null;
}
Also used : IInventory(net.minecraft.inventory.IInventory) DummyContainer(logisticspipes.utils.gui.DummyContainer) PipeItemsFirewall(logisticspipes.pipes.PipeItemsFirewall) PipeBlockRequestTable(logisticspipes.pipes.PipeBlockRequestTable) PipeItemsSatelliteLogistics(logisticspipes.pipes.PipeItemsSatelliteLogistics) PipeItemsSystemEntranceLogistics(logisticspipes.pipes.PipeItemsSystemEntranceLogistics) CoreRoutedPipe(logisticspipes.pipes.basic.CoreRoutedPipe) PipeFluidTerminus(logisticspipes.pipes.PipeFluidTerminus) PipeFluidBasic(logisticspipes.pipes.PipeFluidBasic) PipeFluidSatellite(logisticspipes.pipes.PipeFluidSatellite) TileEntity(net.minecraft.tileentity.TileEntity) PipeFluidSupplierMk2(logisticspipes.pipes.PipeFluidSupplierMk2) PipeItemsFluidSupplier(logisticspipes.pipes.PipeItemsFluidSupplier) PipeFluidRequestLogistics(logisticspipes.pipes.PipeFluidRequestLogistics) PipeItemsSystemDestinationLogistics(logisticspipes.pipes.PipeItemsSystemDestinationLogistics) IGuiOpenControler(logisticspipes.interfaces.IGuiOpenControler) FluidSupplierMode(logisticspipes.network.packets.pipe.FluidSupplierMode) LogisticsTileGenericPipe(logisticspipes.pipes.basic.LogisticsTileGenericPipe) EntityPlayer(net.minecraft.entity.player.EntityPlayer) BlockPos(net.minecraft.util.math.BlockPos) PipeItemsRequestLogisticsMk2(logisticspipes.pipes.PipeItemsRequestLogisticsMk2) FluidSupplierMinMode(logisticspipes.network.packets.pipe.FluidSupplierMinMode)

Aggregations

PipeItemsFluidSupplier (logisticspipes.pipes.PipeItemsFluidSupplier)6 LogisticsTileGenericPipe (logisticspipes.pipes.basic.LogisticsTileGenericPipe)4 PipeFluidSupplierMk2 (logisticspipes.pipes.PipeFluidSupplierMk2)3 IInventory (net.minecraft.inventory.IInventory)3 IInventoryUtil (logisticspipes.interfaces.IInventoryUtil)2 ISlotUpgradeManager (logisticspipes.interfaces.ISlotUpgradeManager)2 ISpecialInsertion (logisticspipes.interfaces.ISpecialInsertion)2 ITargetSlotInformation (logisticspipes.interfaces.routing.ITargetSlotInformation)2 PipeBlockRequestTable (logisticspipes.pipes.PipeBlockRequestTable)2 PipeFluidBasic (logisticspipes.pipes.PipeFluidBasic)2 PipeFluidRequestLogistics (logisticspipes.pipes.PipeFluidRequestLogistics)2 PipeFluidTerminus (logisticspipes.pipes.PipeFluidTerminus)2 PipeItemsFirewall (logisticspipes.pipes.PipeItemsFirewall)2 PipeItemsRequestLogisticsMk2 (logisticspipes.pipes.PipeItemsRequestLogisticsMk2)2 PipeItemsSystemDestinationLogistics (logisticspipes.pipes.PipeItemsSystemDestinationLogistics)2 PipeItemsSystemEntranceLogistics (logisticspipes.pipes.PipeItemsSystemEntranceLogistics)2 FluidRoutedPipe (logisticspipes.pipes.basic.fluid.FluidRoutedPipe)2 ItemStack (net.minecraft.item.ItemStack)2 TileEntity (net.minecraft.tileentity.TileEntity)2 BlockPos (net.minecraft.util.math.BlockPos)2