Search in sources :

Example 1 with SimpleFilter

use of network.rs485.logisticspipes.module.SimpleFilter in project LogisticsPipes by RS485.

the class SimpleFilterInventorySlot method getContainerFromFilterModule.

@Nullable
public static DummyContainer getContainerFromFilterModule(ModuleCoordinatesGuiProvider guiProvider, EntityPlayer player) {
    SimpleFilter filter = guiProvider.getLogisticsModule(player.getEntityWorld(), SimpleFilter.class);
    if (filter == null) {
        return null;
    }
    DummyContainer dummy = new DummyContainer(player.inventory, filter.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) GuiSimpleFilter(logisticspipes.gui.modules.GuiSimpleFilter) SimpleFilter(network.rs485.logisticspipes.module.SimpleFilter) Nullable(javax.annotation.Nullable)

Example 2 with SimpleFilter

use of network.rs485.logisticspipes.module.SimpleFilter in project LogisticsPipes by RS485.

the class SimpleFilterInventoryInHand method getContainer.

@Override
public DummyContainer getContainer(EntityPlayer player) {
    DummyModuleContainer dummy = new DummyModuleContainer(player, getInvSlot());
    if (!(dummy.getModule() instanceof SimpleFilter)) {
        return null;
    }
    dummy.setInventory(((SimpleFilter) dummy.getModule()).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 : DummyModuleContainer(logisticspipes.utils.gui.DummyModuleContainer) GuiSimpleFilter(logisticspipes.gui.modules.GuiSimpleFilter) SimpleFilter(network.rs485.logisticspipes.module.SimpleFilter)

Aggregations

GuiSimpleFilter (logisticspipes.gui.modules.GuiSimpleFilter)2 SimpleFilter (network.rs485.logisticspipes.module.SimpleFilter)2 Nullable (javax.annotation.Nullable)1 DummyContainer (logisticspipes.utils.gui.DummyContainer)1 DummyModuleContainer (logisticspipes.utils.gui.DummyModuleContainer)1