Search in sources :

Example 1 with ModuleItemSink

use of logisticspipes.modules.ModuleItemSink in project LogisticsPipes by RS485.

the class ItemSinkSlot method getContainer.

@Override
public DummyContainer getContainer(EntityPlayer player) {
    ModuleItemSink module = this.getLogisticsModule(player.getEntityWorld(), ModuleItemSink.class);
    if (module == null) {
        return null;
    }
    DummyContainer dummy = new DummyContainer(player.inventory, module.getFilterInventory());
    dummy.addNormalSlotsForPlayerInventory(8, 60);
    //Pipe slots
    for (int pipeSlot = 0; pipeSlot < 9; pipeSlot++) {
        dummy.addDummySlot(pipeSlot, 8 + pipeSlot * 18, 18);
    }
    return dummy;
}
Also used : DummyContainer(logisticspipes.utils.gui.DummyContainer) ModuleItemSink(logisticspipes.modules.ModuleItemSink)

Example 2 with ModuleItemSink

use of logisticspipes.modules.ModuleItemSink in project LogisticsPipes by RS485.

the class ItemSinkDefaultPacket method processPacket.

@Override
public void processPacket(EntityPlayer player) {
    ModuleItemSink module = this.getLogisticsModule(player, ModuleItemSink.class);
    if (module == null) {
        return;
    }
    module.setDefaultRoute(isDefault);
}
Also used : ModuleItemSink(logisticspipes.modules.ModuleItemSink)

Example 3 with ModuleItemSink

use of logisticspipes.modules.ModuleItemSink in project LogisticsPipes by RS485.

the class ItemSinkFuzzy method processPacket.

@Override
public void processPacket(EntityPlayer player) {
    ModuleItemSink module = this.getLogisticsModule(player, ModuleItemSink.class);
    if (module == null) {
        return;
    }
    if (pos != -1) {
        if (isNBT) {
            module.setIgnoreNBT(pos, player);
        } else {
            module.setIgnoreData(pos, player);
        }
    } else {
        module.setIgnoreNBT(ignoreNBT);
        module.setIgnoreData(ignoreData);
    }
}
Also used : ModuleItemSink(logisticspipes.modules.ModuleItemSink)

Example 4 with ModuleItemSink

use of logisticspipes.modules.ModuleItemSink in project LogisticsPipes by RS485.

the class ItemSinkSlot method getClientGui.

@Override
public Object getClientGui(EntityPlayer player) {
    ModuleItemSink module = this.getLogisticsModule(player.getEntityWorld(), ModuleItemSink.class);
    if (module == null) {
        return null;
    }
    module.setDefaultRoute(isDefaultRoute);
    module.setIgnoreData(ignoreData);
    module.setIgnoreNBT(ignoreNBT);
    return new GuiItemSink(player.inventory, module, hasFuzzyUpgrade);
}
Also used : ModuleItemSink(logisticspipes.modules.ModuleItemSink) GuiItemSink(logisticspipes.gui.modules.GuiItemSink)

Example 5 with ModuleItemSink

use of logisticspipes.modules.ModuleItemSink in project LogisticsPipes by RS485.

the class ItemSinkImportPacket method processPacket.

@Override
public void processPacket(EntityPlayer player) {
    if (MainProxy.isServer(player.world)) {
        ModuleItemSink module = this.getLogisticsModule(player, ModuleItemSink.class);
        if (module == null) {
            return;
        }
        MainProxy.sendPacketToPlayer(PacketHandler.getPacket(ItemSinkImportPacket.class).setImportedItems(module.getAdjacentInventoriesItems().limit(module.filterInventory.getSizeInventory()).collect(Collectors.toList())).setPacketPos(this), player);
    } else if (MainProxy.isClient(player.world)) {
        if (importedItems == null)
            return;
        if (Minecraft.getMinecraft().currentScreen instanceof GuiItemSink) {
            ((GuiItemSink) Minecraft.getMinecraft().currentScreen).importFromInventory(importedItems.stream());
        }
    }
}
Also used : ModuleItemSink(logisticspipes.modules.ModuleItemSink) GuiItemSink(logisticspipes.gui.modules.GuiItemSink)

Aggregations

ModuleItemSink (logisticspipes.modules.ModuleItemSink)7 GuiItemSink (logisticspipes.gui.modules.GuiItemSink)2 DummyContainer (logisticspipes.utils.gui.DummyContainer)1 DummyModuleContainer (logisticspipes.utils.gui.DummyModuleContainer)1