Search in sources :

Example 1 with ModuleProvider

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

the class ProviderModuleGuiProvider method getContainer.

@Override
public DummyContainer getContainer(EntityPlayer player) {
    ModuleProvider module = this.getLogisticsModule(player.getEntityWorld(), ModuleProvider.class);
    if (module == null) {
        return null;
    }
    DummyContainer dummy = new DummyContainer(player.inventory, module.getFilterInventory());
    dummy.addNormalSlotsForPlayerInventory(18, 97);
    int xOffset = 72;
    int 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);
        }
    }
    return dummy;
}
Also used : DummyContainer(logisticspipes.utils.gui.DummyContainer) ModuleProvider(logisticspipes.modules.ModuleProvider)

Example 2 with ModuleProvider

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

the class ProviderModuleIncludePacket method processPacket.

@Override
public void processPacket(EntityPlayer player) {
    final ModuleProvider module = this.getLogisticsModule(player, ModuleProvider.class);
    if (module == null) {
        return;
    }
    module.setFilterExcluded(!module.isExcludeFilter());
    MainProxy.sendPacketToPlayer(PacketHandler.getPacket(ProviderModuleInclude.class).setFlag(module.isExcludeFilter()).setModulePos(module), player);
}
Also used : ModuleProvider(logisticspipes.modules.ModuleProvider) ProviderModuleInclude(logisticspipes.network.packets.modules.ProviderModuleInclude)

Example 3 with ModuleProvider

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

the class ProviderModuleInclude method processPacket.

@Override
public void processPacket(EntityPlayer player) {
    final ModuleProvider module = this.getLogisticsModule(player, ModuleProvider.class);
    if (module == null) {
        return;
    }
    module.setFilterExcluded(isFlag());
}
Also used : ModuleProvider(logisticspipes.modules.ModuleProvider)

Example 4 with ModuleProvider

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

the class ProviderModuleInHand method getContainer.

@Override
public DummyContainer getContainer(EntityPlayer player) {
    DummyModuleContainer dummy = new DummyModuleContainer(player, getInvSlot());
    if (!(dummy.getModule() instanceof ModuleProvider)) {
        return null;
    }
    dummy.setInventory(((ModuleProvider) dummy.getModule()).getFilterInventory());
    dummy.addNormalSlotsForPlayerInventory(18, 97);
    int xOffset = 72;
    int 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);
        }
    }
    return dummy;
}
Also used : DummyModuleContainer(logisticspipes.utils.gui.DummyModuleContainer) ModuleProvider(logisticspipes.modules.ModuleProvider)

Example 5 with ModuleProvider

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

the class ProviderModuleGuiProvider method getClientGui.

@Override
public Object getClientGui(EntityPlayer player) {
    ModuleProvider module = this.getLogisticsModule(player.getEntityWorld(), ModuleProvider.class);
    if (module == null) {
        return null;
    }
    module.setFilterExcluded(exclude);
    module.setExtractionMode(extractorMode);
    module.setSneakyDirection(sneakyOrientation);
    module.setIsActive(isActive);
    return new logisticspipes.gui.modules.GuiProvider(player.inventory, module);
}
Also used : ModuleCoordinatesGuiProvider(logisticspipes.network.abstractguis.ModuleCoordinatesGuiProvider) GuiProvider(logisticspipes.network.abstractguis.GuiProvider) ModuleProvider(logisticspipes.modules.ModuleProvider)

Aggregations

ModuleProvider (logisticspipes.modules.ModuleProvider)7 GuiProvider (logisticspipes.network.abstractguis.GuiProvider)1 ModuleCoordinatesGuiProvider (logisticspipes.network.abstractguis.ModuleCoordinatesGuiProvider)1 ProviderModuleInclude (logisticspipes.network.packets.modules.ProviderModuleInclude)1 ProviderModuleMode (logisticspipes.network.packets.modules.ProviderModuleMode)1 DummyContainer (logisticspipes.utils.gui.DummyContainer)1 DummyModuleContainer (logisticspipes.utils.gui.DummyModuleContainer)1