Search in sources :

Example 1 with GuiRegeneration

use of cavern.client.gui.GuiRegeneration in project Cavern2 by kegare.

the class RegenerationGuiMessage method process.

@SideOnly(Side.CLIENT)
@Override
public IMessage process(Minecraft mc) {
    EnumType actionType = EnumType.values()[type];
    boolean isOpen = mc.currentScreen != null && mc.currentScreen instanceof GuiRegeneration;
    if (actionType == EnumType.OPEN) {
        if (!isOpen) {
            mc.displayGuiScreen(new GuiRegeneration());
        }
    } else if (isOpen) {
        ((GuiRegeneration) mc.currentScreen).updateProgress(actionType);
    }
    return null;
}
Also used : GuiRegeneration(cavern.client.gui.GuiRegeneration) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 2 with GuiRegeneration

use of cavern.client.gui.GuiRegeneration in project Cavern2 by kegare.

the class BlockPortalMirageWorlds method openRegeneration.

@SideOnly(Side.CLIENT)
@Override
public void openRegeneration(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side) {
    GuiRegeneration regeneration = new GuiRegeneration();
    DimensionType type = getDimension(player.getHeldItem(hand));
    if (type != null) {
        regeneration.dimensions.add(type);
    }
    FMLClientHandler.instance().showGuiScreen(regeneration);
}
Also used : DimensionType(net.minecraft.world.DimensionType) GuiRegeneration(cavern.client.gui.GuiRegeneration) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 3 with GuiRegeneration

use of cavern.client.gui.GuiRegeneration in project Cavern2 by kegare.

the class BlockPortalCavern method openRegeneration.

@SideOnly(Side.CLIENT)
public void openRegeneration(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing side) {
    GuiRegeneration regeneration = new GuiRegeneration();
    regeneration.dimensions.add(getDimension());
    FMLClientHandler.instance().showGuiScreen(regeneration);
}
Also used : GuiRegeneration(cavern.client.gui.GuiRegeneration) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

GuiRegeneration (cavern.client.gui.GuiRegeneration)3 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)3 DimensionType (net.minecraft.world.DimensionType)1