use of logisticspipes.pipes.basic.CoreRoutedPipe 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.pipes.basic.CoreRoutedPipe in project LogisticsPipes by RS485.
the class SubmitFluidRequestPacket method processPacket.
@Override
public void processPacket(EntityPlayer player) {
final LogisticsTileGenericPipe pipe = MainProxy.proxy.getPipeInDimensionAt(getDimension(), getPosX(), getPosY(), getPosZ(), player);
if (pipe == null || !(pipe.pipe instanceof CoreRoutedPipe) || !(pipe.pipe instanceof IRequestFluid)) {
return;
}
RequestHandler.requestFluid(player, getStack(), (CoreRoutedPipe) pipe.pipe, (IRequestFluid) pipe.pipe);
}
use of logisticspipes.pipes.basic.CoreRoutedPipe in project LogisticsPipes by RS485.
the class PipeItemsInvSysConnector method onChunkUnload.
@Override
public void onChunkUnload() {
if (!stillNeedReplace) {
CoreRoutedPipe CRP = SimpleServiceLocator.connectionManager.getConnectedPipe(getRouter());
SimpleServiceLocator.connectionManager.removeDirectConnection(getRouter());
if (CRP != null) {
CRP.refreshRender(true);
}
}
init = false;
super.onChunkUnload();
}
use of logisticspipes.pipes.basic.CoreRoutedPipe in project LogisticsPipes by RS485.
the class PipeItemsInvSysConnector method onAllowedRemoval.
@Override
public void onAllowedRemoval() {
if (!stillNeedReplace) {
CoreRoutedPipe CRP = SimpleServiceLocator.connectionManager.getConnectedPipe(getRouter());
SimpleServiceLocator.connectionManager.removeDirectConnection(getRouter());
if (CRP != null) {
CRP.refreshRender(true);
}
}
dropFreqCard();
}
use of logisticspipes.pipes.basic.CoreRoutedPipe in project LogisticsPipes by RS485.
the class PipeItemsInvSysConnector method handleItemEnterInv.
public void handleItemEnterInv(ItemRoutingInformation info, TileEntity tile) {
if (info.getItem().getStackSize() == 0) {
// system.throw("why you try to insert empty stack?");
return;
}
if (isConnectedInv(tile)) {
if (hasRemoteConnection()) {
CoreRoutedPipe CRP = SimpleServiceLocator.connectionManager.getConnectedPipe(getRouter());
if (CRP instanceof IDirectRoutingConnection) {
IDirectRoutingConnection pipe = (IDirectRoutingConnection) CRP;
pipe.addItem(info);
spawnParticle(Particles.OrangeParticle, 4);
}
}
}
}
Aggregations