Search in sources :

Example 6 with LogisticsTileGenericPipe

use of logisticspipes.pipes.basic.LogisticsTileGenericPipe in project LogisticsPipes by RS485.

the class ProviderPipeMode method processPacket.

@Override
public void processPacket(EntityPlayer player) {
    final LogisticsTileGenericPipe pipe = this.getPipe(player.worldObj);
    if (pipe == null) {
        return;
    }
    if (!(pipe.pipe instanceof PipeItemsProviderLogistics)) {
        return;
    }
    ((PipeItemsProviderLogistics) pipe.pipe).setExtractionMode(getInteger());
}
Also used : LogisticsTileGenericPipe(logisticspipes.pipes.basic.LogisticsTileGenericPipe) PipeItemsProviderLogistics(logisticspipes.pipes.PipeItemsProviderLogistics)

Example 7 with LogisticsTileGenericPipe

use of logisticspipes.pipes.basic.LogisticsTileGenericPipe in project LogisticsPipes by RS485.

the class GuiOpenChassie method processPacket.

@Override
public void processPacket(EntityPlayer player) {
    LogisticsTileGenericPipe pipe = this.getPipe(player.getEntityWorld());
    if (!(pipe.pipe instanceof CoreRoutedPipe)) {
        return;
    }
    NewGuiHandler.getGui(ChassiGuiProvider.class).setFlag(((CoreRoutedPipe) pipe.pipe).getUpgradeManager().hasUpgradeModuleUpgrade()).setSlot(ModulePositionType.IN_PIPE).setPositionInt(0).setPosX(getPosX()).setPosY(getPosY()).setPosZ(getPosZ()).open(player);
}
Also used : LogisticsTileGenericPipe(logisticspipes.pipes.basic.LogisticsTileGenericPipe) CoreRoutedPipe(logisticspipes.pipes.basic.CoreRoutedPipe) ChassiGuiProvider(logisticspipes.network.guis.pipe.ChassiGuiProvider)

Example 8 with LogisticsTileGenericPipe

use of logisticspipes.pipes.basic.LogisticsTileGenericPipe in project LogisticsPipes by RS485.

the class ChassiOrientationPacket method processPacket.

@Override
public void processPacket(EntityPlayer player) {
    LogisticsTileGenericPipe pipe = this.getPipe(player.worldObj);
    if (pipe == null || !(pipe.pipe instanceof PipeLogisticsChassi)) {
        return;
    }
    ((PipeLogisticsChassi) pipe.pipe).setClientOrientation(dir);
}
Also used : PipeLogisticsChassi(logisticspipes.pipes.PipeLogisticsChassi) LogisticsTileGenericPipe(logisticspipes.pipes.basic.LogisticsTileGenericPipe)

Example 9 with LogisticsTileGenericPipe

use of logisticspipes.pipes.basic.LogisticsTileGenericPipe in project LogisticsPipes by RS485.

the class EnderIOHyperCubeConnection method transmit.

@Override
public void transmit(TileEntity tile, IRoutedItem data) {
    List<TileEntity> list = getConnections(tile);
    if (list.size() < 1) {
        return;
    }
    TileEntity pipe = list.get(0);
    if (pipe instanceof LogisticsTileGenericPipe) {
        ((CoreRoutedPipe) ((LogisticsTileGenericPipe) pipe).pipe).queueUnroutedItemInformation(data.getItemIdentifierStack().clone(), data.getInfo());
    } else {
        new RuntimeException("Only LP pipes can be next to Tesseracts to queue item information").printStackTrace();
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) LogisticsTileGenericPipe(logisticspipes.pipes.basic.LogisticsTileGenericPipe) CoreRoutedPipe(logisticspipes.pipes.basic.CoreRoutedPipe)

Example 10 with LogisticsTileGenericPipe

use of logisticspipes.pipes.basic.LogisticsTileGenericPipe in project LogisticsPipes by RS485.

the class EnderIOHyperCubeConnection method getConnections.

@Override
public List<TileEntity> getConnections(TileEntity tile) {
    boolean onlyOnePipe = false;
    for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
        DoubleCoordinates p = CoordinateUtils.add(new DoubleCoordinates(tile), direction);
        TileEntity canidate = p.getTileEntity(tile.getWorldObj());
        if (canidate instanceof LogisticsTileGenericPipe && MainProxy.checkPipesConnections(tile, canidate, direction)) {
            if (onlyOnePipe) {
                onlyOnePipe = false;
                break;
            } else {
                onlyOnePipe = true;
            }
        }
    }
    if (!onlyOnePipe || !SimpleServiceLocator.enderIOProxy.isSendAndReceive(tile)) {
        return new ArrayList<>(0);
    }
    List<? extends TileEntity> connections = SimpleServiceLocator.enderIOProxy.getConnectedHyperCubes(tile);
    List<TileEntity> list = new ArrayList<>();
    for (TileEntity connected : connections) {
        if (!SimpleServiceLocator.enderIOProxy.isSendAndReceive(connected)) {
            continue;
        }
        LogisticsTileGenericPipe pipe = null;
        for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) {
            DoubleCoordinates p = CoordinateUtils.add(new DoubleCoordinates(connected), direction);
            TileEntity canidate = p.getTileEntity(tile.getWorldObj());
            if (canidate instanceof LogisticsTileGenericPipe && MainProxy.checkPipesConnections(connected, canidate, direction)) {
                if (pipe != null) {
                    pipe = null;
                    break;
                } else {
                    pipe = (LogisticsTileGenericPipe) canidate;
                }
            }
        }
        if (pipe != null && pipe.pipe instanceof CoreRoutedPipe) {
            list.add(pipe);
        }
    }
    if (list.size() == 1) {
        return list;
    } else {
        return new ArrayList<>(0);
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) ForgeDirection(net.minecraftforge.common.util.ForgeDirection) LogisticsTileGenericPipe(logisticspipes.pipes.basic.LogisticsTileGenericPipe) ArrayList(java.util.ArrayList) CoreRoutedPipe(logisticspipes.pipes.basic.CoreRoutedPipe) DoubleCoordinates(network.rs485.logisticspipes.world.DoubleCoordinates)

Aggregations

LogisticsTileGenericPipe (logisticspipes.pipes.basic.LogisticsTileGenericPipe)115 CoreRoutedPipe (logisticspipes.pipes.basic.CoreRoutedPipe)47 TileEntity (net.minecraft.tileentity.TileEntity)45 DoubleCoordinates (network.rs485.logisticspipes.world.DoubleCoordinates)21 EnumFacing (net.minecraft.util.EnumFacing)15 ArrayList (java.util.ArrayList)14 List (java.util.List)12 EntityPlayer (net.minecraft.entity.player.EntityPlayer)10 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)10 BlockPos (net.minecraft.util.math.BlockPos)10 World (net.minecraft.world.World)9 ForgeDirection (net.minecraftforge.common.util.ForgeDirection)9 HashMap (java.util.HashMap)8 LinkedList (java.util.LinkedList)8 PipeBlockRequestTable (logisticspipes.pipes.PipeBlockRequestTable)8 LogisticsPowerJunctionTileEntity (logisticspipes.blocks.powertile.LogisticsPowerJunctionTileEntity)7 MainProxy (logisticspipes.proxy.MainProxy)7 ExitRoute (logisticspipes.routing.ExitRoute)7 PipeLogisticsChassi (logisticspipes.pipes.PipeLogisticsChassi)6 SimpleServiceLocator (logisticspipes.proxy.SimpleServiceLocator)6