Search in sources :

Example 1 with SneakyConfigurationPopup

use of logisticspipes.gui.popup.SneakyConfigurationPopup in project LogisticsPipes by RS485.

the class SneakyUpgradeConfigGuiProvider method getClientGui.

@Override
public Object getClientGui(EntityPlayer player) {
    LogisticsTileGenericPipe bPipe = getTileAs(player.world, LogisticsTileGenericPipe.class);
    if (!(bPipe.pipe instanceof CoreRoutedPipe)) {
        return null;
    }
    List<DoubleCoordinates> list = new WorldCoordinatesWrapper(bPipe).connectedTileEntities().stream().filter(in -> SimpleServiceLocator.pipeInformationManager.isNotAPipe(in.getTileEntity())).map(in -> new DoubleCoordinates(in.getTileEntity())).collect(Collectors.toList());
    if (list.isEmpty()) {
        list = new WorldCoordinatesWrapper(bPipe).connectedTileEntities().stream().map(in -> new DoubleCoordinates(in.getTileEntity())).collect(Collectors.toList());
    }
    return new SneakyConfigurationPopup(list, getSlot(player, UpgradeSlot.class));
}
Also used : UpgradeSlot(logisticspipes.utils.gui.UpgradeSlot) UpgradeCoordinatesGuiProvider(logisticspipes.network.abstractguis.UpgradeCoordinatesGuiProvider) LogisticsTileGenericPipe(logisticspipes.pipes.basic.LogisticsTileGenericPipe) Collectors(java.util.stream.Collectors) GuiProvider(logisticspipes.network.abstractguis.GuiProvider) DoubleCoordinates(network.rs485.logisticspipes.world.DoubleCoordinates) List(java.util.List) SimpleServiceLocator(logisticspipes.proxy.SimpleServiceLocator) EntityPlayer(net.minecraft.entity.player.EntityPlayer) CoreRoutedPipe(logisticspipes.pipes.basic.CoreRoutedPipe) StaticResolve(logisticspipes.utils.StaticResolve) WorldCoordinatesWrapper(network.rs485.logisticspipes.world.WorldCoordinatesWrapper) SneakyConfigurationPopup(logisticspipes.gui.popup.SneakyConfigurationPopup) LogisticsTileGenericPipe(logisticspipes.pipes.basic.LogisticsTileGenericPipe) CoreRoutedPipe(logisticspipes.pipes.basic.CoreRoutedPipe) SneakyConfigurationPopup(logisticspipes.gui.popup.SneakyConfigurationPopup) WorldCoordinatesWrapper(network.rs485.logisticspipes.world.WorldCoordinatesWrapper) DoubleCoordinates(network.rs485.logisticspipes.world.DoubleCoordinates) UpgradeSlot(logisticspipes.utils.gui.UpgradeSlot)

Aggregations

List (java.util.List)1 Collectors (java.util.stream.Collectors)1 SneakyConfigurationPopup (logisticspipes.gui.popup.SneakyConfigurationPopup)1 GuiProvider (logisticspipes.network.abstractguis.GuiProvider)1 UpgradeCoordinatesGuiProvider (logisticspipes.network.abstractguis.UpgradeCoordinatesGuiProvider)1 CoreRoutedPipe (logisticspipes.pipes.basic.CoreRoutedPipe)1 LogisticsTileGenericPipe (logisticspipes.pipes.basic.LogisticsTileGenericPipe)1 SimpleServiceLocator (logisticspipes.proxy.SimpleServiceLocator)1 StaticResolve (logisticspipes.utils.StaticResolve)1 UpgradeSlot (logisticspipes.utils.gui.UpgradeSlot)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 DoubleCoordinates (network.rs485.logisticspipes.world.DoubleCoordinates)1 WorldCoordinatesWrapper (network.rs485.logisticspipes.world.WorldCoordinatesWrapper)1