Search in sources :

Example 1 with UpgradeCoordinatesGuiProvider

use of logisticspipes.network.abstractguis.UpgradeCoordinatesGuiProvider in project LogisticsPipes by RS485.

the class OpenUpgradePacket method processPacket.

@Override
public void processPacket(EntityPlayer player) {
    UpgradeSlot slot = getSlot(player, UpgradeSlot.class);
    IPipeUpgrade upgrade = slot.getUpgrade();
    if (upgrade instanceof IConfigPipeUpgrade) {
        UpgradeCoordinatesGuiProvider gui = ((IConfigPipeUpgrade) upgrade).getGUI();
        if (gui != null) {
            gui.setSlot(slot).setLPPos(slot.getManager().getPipePosition()).open(player);
        }
    }
}
Also used : UpgradeCoordinatesGuiProvider(logisticspipes.network.abstractguis.UpgradeCoordinatesGuiProvider) IPipeUpgrade(logisticspipes.pipes.upgrades.IPipeUpgrade) IConfigPipeUpgrade(logisticspipes.pipes.upgrades.IConfigPipeUpgrade) UpgradeSlot(logisticspipes.utils.gui.UpgradeSlot)

Aggregations

UpgradeCoordinatesGuiProvider (logisticspipes.network.abstractguis.UpgradeCoordinatesGuiProvider)1 IConfigPipeUpgrade (logisticspipes.pipes.upgrades.IConfigPipeUpgrade)1 IPipeUpgrade (logisticspipes.pipes.upgrades.IPipeUpgrade)1 UpgradeSlot (logisticspipes.utils.gui.UpgradeSlot)1