Search in sources :

Example 16 with DummyContainer

use of logisticspipes.utils.gui.DummyContainer in project LogisticsPipes by RS485.

the class StatisticsGui method getClientGui.

@Override
public Object getClientGui(EntityPlayer player) {
    LogisticsStatisticsTileEntity statisticsTable = getTileAs(player.world, LogisticsStatisticsTileEntity.class);
    statisticsTable.tasks = trackingList;
    GuiStatistics gui = new GuiStatistics(statisticsTable);
    gui.inventorySlots = new DummyContainer(player.inventory, null);
    return gui;
}
Also used : LogisticsStatisticsTileEntity(logisticspipes.blocks.stats.LogisticsStatisticsTileEntity) DummyContainer(logisticspipes.utils.gui.DummyContainer) GuiStatistics(logisticspipes.gui.GuiStatistics)

Example 17 with DummyContainer

use of logisticspipes.utils.gui.DummyContainer in project LogisticsPipes by RS485.

the class DummyContainerSlotClick method processPacket.

@Override
public void processPacket(EntityPlayer player) {
    if (player instanceof EntityPlayerMP && ((EntityPlayerMP) player).openContainer instanceof DummyContainer) {
        DummyContainer container = (DummyContainer) ((EntityPlayerMP) player).openContainer;
        Slot slot = container.inventorySlots.get(slotId);
        if (slot instanceof DummySlot || slot instanceof ColorSlot || slot instanceof FluidSlot) {
            container.handleDummyClick(slot, slotId, stack, button, ClickType.PICKUP, player);
        }
    }
}
Also used : DummyContainer(logisticspipes.utils.gui.DummyContainer) ColorSlot(logisticspipes.utils.gui.ColorSlot) DummySlot(logisticspipes.utils.gui.DummySlot) FluidSlot(logisticspipes.utils.gui.FluidSlot) ColorSlot(logisticspipes.utils.gui.ColorSlot) Slot(net.minecraft.inventory.Slot) DummySlot(logisticspipes.utils.gui.DummySlot) EntityPlayerMP(net.minecraft.entity.player.EntityPlayerMP) FluidSlot(logisticspipes.utils.gui.FluidSlot)

Example 18 with DummyContainer

use of logisticspipes.utils.gui.DummyContainer in project LogisticsPipes by RS485.

the class SolderingStationGui method getContainer.

@Override
public DummyContainer getContainer(EntityPlayer player) {
    final LogisticsSolderingTileEntity tile = this.getTile(player.worldObj, LogisticsSolderingTileEntity.class);
    if (tile == null) {
        return null;
    }
    DummyContainer dummy = new DummyContainer(player, tile, tile);
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
            final int slotNumber = i * 3 + j;
            dummy.addRestrictedSlot(slotNumber, tile, 44 + (j * 18), 17 + (i * 18), itemStack -> {
                return tile.checkSlot(itemStack, slotNumber);
            });
        }
    }
    dummy.addRestrictedSlot(9, tile, 107, 17, Items.iron_ingot);
    dummy.addRestrictedSlot(10, tile, 141, 47, (Item) null);
    dummy.addRestrictedSlot(11, tile, 9, 9, itemStack -> tile.getRecipeForTaget(itemStack) != null && tile.areStacksEmpty());
    dummy.addNormalSlotsForPlayerInventory(8, 84);
    return dummy;
}
Also used : DummyContainer(logisticspipes.utils.gui.DummyContainer) LogisticsSolderingTileEntity(logisticspipes.blocks.LogisticsSolderingTileEntity)

Example 19 with DummyContainer

use of logisticspipes.utils.gui.DummyContainer in project LogisticsPipes by RS485.

the class ApiaristSinkModuleSlot method getContainer.

@Override
public DummyContainer getContainer(EntityPlayer player) {
    SimpleServiceLocator.forestryProxy.syncTracker(player.getEntityWorld(), player);
    ModuleApiaristSink module = this.getLogisticsModule(player.getEntityWorld(), ModuleApiaristSink.class);
    if (module == null) {
        return null;
    }
    return new DummyContainer(player.inventory, null);
}
Also used : ModuleApiaristSink(logisticspipes.modules.ModuleApiaristSink) DummyContainer(logisticspipes.utils.gui.DummyContainer)

Example 20 with DummyContainer

use of logisticspipes.utils.gui.DummyContainer in project LogisticsPipes by RS485.

the class ChassiGuiProvider method getContainer.

@Override
public DummyContainer getContainer(EntityPlayer player) {
    LogisticsTileGenericPipe pipe = getPipe(player.getEntityWorld());
    if (pipe == null || !(pipe.pipe instanceof PipeLogisticsChassi)) {
        return null;
    }
    final PipeLogisticsChassi _chassiPipe = (PipeLogisticsChassi) pipe.pipe;
    IInventory _moduleInventory = _chassiPipe.getModuleInventory();
    DummyContainer dummy = new DummyContainer(player.inventory, _moduleInventory);
    if (_chassiPipe.getChassiSize() < 5) {
        dummy.addNormalSlotsForPlayerInventory(18, 97);
    } else {
        dummy.addNormalSlotsForPlayerInventory(18, 174);
    }
    if (_chassiPipe.getChassiSize() > 0) {
        dummy.addModuleSlot(0, _moduleInventory, 19, 9, _chassiPipe);
    }
    if (_chassiPipe.getChassiSize() > 1) {
        dummy.addModuleSlot(1, _moduleInventory, 19, 29, _chassiPipe);
    }
    if (_chassiPipe.getChassiSize() > 2) {
        dummy.addModuleSlot(2, _moduleInventory, 19, 49, _chassiPipe);
    }
    if (_chassiPipe.getChassiSize() > 3) {
        dummy.addModuleSlot(3, _moduleInventory, 19, 69, _chassiPipe);
    }
    if (_chassiPipe.getChassiSize() > 4) {
        dummy.addModuleSlot(4, _moduleInventory, 19, 89, _chassiPipe);
        dummy.addModuleSlot(5, _moduleInventory, 19, 109, _chassiPipe);
        dummy.addModuleSlot(6, _moduleInventory, 19, 129, _chassiPipe);
        dummy.addModuleSlot(7, _moduleInventory, 19, 149, _chassiPipe);
    }
    if (_chassiPipe.getUpgradeManager().hasUpgradeModuleUpgrade()) {
        for (int i = 0; i < _chassiPipe.getChassiSize(); i++) {
            final int fI = i;
            ModuleUpgradeManager upgradeManager = _chassiPipe.getModuleUpgradeManager(i);
            dummy.addUpgradeSlot(0, upgradeManager, 0, 145, 9 + i * 20, itemStack -> ChassiGuiProvider.checkStack(itemStack, _chassiPipe, fI));
            dummy.addUpgradeSlot(1, upgradeManager, 1, 165, 9 + i * 20, itemStack -> ChassiGuiProvider.checkStack(itemStack, _chassiPipe, fI));
        }
    }
    return dummy;
}
Also used : IInventory(net.minecraft.inventory.IInventory) DummyContainer(logisticspipes.utils.gui.DummyContainer) PipeLogisticsChassi(logisticspipes.pipes.PipeLogisticsChassi) LogisticsTileGenericPipe(logisticspipes.pipes.basic.LogisticsTileGenericPipe) ModuleUpgradeManager(logisticspipes.pipes.upgrades.ModuleUpgradeManager)

Aggregations

DummyContainer (logisticspipes.utils.gui.DummyContainer)31 LogisticsTileGenericPipe (logisticspipes.pipes.basic.LogisticsTileGenericPipe)6 EntityPlayer (net.minecraft.entity.player.EntityPlayer)4 IGuiOpenControler (logisticspipes.interfaces.IGuiOpenControler)3 IInventory (net.minecraft.inventory.IInventory)3 TileEntity (net.minecraft.tileentity.TileEntity)3 Nullable (javax.annotation.Nullable)2 CoreRoutedPipe (logisticspipes.pipes.basic.CoreRoutedPipe)2 ItemIdentifierInventory (logisticspipes.utils.item.ItemIdentifierInventory)2 Iterator (java.util.Iterator)1 Map (java.util.Map)1 Objects (java.util.Objects)1 Stream (java.util.stream.Stream)1 Nonnull (javax.annotation.Nonnull)1 LogisticsProgramCompilerTileEntity (logisticspipes.blocks.LogisticsProgramCompilerTileEntity)1 LogisticsSecurityTileEntity (logisticspipes.blocks.LogisticsSecurityTileEntity)1 LogisticsSolderingTileEntity (logisticspipes.blocks.LogisticsSolderingTileEntity)1 LogisticsCraftingTableTileEntity (logisticspipes.blocks.crafting.LogisticsCraftingTableTileEntity)1 LogisticsPowerJunctionTileEntity (logisticspipes.blocks.powertile.LogisticsPowerJunctionTileEntity)1 LogisticsPowerProviderTileEntity (logisticspipes.blocks.powertile.LogisticsPowerProviderTileEntity)1