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