Search in sources :

Example 1 with GuiSlimelingInventory

use of micdoodle8.mods.galacticraft.planets.mars.client.gui.GuiSlimelingInventory in project Galacticraft by micdoodle8.

the class PacketSimpleMars method handleClientSide.

@SideOnly(Side.CLIENT)
@Override
public void handleClientSide(EntityPlayer player) {
    EntityPlayerSP playerBaseClient = null;
    if (player instanceof EntityPlayerSP) {
        playerBaseClient = (EntityPlayerSP) player;
    }
    switch(this.type) {
        case C_OPEN_CUSTOM_GUI:
            int entityID = 0;
            Entity entity = null;
            switch((Integer) this.data.get(1)) {
                case 0:
                    entityID = (Integer) this.data.get(2);
                    entity = player.worldObj.getEntityByID(entityID);
                    if (entity != null && entity instanceof EntitySlimeling) {
                        FMLClientHandler.instance().getClient().displayGuiScreen(new GuiSlimelingInventory(player, (EntitySlimeling) entity));
                    }
                    player.openContainer.windowId = (Integer) this.data.get(0);
                    break;
                case 1:
                    entityID = (Integer) this.data.get(2);
                    entity = player.worldObj.getEntityByID(entityID);
                    if (entity != null && entity instanceof EntityCargoRocket) {
                        FMLClientHandler.instance().getClient().displayGuiScreen(new GuiCargoRocket(player.inventory, (EntityCargoRocket) entity));
                    }
                    player.openContainer.windowId = (Integer) this.data.get(0);
                    break;
            }
            break;
        case C_OPEN_CUSTOM_GUI_TILE:
            BlockPos pos;
            TileEntity tile;
            switch((Integer) this.data.get(1)) {
                case 0:
                    pos = (BlockPos) this.data.get(2);
                    tile = player.worldObj.getTileEntity(pos);
                    if (tile != null && tile instanceof TileEntityLaunchController) {
                        FMLClientHandler.instance().getClient().displayGuiScreen(new GuiLaunchControllerAdvanced(player.inventory, (TileEntityLaunchController) tile));
                    }
                    player.openContainer.windowId = (Integer) this.data.get(0);
                    break;
            }
            break;
        case C_BEGIN_CRYOGENIC_SLEEP:
            pos = (BlockPos) this.data.get(0);
            tile = player.worldObj.getTileEntity(pos);
            if (tile instanceof TileEntityCryogenicChamber) {
                ((TileEntityCryogenicChamber) tile).sleepInBedAt(player, pos.getX(), pos.getY(), pos.getZ());
            }
        default:
            break;
    }
}
Also used : Entity(net.minecraft.entity.Entity) TileEntity(net.minecraft.tileentity.TileEntity) TileEntityCryogenicChamber(micdoodle8.mods.galacticraft.planets.mars.tile.TileEntityCryogenicChamber) GuiLaunchControllerAdvanced(micdoodle8.mods.galacticraft.planets.mars.client.gui.GuiLaunchControllerAdvanced) GuiSlimelingInventory(micdoodle8.mods.galacticraft.planets.mars.client.gui.GuiSlimelingInventory) EntityCargoRocket(micdoodle8.mods.galacticraft.planets.mars.entities.EntityCargoRocket) TileEntity(net.minecraft.tileentity.TileEntity) EntitySlimeling(micdoodle8.mods.galacticraft.planets.mars.entities.EntitySlimeling) BlockPos(net.minecraft.util.BlockPos) GuiCargoRocket(micdoodle8.mods.galacticraft.planets.mars.client.gui.GuiCargoRocket) EntityPlayerSP(net.minecraft.client.entity.EntityPlayerSP) TileEntityLaunchController(micdoodle8.mods.galacticraft.planets.mars.tile.TileEntityLaunchController) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

GuiCargoRocket (micdoodle8.mods.galacticraft.planets.mars.client.gui.GuiCargoRocket)1 GuiLaunchControllerAdvanced (micdoodle8.mods.galacticraft.planets.mars.client.gui.GuiLaunchControllerAdvanced)1 GuiSlimelingInventory (micdoodle8.mods.galacticraft.planets.mars.client.gui.GuiSlimelingInventory)1 EntityCargoRocket (micdoodle8.mods.galacticraft.planets.mars.entities.EntityCargoRocket)1 EntitySlimeling (micdoodle8.mods.galacticraft.planets.mars.entities.EntitySlimeling)1 TileEntityCryogenicChamber (micdoodle8.mods.galacticraft.planets.mars.tile.TileEntityCryogenicChamber)1 TileEntityLaunchController (micdoodle8.mods.galacticraft.planets.mars.tile.TileEntityLaunchController)1 EntityPlayerSP (net.minecraft.client.entity.EntityPlayerSP)1 Entity (net.minecraft.entity.Entity)1 TileEntity (net.minecraft.tileentity.TileEntity)1 BlockPos (net.minecraft.util.BlockPos)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1