Search in sources :

Example 6 with IChannelManager

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);
}
Also used : LogisticsSecurityTileEntity(logisticspipes.blocks.LogisticsSecurityTileEntity) IChannelManager(logisticspipes.interfaces.routing.IChannelManager) SecurityChannelManagerGui(logisticspipes.network.guis.block.SecurityChannelManagerGui)

Example 7 with IChannelManager

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);
    }
}
Also used : PipeItemsInvSysConnector(logisticspipes.pipes.PipeItemsInvSysConnector) LogisticsTileGenericPipe(logisticspipes.pipes.basic.LogisticsTileGenericPipe) IChannelManager(logisticspipes.interfaces.routing.IChannelManager) InvSysConSelectChannelPopupGUIProvider(logisticspipes.network.guis.pipe.InvSysConSelectChannelPopupGUIProvider)

Example 8 with IChannelManager

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));
}
Also used : HUDInvSysConnector(logisticspipes.gui.hud.HUDInvSysConnector) InvSysConGuiProvider(logisticspipes.network.guis.pipe.InvSysConGuiProvider) Textures(logisticspipes.textures.Textures) Item(net.minecraft.item.Item) Particles(logisticspipes.pipefxhandlers.Particles) MainProxy(logisticspipes.proxy.MainProxy) IHeadUpDisplayRenderer(logisticspipes.interfaces.IHeadUpDisplayRenderer) PlayerCollectionList(logisticspipes.utils.PlayerCollectionList) HUDStartWatchingPacket(logisticspipes.network.packets.hud.HUDStartWatchingPacket) LogisticsModule(logisticspipes.modules.LogisticsModule) Map(java.util.Map) TransportInvConnection(logisticspipes.transport.TransportInvConnection) LPNeighborTileEntityKt(network.rs485.logisticspipes.connection.LPNeighborTileEntityKt) ChannelInformationPacket(logisticspipes.network.packets.gui.ChannelInformationPacket) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) HUDStopWatchingPacket(logisticspipes.network.packets.hud.HUDStopWatchingPacket) NewGuiHandler(logisticspipes.network.NewGuiHandler) Collection(java.util.Collection) ItemIdentifier(logisticspipes.utils.item.ItemIdentifier) Set(java.util.Set) Triplet(logisticspipes.utils.tuples.Triplet) UUID(java.util.UUID) PacketHandler(logisticspipes.network.PacketHandler) List(java.util.List) IInventoryUtil(logisticspipes.interfaces.IInventoryUtil) SimpleServiceLocator(logisticspipes.proxy.SimpleServiceLocator) OrdererManagerContent(logisticspipes.network.packets.orderer.OrdererManagerContent) EntityPlayer(net.minecraft.entity.player.EntityPlayer) InvSysConResistance(logisticspipes.network.packets.pipe.InvSysConResistance) Pair(logisticspipes.utils.tuples.Pair) Entry(java.util.Map.Entry) CoreRoutedPipe(logisticspipes.pipes.basic.CoreRoutedPipe) Optional(java.util.Optional) ChannelInformation(logisticspipes.routing.channels.ChannelInformation) WorldCoordinatesWrapper(network.rs485.logisticspipes.world.WorldCoordinatesWrapper) HashMap(java.util.HashMap) TreeSet(java.util.TreeSet) ArrayList(java.util.ArrayList) ItemStack(net.minecraft.item.ItemStack) IChannelManager(logisticspipes.interfaces.routing.IChannelManager) IHeadUpDisplayRendererProvider(logisticspipes.interfaces.IHeadUpDisplayRendererProvider) ItemRoutingInformation(logisticspipes.routing.ItemRoutingInformation) LinkedList(java.util.LinkedList) Nonnull(javax.annotation.Nonnull) ITransactor(logisticspipes.utils.transactor.ITransactor) Nullable(javax.annotation.Nullable) Iterator(java.util.Iterator) IGuiOpenControler(logisticspipes.interfaces.IGuiOpenControler) EnumFacing(net.minecraft.util.EnumFacing) TextureType(logisticspipes.textures.Textures.TextureType) ItemIdentifierStack(logisticspipes.utils.item.ItemIdentifierStack) TileEntity(net.minecraft.tileentity.TileEntity) IChannelRoutingConnection(logisticspipes.interfaces.routing.IChannelRoutingConnection) Comparator(java.util.Comparator) IRoutedItem(logisticspipes.logisticspipes.IRoutedItem) IOrderManagerContentReceiver(logisticspipes.interfaces.IOrderManagerContentReceiver) ChannelInformation(logisticspipes.routing.channels.ChannelInformation) IChannelManager(logisticspipes.interfaces.routing.IChannelManager) InvSysConResistance(logisticspipes.network.packets.pipe.InvSysConResistance)

Example 9 with IChannelManager

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));
}
Also used : HUDInvSysConnector(logisticspipes.gui.hud.HUDInvSysConnector) InvSysConGuiProvider(logisticspipes.network.guis.pipe.InvSysConGuiProvider) Textures(logisticspipes.textures.Textures) Item(net.minecraft.item.Item) Particles(logisticspipes.pipefxhandlers.Particles) MainProxy(logisticspipes.proxy.MainProxy) IHeadUpDisplayRenderer(logisticspipes.interfaces.IHeadUpDisplayRenderer) PlayerCollectionList(logisticspipes.utils.PlayerCollectionList) HUDStartWatchingPacket(logisticspipes.network.packets.hud.HUDStartWatchingPacket) LogisticsModule(logisticspipes.modules.LogisticsModule) Map(java.util.Map) TransportInvConnection(logisticspipes.transport.TransportInvConnection) LPNeighborTileEntityKt(network.rs485.logisticspipes.connection.LPNeighborTileEntityKt) ChannelInformationPacket(logisticspipes.network.packets.gui.ChannelInformationPacket) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) HUDStopWatchingPacket(logisticspipes.network.packets.hud.HUDStopWatchingPacket) NewGuiHandler(logisticspipes.network.NewGuiHandler) Collection(java.util.Collection) ItemIdentifier(logisticspipes.utils.item.ItemIdentifier) Set(java.util.Set) Triplet(logisticspipes.utils.tuples.Triplet) UUID(java.util.UUID) PacketHandler(logisticspipes.network.PacketHandler) List(java.util.List) IInventoryUtil(logisticspipes.interfaces.IInventoryUtil) SimpleServiceLocator(logisticspipes.proxy.SimpleServiceLocator) OrdererManagerContent(logisticspipes.network.packets.orderer.OrdererManagerContent) EntityPlayer(net.minecraft.entity.player.EntityPlayer) InvSysConResistance(logisticspipes.network.packets.pipe.InvSysConResistance) Pair(logisticspipes.utils.tuples.Pair) Entry(java.util.Map.Entry) CoreRoutedPipe(logisticspipes.pipes.basic.CoreRoutedPipe) Optional(java.util.Optional) ChannelInformation(logisticspipes.routing.channels.ChannelInformation) WorldCoordinatesWrapper(network.rs485.logisticspipes.world.WorldCoordinatesWrapper) HashMap(java.util.HashMap) TreeSet(java.util.TreeSet) ArrayList(java.util.ArrayList) ItemStack(net.minecraft.item.ItemStack) IChannelManager(logisticspipes.interfaces.routing.IChannelManager) IHeadUpDisplayRendererProvider(logisticspipes.interfaces.IHeadUpDisplayRendererProvider) ItemRoutingInformation(logisticspipes.routing.ItemRoutingInformation) LinkedList(java.util.LinkedList) Nonnull(javax.annotation.Nonnull) ITransactor(logisticspipes.utils.transactor.ITransactor) Nullable(javax.annotation.Nullable) Iterator(java.util.Iterator) IGuiOpenControler(logisticspipes.interfaces.IGuiOpenControler) EnumFacing(net.minecraft.util.EnumFacing) TextureType(logisticspipes.textures.Textures.TextureType) ItemIdentifierStack(logisticspipes.utils.item.ItemIdentifierStack) TileEntity(net.minecraft.tileentity.TileEntity) IChannelRoutingConnection(logisticspipes.interfaces.routing.IChannelRoutingConnection) Comparator(java.util.Comparator) IRoutedItem(logisticspipes.logisticspipes.IRoutedItem) IOrderManagerContentReceiver(logisticspipes.interfaces.IOrderManagerContentReceiver) ChannelInformation(logisticspipes.routing.channels.ChannelInformation) IChannelManager(logisticspipes.interfaces.routing.IChannelManager)

Aggregations

IChannelManager (logisticspipes.interfaces.routing.IChannelManager)9 Optional (java.util.Optional)4 UUID (java.util.UUID)4 SimpleServiceLocator (logisticspipes.proxy.SimpleServiceLocator)4 ChannelInformation (logisticspipes.routing.channels.ChannelInformation)4 EntityPlayer (net.minecraft.entity.player.EntityPlayer)4 NewGuiHandler (logisticspipes.network.NewGuiHandler)3 TileEntity (net.minecraft.tileentity.TileEntity)3 ArrayList (java.util.ArrayList)2 Collection (java.util.Collection)2 Comparator (java.util.Comparator)2 HashMap (java.util.HashMap)2 Iterator (java.util.Iterator)2 LinkedList (java.util.LinkedList)2 List (java.util.List)2 Map (java.util.Map)2 Entry (java.util.Map.Entry)2 Set (java.util.Set)2 TreeSet (java.util.TreeSet)2 Nonnull (javax.annotation.Nonnull)2