Search in sources :

Example 1 with ModuleAdvancedExtractor

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

the class AdvancedExtractorModuleSlot method getContainer.

@Override
public DummyContainer getContainer(EntityPlayer player) {
    ModuleAdvancedExtractor module = this.getLogisticsModule(player.getEntityWorld(), ModuleAdvancedExtractor.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) ModuleAdvancedExtractor(logisticspipes.modules.ModuleAdvancedExtractor)

Example 2 with ModuleAdvancedExtractor

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

the class AdvancedExtractorModuleInHand method getContainer.

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

Example 3 with ModuleAdvancedExtractor

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

the class AdvancedExtractorSneakyGuiPacket method processPacket.

@Override
public void processPacket(EntityPlayer player) {
    if (getType() == ModulePositionType.IN_HAND) {
        if (player.openContainer instanceof DummyModuleContainer) {
            DummyModuleContainer dummy = (DummyModuleContainer) player.openContainer;
            if (dummy.getModule() instanceof ModuleAdvancedExtractor) {
                player.closeScreen();
                NewGuiHandler.getGui(ExtractorModuleInHand.class).setInvSlot(getPositionInt()).open(player);
            }
        }
        return;
    }
    final LogisticsTileGenericPipe pipe = this.getPipe(player.worldObj);
    if (pipe == null) {
        return;
    }
    if (!(pipe.pipe instanceof CoreRoutedPipe)) {
        return;
    }
    final CoreRoutedPipe piperouted = (CoreRoutedPipe) pipe.pipe;
    if (piperouted.getLogisticsModule() == null) {
        return;
    }
    if (piperouted.getLogisticsModule().getSubModule(getPositionInt()) instanceof ModuleAdvancedExtractor) {
        final ModuleAdvancedExtractor module = (ModuleAdvancedExtractor) piperouted.getLogisticsModule().getSubModule(getPositionInt());
        NewGuiHandler.getGui(ExtractorModuleSlot.class).setSneakyOrientation(module.getSneakyDirection()).setSlot(getType()).setPositionInt(getPositionInt()).setPosX(getPosX()).setPosY(getPosY()).setPosZ(getPosZ()).open(player);
        return;
    }
}
Also used : DummyModuleContainer(logisticspipes.utils.gui.DummyModuleContainer) ModuleAdvancedExtractor(logisticspipes.modules.ModuleAdvancedExtractor) LogisticsTileGenericPipe(logisticspipes.pipes.basic.LogisticsTileGenericPipe) CoreRoutedPipe(logisticspipes.pipes.basic.CoreRoutedPipe) ExtractorModuleSlot(logisticspipes.network.guis.module.inpipe.ExtractorModuleSlot)

Example 4 with ModuleAdvancedExtractor

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

the class AdvancedExtractorIncludePacket method processPacket.

@Override
public void processPacket(EntityPlayer player) {
    final ModuleAdvancedExtractor module = this.getLogisticsModule(player, ModuleAdvancedExtractor.class);
    if (module == null) {
        return;
    }
    module.setItemsIncluded(!module.areItemsIncluded());
    MainProxy.sendPacketToPlayer(PacketHandler.getPacket(AdvancedExtractorInclude.class).setFlag(module.areItemsIncluded()).setPacketPos(this), player);
}
Also used : AdvancedExtractorInclude(logisticspipes.network.packets.modules.AdvancedExtractorInclude) ModuleAdvancedExtractor(logisticspipes.modules.ModuleAdvancedExtractor)

Example 5 with ModuleAdvancedExtractor

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

the class AdvancedExtractorModuleSlot method getClientGui.

@Override
public Object getClientGui(EntityPlayer player) {
    ModuleAdvancedExtractor module = this.getLogisticsModule(player.getEntityWorld(), ModuleAdvancedExtractor.class);
    if (module == null) {
        return null;
    }
    module.setItemsIncluded(areItemsIncluded);
    return new GuiAdvancedExtractor(player.inventory, module);
}
Also used : ModuleAdvancedExtractor(logisticspipes.modules.ModuleAdvancedExtractor) GuiAdvancedExtractor(logisticspipes.gui.modules.GuiAdvancedExtractor)

Aggregations

ModuleAdvancedExtractor (logisticspipes.modules.ModuleAdvancedExtractor)6 DummyModuleContainer (logisticspipes.utils.gui.DummyModuleContainer)2 GuiAdvancedExtractor (logisticspipes.gui.modules.GuiAdvancedExtractor)1 ExtractorModuleSlot (logisticspipes.network.guis.module.inpipe.ExtractorModuleSlot)1 AdvancedExtractorInclude (logisticspipes.network.packets.modules.AdvancedExtractorInclude)1 CoreRoutedPipe (logisticspipes.pipes.basic.CoreRoutedPipe)1 LogisticsTileGenericPipe (logisticspipes.pipes.basic.LogisticsTileGenericPipe)1 DummyContainer (logisticspipes.utils.gui.DummyContainer)1