use of net.minecraft.client.gui.GuiWorldSelection 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());
}
}
}
use of net.minecraft.client.gui.GuiWorldSelection in project BaseMetals by MinecraftModDevelopmentMods.
the class EventHandler method onUpdate.
/**
* @param event
*/
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onUpdate(final TickEvent.RenderTickEvent event) {
if ((Options.requireMMDOreSpawn()) && (Loader.isModLoaded("orespawn"))) {
return;
}
if (!Options.fallbackOrespawn()) {
return;
}
if (!Options.requireMMDOreSpawn()) {
return;
}
final GuiScreen guiscreen = Minecraft.getMinecraft().currentScreen;
if (guiscreen == null) {
return;
}
final FontRenderer fontRender = Minecraft.getMinecraft().fontRenderer;
final int y = (guiscreen.height / 100) * 2;
int x = (guiscreen.width / 2);
if (guiscreen instanceof GuiMainMenu) {
guiscreen.drawCenteredString(fontRender, "MMD OreSpawn not present, but requested in configuration, using fallback generator!", x, y, 0xffffff00);
} else if (guiscreen instanceof GuiWorldSelection) {
x = 10;
final int widest = fontRender.getStringWidth("This is likely not what you want - try turning off the 'using_orespawn' option");
final int shortest = fontRender.getStringWidth("Fallback Ore Spawn Generator Enabled!");
int wrap = widest + 50;
if ((guiscreen.width / 2) <= wrap) {
wrap = shortest + 50;
}
fontRender.drawSplitString("Fallback Ore Spawn Generator Enabled!\nThis is likely not what you want - try turning off the 'using_orespawn' option\n(or install MMD OreSpawn)", x, y, wrap, 0xFFFFFF00);
}
}
Aggregations