Search in sources :

Example 1 with GuiLoadCaveTerrain

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

the class ClientEventHooks method onGuiOpen.

@SubscribeEvent
public void onGuiOpen(GuiOpenEvent event) {
    Minecraft mc = FMLClientHandler.instance().getClient();
    GuiScreen gui = event.getGui();
    if (gui != null && GuiModList.class == gui.getClass()) {
        String desc = I18n.format("cavern.description");
        if (!Strings.isNullOrEmpty(desc)) {
            Cavern.metadata.description = desc;
        }
    } else if (DisplayConfig.customLoadingScreen && CavernAPI.dimension.isInCaveDimensions(mc.player) && (mc.currentScreen == null || !(mc.currentScreen instanceof GuiWorldSelection))) {
        if (gui == null) {
            if (mc.currentScreen != null && GuiDownloadCaveTerrain.class == mc.currentScreen.getClass()) {
                event.setGui(new GuiLoadCaveTerrain());
            }
        } else if (GuiDownloadTerrain.class == gui.getClass()) {
            event.setGui(new GuiDownloadCaveTerrain());
        }
    }
}
Also used : GuiLoadCaveTerrain(cavern.client.gui.GuiLoadCaveTerrain) GuiWorldSelection(net.minecraft.client.gui.GuiWorldSelection) GuiDownloadCaveTerrain(cavern.client.gui.GuiDownloadCaveTerrain) GuiScreen(net.minecraft.client.gui.GuiScreen) GuiModList(net.minecraftforge.fml.client.GuiModList) TextComponentString(net.minecraft.util.text.TextComponentString) Minecraft(net.minecraft.client.Minecraft) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

GuiDownloadCaveTerrain (cavern.client.gui.GuiDownloadCaveTerrain)1 GuiLoadCaveTerrain (cavern.client.gui.GuiLoadCaveTerrain)1 Minecraft (net.minecraft.client.Minecraft)1 GuiScreen (net.minecraft.client.gui.GuiScreen)1 GuiWorldSelection (net.minecraft.client.gui.GuiWorldSelection)1 TextComponentString (net.minecraft.util.text.TextComponentString)1 GuiModList (net.minecraftforge.fml.client.GuiModList)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1