Search in sources :

Example 1 with GUIRelayMK2

use of moze_intel.projecte.gameObjs.gui.GUIRelayMK2 in project ProjectE by sinkillerj.

the class GuiHandler method getClientGuiElement.

@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
    TileEntity tile = !ITEM_IDS.contains(ID) ? world.getTileEntity(new BlockPos(x, y, z)) : null;
    // if not a TE, x will hold which hand it came from. 1 for off, 0 otherwise
    EnumHand hand = ITEM_IDS.contains(ID) ? (x == 1 ? EnumHand.OFF_HAND : EnumHand.MAIN_HAND) : null;
    switch(ID) {
        case Constants.ALCH_CHEST_GUI:
            if (tile != null && tile instanceof AlchChestTile)
                return new GUIAlchChest(player.inventory, (AlchChestTile) tile);
            break;
        case Constants.ALCH_BAG_GUI:
            {
                EnumDyeColor color = EnumDyeColor.byMetadata(player.getHeldItem(hand).getItemDamage());
                IItemHandlerModifiable inventory = (IItemHandlerModifiable) player.getCapability(ProjectEAPI.ALCH_BAG_CAPABILITY, null).getBag(color);
                return new GUIAlchChest(player.inventory, hand, inventory);
            }
        case Constants.CONDENSER_GUI:
            if (tile != null && tile instanceof CondenserTile)
                return new GUICondenser(player.inventory, (CondenserTile) tile);
            break;
        case Constants.TRANSMUTE_STONE_GUI:
            return new GUITransmutation(player.inventory, new TransmutationInventory(player), null);
        case Constants.RM_FURNACE_GUI:
            if (tile != null && tile instanceof RMFurnaceTile)
                return new GUIRMFurnace(player.inventory, (RMFurnaceTile) tile);
            break;
        case Constants.DM_FURNACE_GUI:
            if (tile != null && tile instanceof DMFurnaceTile)
                return new GUIDMFurnace(player.inventory, (DMFurnaceTile) tile);
            break;
        case Constants.COLLECTOR1_GUI:
            if (tile != null && tile instanceof CollectorMK1Tile)
                return new GUICollectorMK1(player.inventory, (CollectorMK1Tile) tile);
            break;
        case Constants.COLLECTOR2_GUI:
            if (tile != null && tile instanceof CollectorMK2Tile)
                return new GUICollectorMK2(player.inventory, (CollectorMK2Tile) tile);
            break;
        case Constants.COLLECTOR3_GUI:
            if (tile != null && tile instanceof CollectorMK3Tile)
                return new GUICollectorMK3(player.inventory, (CollectorMK3Tile) tile);
            break;
        case Constants.RELAY1_GUI:
            if (tile != null && tile instanceof RelayMK1Tile)
                return new GUIRelayMK1(player.inventory, (RelayMK1Tile) tile);
            break;
        case Constants.RELAY2_GUI:
            if (tile != null && tile instanceof RelayMK2Tile)
                return new GUIRelayMK2(player.inventory, (RelayMK2Tile) tile);
            break;
        case Constants.RELAY3_GUI:
            if (tile != null && tile instanceof RelayMK3Tile)
                return new GUIRelayMK3(player.inventory, (RelayMK3Tile) tile);
            break;
        case Constants.MERCURIAL_GUI:
            return new GUIMercurialEye(player.inventory, new MercurialEyeInventory(player.getHeldItem(hand)));
        case Constants.PHILOS_STONE_GUI:
            return new GUIPhilosStone(player.inventory);
        case Constants.TRANSMUTATION_GUI:
            return new GUITransmutation(player.inventory, new TransmutationInventory(player), hand);
        case Constants.ETERNAL_DENSITY_GUI:
            return new GUIEternalDensity(player.inventory, new EternalDensityInventory(player.getHeldItem(hand), player));
        case Constants.CONDENSER_MK2_GUI:
            return new GUICondenserMK2(player.inventory, (CondenserMK2Tile) tile);
    }
    return null;
}
Also used : AlchChestTile(moze_intel.projecte.gameObjs.tiles.AlchChestTile) GUIRMFurnace(moze_intel.projecte.gameObjs.gui.GUIRMFurnace) GUITransmutation(moze_intel.projecte.gameObjs.gui.GUITransmutation) GUIMercurialEye(moze_intel.projecte.gameObjs.gui.GUIMercurialEye) CollectorMK3Tile(moze_intel.projecte.gameObjs.tiles.CollectorMK3Tile) RelayMK2Tile(moze_intel.projecte.gameObjs.tiles.RelayMK2Tile) TileEntity(net.minecraft.tileentity.TileEntity) GUIAlchChest(moze_intel.projecte.gameObjs.gui.GUIAlchChest) IItemHandlerModifiable(net.minecraftforge.items.IItemHandlerModifiable) TransmutationInventory(moze_intel.projecte.gameObjs.container.inventory.TransmutationInventory) EnumHand(net.minecraft.util.EnumHand) GUIEternalDensity(moze_intel.projecte.gameObjs.gui.GUIEternalDensity) CondenserTile(moze_intel.projecte.gameObjs.tiles.CondenserTile) MercurialEyeInventory(moze_intel.projecte.gameObjs.container.inventory.MercurialEyeInventory) CollectorMK2Tile(moze_intel.projecte.gameObjs.tiles.CollectorMK2Tile) BlockPos(net.minecraft.util.math.BlockPos) GUICondenser(moze_intel.projecte.gameObjs.gui.GUICondenser) RelayMK1Tile(moze_intel.projecte.gameObjs.tiles.RelayMK1Tile) GUICollectorMK1(moze_intel.projecte.gameObjs.gui.GUICollectorMK1) GUICollectorMK2(moze_intel.projecte.gameObjs.gui.GUICollectorMK2) GUICollectorMK3(moze_intel.projecte.gameObjs.gui.GUICollectorMK3) EternalDensityInventory(moze_intel.projecte.gameObjs.container.inventory.EternalDensityInventory) GUIPhilosStone(moze_intel.projecte.gameObjs.gui.GUIPhilosStone) GUICondenserMK2(moze_intel.projecte.gameObjs.gui.GUICondenserMK2) DMFurnaceTile(moze_intel.projecte.gameObjs.tiles.DMFurnaceTile) CollectorMK1Tile(moze_intel.projecte.gameObjs.tiles.CollectorMK1Tile) EnumDyeColor(net.minecraft.item.EnumDyeColor) RMFurnaceTile(moze_intel.projecte.gameObjs.tiles.RMFurnaceTile) GUIDMFurnace(moze_intel.projecte.gameObjs.gui.GUIDMFurnace) GUIRelayMK1(moze_intel.projecte.gameObjs.gui.GUIRelayMK1) RelayMK3Tile(moze_intel.projecte.gameObjs.tiles.RelayMK3Tile) GUIRelayMK2(moze_intel.projecte.gameObjs.gui.GUIRelayMK2) GUIRelayMK3(moze_intel.projecte.gameObjs.gui.GUIRelayMK3)

Aggregations

EternalDensityInventory (moze_intel.projecte.gameObjs.container.inventory.EternalDensityInventory)1 MercurialEyeInventory (moze_intel.projecte.gameObjs.container.inventory.MercurialEyeInventory)1 TransmutationInventory (moze_intel.projecte.gameObjs.container.inventory.TransmutationInventory)1 GUIAlchChest (moze_intel.projecte.gameObjs.gui.GUIAlchChest)1 GUICollectorMK1 (moze_intel.projecte.gameObjs.gui.GUICollectorMK1)1 GUICollectorMK2 (moze_intel.projecte.gameObjs.gui.GUICollectorMK2)1 GUICollectorMK3 (moze_intel.projecte.gameObjs.gui.GUICollectorMK3)1 GUICondenser (moze_intel.projecte.gameObjs.gui.GUICondenser)1 GUICondenserMK2 (moze_intel.projecte.gameObjs.gui.GUICondenserMK2)1 GUIDMFurnace (moze_intel.projecte.gameObjs.gui.GUIDMFurnace)1 GUIEternalDensity (moze_intel.projecte.gameObjs.gui.GUIEternalDensity)1 GUIMercurialEye (moze_intel.projecte.gameObjs.gui.GUIMercurialEye)1 GUIPhilosStone (moze_intel.projecte.gameObjs.gui.GUIPhilosStone)1 GUIRMFurnace (moze_intel.projecte.gameObjs.gui.GUIRMFurnace)1 GUIRelayMK1 (moze_intel.projecte.gameObjs.gui.GUIRelayMK1)1 GUIRelayMK2 (moze_intel.projecte.gameObjs.gui.GUIRelayMK2)1 GUIRelayMK3 (moze_intel.projecte.gameObjs.gui.GUIRelayMK3)1 GUITransmutation (moze_intel.projecte.gameObjs.gui.GUITransmutation)1 AlchChestTile (moze_intel.projecte.gameObjs.tiles.AlchChestTile)1 CollectorMK1Tile (moze_intel.projecte.gameObjs.tiles.CollectorMK1Tile)1