Search in sources :

Example 6 with LogisticsTileGenericSubMultiBlock

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

the class MultiBlockCoordinatesPacket method processPacket.

@Override
public void processPacket(EntityPlayer player) {
    LogisticsTileGenericSubMultiBlock block = this.getTile(player.getEntityWorld(), LogisticsTileGenericSubMultiBlock.class);
    block.setPosition(targetPos, subTypes);
}
Also used : LogisticsTileGenericSubMultiBlock(logisticspipes.pipes.basic.LogisticsTileGenericSubMultiBlock)

Example 7 with LogisticsTileGenericSubMultiBlock

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

the class HSTubeSCurve method getConnectedEndTile.

@Override
public TileEntity getConnectedEndTile(ForgeDirection output) {
    boolean useOwn;
    if (orientation.getOffset().getLength() != 0) {
        if (orientation.dir.getOpposite() == output) {
            useOwn = false;
        } else if (orientation.dir == output) {
            useOwn = true;
        } else {
            return null;
        }
    } else {
        if (orientation.dir.getOpposite() == output) {
            useOwn = true;
        } else if (orientation.dir == output) {
            useOwn = false;
        } else {
            return null;
        }
    }
    if (useOwn) {
        return container.getTile(output);
    } else {
        DoubleCoordinates pos = new DoubleCoordinates(1, 0, -3);
        LPPositionSet<DoubleCoordinates> set = new LPPositionSet<>(DoubleCoordinates.class);
        set.add(pos);
        orientation.rotatePositions(set);
        TileEntity subTile = pos.add(getLPPosition()).getTileEntity(getWorld());
        if (subTile instanceof LogisticsTileGenericSubMultiBlock) {
            return ((LogisticsTileGenericSubMultiBlock) subTile).getTile(output);
        }
    }
    return null;
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) LPPositionSet(logisticspipes.utils.LPPositionSet) LogisticsTileGenericSubMultiBlock(logisticspipes.pipes.basic.LogisticsTileGenericSubMultiBlock) DoubleCoordinates(network.rs485.logisticspipes.world.DoubleCoordinates)

Example 8 with LogisticsTileGenericSubMultiBlock

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

the class HSTubeGain method getConnectedEndTile.

@Override
public TileEntity getConnectedEndTile(ForgeDirection output) {
    if (orientation.dir.getOpposite() == output) {
        return container.getTile(output);
    } else {
        DoubleCoordinates pos = new DoubleCoordinates(0, 1, -3);
        LPPositionSet<DoubleCoordinates> set = new LPPositionSet<>(DoubleCoordinates.class);
        set.add(pos);
        orientation.rotatePositions(set);
        TileEntity subTile = pos.add(getLPPosition()).getTileEntity(getWorld());
        if (subTile instanceof LogisticsTileGenericSubMultiBlock) {
            return ((LogisticsTileGenericSubMultiBlock) subTile).getTile(output);
        }
    }
    return null;
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) LPPositionSet(logisticspipes.utils.LPPositionSet) LogisticsTileGenericSubMultiBlock(logisticspipes.pipes.basic.LogisticsTileGenericSubMultiBlock) DoubleCoordinates(network.rs485.logisticspipes.world.DoubleCoordinates)

Example 9 with LogisticsTileGenericSubMultiBlock

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

the class LogisticsPipeWorldRenderer method renderWorldBlock.

@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
    TileEntity tile = world.getTileEntity(x, y, z);
    if (tile instanceof LogisticsTileGenericPipe) {
        LogisticsTileGenericPipe pipeTile = (LogisticsTileGenericPipe) tile;
        SimpleServiceLocator.thermalDynamicsProxy.renderPipeConnections(pipeTile, renderer);
        if (config.isUseNewRenderer() && !pipeTile.renderState.forceRenderOldPipe) {
            return newRenderer.renderWorldBlock(world, x, y, z, block, modelId, renderer);
        }
        return LogisticsPipeWorldRenderer.renderPipe(renderer, world, (LogisticsBlockGenericPipe) block, pipeTile, x, y, z);
    } else if (tile instanceof LogisticsTileGenericSubMultiBlock) {
        renderer.setRenderBounds(0, 0, 0, 0, 0, 0);
        renderer.renderStandardBlock(Blocks.stone, x, y, z);
        renderer.setRenderBoundsFromBlock(block);
        return true;
    } else {
        return false;
    }
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) LogisticsTileGenericSubMultiBlock(logisticspipes.pipes.basic.LogisticsTileGenericSubMultiBlock) LogisticsTileGenericPipe(logisticspipes.pipes.basic.LogisticsTileGenericPipe)

Example 10 with LogisticsTileGenericSubMultiBlock

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

the class PipeMultiBlockTransportLogistics method handleTileReachedClient.

@Override
protected void handleTileReachedClient(LPTravelingItemClient arrivingItem, TileEntity tile, ForgeDirection dir) {
    if (tile instanceof LogisticsTileGenericPipe && ((LogisticsTileGenericPipe) tile).pipe instanceof CoreMultiBlockPipe) {
        passToNextPipe(arrivingItem, tile);
        return;
    } else if (tile instanceof LogisticsTileGenericSubMultiBlock) {
        List<LogisticsTileGenericPipe> masterTile = ((LogisticsTileGenericSubMultiBlock) tile).getMainPipe();
        if (!masterTile.isEmpty()) {
            if (masterTile.size() > 1) {
                throw new UnsupportedOperationException();
            }
            passToNextPipe(arrivingItem, masterTile.get(0));
            return;
        }
    }
    Explosion explosion = new Explosion(this.getWorld(), null, this.getPipe().getX(), this.getPipe().getY(), this.getPipe().getZ(), 4.0F);
    explosion.isFlaming = false;
    explosion.isSmoking = true;
    explosion.doExplosionB(true);
}
Also used : Explosion(net.minecraft.world.Explosion) CoreMultiBlockPipe(logisticspipes.pipes.basic.CoreMultiBlockPipe) LogisticsTileGenericSubMultiBlock(logisticspipes.pipes.basic.LogisticsTileGenericSubMultiBlock) LogisticsTileGenericPipe(logisticspipes.pipes.basic.LogisticsTileGenericPipe) List(java.util.List)

Aggregations

LogisticsTileGenericSubMultiBlock (logisticspipes.pipes.basic.LogisticsTileGenericSubMultiBlock)10 TileEntity (net.minecraft.tileentity.TileEntity)7 LPPositionSet (logisticspipes.utils.LPPositionSet)6 DoubleCoordinates (network.rs485.logisticspipes.world.DoubleCoordinates)6 CoreMultiBlockPipe (logisticspipes.pipes.basic.CoreMultiBlockPipe)4 List (java.util.List)3 LogisticsTileGenericPipe (logisticspipes.pipes.basic.LogisticsTileGenericPipe)3 LogisticsPipes (logisticspipes.LogisticsPipes)2 ITubeOrientation (logisticspipes.interfaces.ITubeOrientation)2 CoreUnroutedPipe (logisticspipes.pipes.basic.CoreUnroutedPipe)2 Block (net.minecraft.block.Block)2 EntityPlayer (net.minecraft.entity.player.EntityPlayer)2 Blocks (net.minecraft.init.Blocks)2 ItemStack (net.minecraft.item.ItemStack)2 Explosion (net.minecraft.world.Explosion)2 World (net.minecraft.world.World)2 CoordinateUtils (network.rs485.logisticspipes.world.CoordinateUtils)2 DoubleCoordinatesType (network.rs485.logisticspipes.world.DoubleCoordinatesType)2 CCRenderState (codechicken.lib.render.CCRenderState)1 FMLClientHandler (cpw.mods.fml.client.FMLClientHandler)1