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;
}
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);
}
}
}
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;
}
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);
}
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;
}
Aggregations