use of logisticspipes.pipes.basic.LogisticsTileGenericPipe in project LogisticsPipes by RS485.
the class ItemBufferSyncPacket method processPacket.
@Override
public void processPacket(EntityPlayer player) {
LogisticsTileGenericPipe pipe = this.getPipe(player.getEntityWorld());
if (pipe == null || pipe.pipe == null || pipe.pipe.transport == null) {
return;
}
pipe.pipe.transport._itemBuffer.clear();
pipe.pipe.transport._itemBuffer.addAll(getList());
}
use of logisticspipes.pipes.basic.LogisticsTileGenericPipe in project LogisticsPipes by RS485.
the class PipeManagerContentPacket method processPacket.
@Override
public void processPacket(EntityPlayer player) {
LogisticsTileGenericPipe pipe = this.getPipe(player.getEntityWorld());
if (pipe == null || !(pipe.pipe instanceof CoreRoutedPipe)) {
return;
}
CoreRoutedPipe cPipe = (CoreRoutedPipe) pipe.pipe;
cPipe.getClientSideOrderManager().clear();
cPipe.getClientSideOrderManager().addAll(clientOrder);
}
use of logisticspipes.pipes.basic.LogisticsTileGenericPipe in project LogisticsPipes by RS485.
the class RequestRoutingLasersPacket method processPacket.
@Override
public void processPacket(EntityPlayer player) {
LogisticsTileGenericPipe tile = this.getPipe(player.world);
if (tile == null) {
return;
}
if (tile.pipe instanceof CoreRoutedPipe) {
IRouter router = ((CoreRoutedPipe) tile.pipe).getRouter();
// this is here to allow players to manually trigger a network-wide LSA update
router.forceLsaUpdate();
List<List<ExitRoute>> exits = router.getRouteTable();
HashMap<EnumFacing, ArrayList<ExitRoute>> routers = new HashMap<>();
for (List<ExitRoute> exit : exits) {
if (exit == null) {
continue;
}
for (ExitRoute e : exit) {
if (!routers.containsKey(e.exitOrientation)) {
routers.put(e.exitOrientation, new ArrayList<>());
}
if (!routers.get(e.exitOrientation).contains(e)) {
routers.get(e.exitOrientation).add(e);
}
}
}
ArrayList<LaserData> lasers = new ArrayList<>();
firstPipe = true;
for (final EnumFacing dir : routers.keySet()) {
if (dir == null) {
continue;
}
handleRouteInDirection(tile, dir, routers.get(dir), lasers, EnumSet.allOf(PipeRoutingConnectionType.class), new Log() {
@Override
void log(String log) {
if (LogisticsPipes.isDEBUG()) {
System.out.println(dir.name() + ": " + log);
}
}
});
}
lasers = compressLasers(lasers);
MainProxy.sendPacketToPlayer(PacketHandler.getPacket(RoutingLaserPacket.class).setLasers(lasers), player);
}
}
use of logisticspipes.pipes.basic.LogisticsTileGenericPipe in project LogisticsPipes by RS485.
the class PipeTileStatePacket method processPacket.
@Override
public void processPacket(EntityPlayer player) {
LogisticsTileGenericPipe pipe = this.getPipe(player.getEntityWorld(), LTGPCompletionCheck.NONE);
if (pipe == null) {
return;
}
if (pipe.statePacketId < statePacketId) {
LPDataIOWrapper.provideData(bytesRenderState, pipe.renderState::readData);
LPDataIOWrapper.provideData(bytesCoreState, pipe.coreState::readData);
pipe.afterStateUpdated();
if (pipe.pipe != null && bytesPipe.length != 0) {
LPDataIOWrapper.provideData(bytesPipe, pipe.pipe::readData);
}
pipe.statePacketId = statePacketId;
}
}
use of logisticspipes.pipes.basic.LogisticsTileGenericPipe in project LogisticsPipes by RS485.
the class RequestSignPacket method processPacket.
@Override
public void processPacket(EntityPlayer player) {
LogisticsTileGenericPipe pipe = this.getPipe(player.getEntityWorld());
if (pipe == null) {
return;
}
((CoreRoutedPipe) pipe.pipe).sendSignData(player, false);
}
Aggregations