Search in sources :

Example 1 with GuiTropicsLoading

use of net.tropicraft.client.gui.GuiTropicsLoading in project Tropicraft by Tropicraft.

the class TropicraftLoadingListener method onOpenGui.

@SubscribeEvent
public void onOpenGui(GuiOpenEvent evt) {
    if (evt.getGui() instanceof GuiDownloadTerrain) {
        if (FMLClientHandler.instance().getClientPlayHandler() instanceof NetHandlerPlayClient) {
            if (mc.player != null) {
                GuiTropicsLoading guiLoading = new GuiTropicsLoading();
                boolean isLeaving = false;
                if (lastDimension != TropicraftWorldUtils.TROPICS_DIMENSION_ID && mc.player.dimension == TropicraftWorldUtils.TROPICS_DIMENSION_ID) {
                    isLeaving = true;
                }
                guiLoading.setLeaving(isLeaving);
                if (wasTropicsInvolved() && isDimensionFarewellAllowed(isLeaving)) {
                    evt.setGui(guiLoading);
                }
            }
        }
    }
}
Also used : GuiDownloadTerrain(net.minecraft.client.gui.GuiDownloadTerrain) NetHandlerPlayClient(net.minecraft.client.network.NetHandlerPlayClient) GuiTropicsLoading(net.tropicraft.client.gui.GuiTropicsLoading) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

GuiDownloadTerrain (net.minecraft.client.gui.GuiDownloadTerrain)1 NetHandlerPlayClient (net.minecraft.client.network.NetHandlerPlayClient)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1 GuiTropicsLoading (net.tropicraft.client.gui.GuiTropicsLoading)1