use of logisticspipes.interfaces.routing.IChannelManager in project LogisticsPipes by RS485.
the class OpenSecurityChannelManagerPacket method processPacket.
@Override
public void processPacket(EntityPlayer player) {
LogisticsSecurityTileEntity securityTile = this.getTileAs(player.getEntityWorld(), LogisticsSecurityTileEntity.class);
IChannelManager manager = SimpleServiceLocator.channelManagerProvider.getChannelManager(player.getEntityWorld());
NewGuiHandler.getGui(SecurityChannelManagerGui.class).setChannelInformations(manager.getAllowedChannels(player)).setTilePos(securityTile).open(player);
}
use of logisticspipes.interfaces.routing.IChannelManager in project LogisticsPipes by RS485.
the class InvSysConOpenSelectChannelPopupPacket method processPacket.
@Override
public void processPacket(EntityPlayer player) {
LogisticsTileGenericPipe pipe = this.getPipe(player.getEntityWorld(), LTGPCompletionCheck.PIPE);
if (pipe.pipe instanceof PipeItemsInvSysConnector) {
IChannelManager manager = SimpleServiceLocator.channelManagerProvider.getChannelManager(player.getEntityWorld());
NewGuiHandler.getGui(InvSysConSelectChannelPopupGUIProvider.class).setChannelInformations(manager.getAllowedChannels(player)).setTilePos(pipe).open(player);
}
}
use of logisticspipes.interfaces.routing.IChannelManager in project LogisticsPipes by RS485.
the class PipeItemsInvSysConnector method guiOpenedByPlayer.
@Override
public void guiOpenedByPlayer(EntityPlayer player) {
localGuiWatchers.add(player);
MainProxy.sendPacketToPlayer(PacketHandler.getPacket(InvSysConResistance.class).setInteger(this.resistance).setBlockPos(this.getPos()), player);
IChannelManager manager = SimpleServiceLocator.channelManagerProvider.getChannelManager(this.getWorld());
Optional<ChannelInformation> channel = manager.getChannels().stream().filter(chan -> chan.getChannelIdentifier().equals(getConnectionUUID())).findFirst();
channel.ifPresent(chan -> MainProxy.sendPacketToPlayer(PacketHandler.getPacket(ChannelInformationPacket.class).setInformation(chan).setTargeted(true), player));
}
use of logisticspipes.interfaces.routing.IChannelManager in project LogisticsPipes by RS485.
the class PipeItemsInvSysConnector method sendChannelInformationToPlayers.
private void sendChannelInformationToPlayers() {
IChannelManager manager = SimpleServiceLocator.channelManagerProvider.getChannelManager(this.getWorld());
Optional<ChannelInformation> channel = manager.getChannels().stream().filter(chan -> chan.getChannelIdentifier().equals(getConnectionUUID())).findFirst();
channel.ifPresent(chan -> MainProxy.sendToPlayerList(PacketHandler.getPacket(ChannelInformationPacket.class).setInformation(chan).setTargeted(true), localGuiWatchers));
}
Aggregations