Search in sources :

Example 1 with ChassisOrientationPacket

use of logisticspipes.network.packets.pipe.ChassisOrientationPacket in project LogisticsPipes by RS485.

the class PipeLogisticsChassis method nextOrientation.

@Override
public void nextOrientation() {
    final SingleAdjacent pointedAdjacent = this.pointedAdjacent;
    Pair<NeighborTileEntity<TileEntity>, ConnectionType> newNeighbor;
    if (pointedAdjacent == null) {
        newNeighbor = nextPointedOrientation(null);
    } else {
        newNeighbor = nextPointedOrientation(pointedAdjacent.getDir());
    }
    final ChassisOrientationPacket packet = PacketHandler.getPacket(ChassisOrientationPacket.class);
    if (newNeighbor == null) {
        this.pointedAdjacent = null;
        packet.setDir(null);
    } else {
        this.pointedAdjacent = new SingleAdjacent(this, newNeighbor.getValue1().getDirection(), newNeighbor.getValue2());
        packet.setDir(newNeighbor.getValue1().getDirection());
    }
    MainProxy.sendPacketToAllWatchingChunk(_module, packet.setTilePos(container));
    refreshRender(true);
}
Also used : RequestChassisOrientationPacket(logisticspipes.network.packets.pipe.RequestChassisOrientationPacket) ChassisOrientationPacket(logisticspipes.network.packets.pipe.ChassisOrientationPacket) ConnectionType(network.rs485.logisticspipes.connection.ConnectionType) NeighborTileEntity(network.rs485.logisticspipes.connection.NeighborTileEntity) SingleAdjacent(network.rs485.logisticspipes.connection.SingleAdjacent)

Aggregations

ChassisOrientationPacket (logisticspipes.network.packets.pipe.ChassisOrientationPacket)1 RequestChassisOrientationPacket (logisticspipes.network.packets.pipe.RequestChassisOrientationPacket)1 ConnectionType (network.rs485.logisticspipes.connection.ConnectionType)1 NeighborTileEntity (network.rs485.logisticspipes.connection.NeighborTileEntity)1 SingleAdjacent (network.rs485.logisticspipes.connection.SingleAdjacent)1