Java Examples for net.minecraft.client.gui.GuiOptions
The following java examples will help you to understand the usage of net.minecraft.client.gui.GuiOptions. These source code samples are taken from different open source projects.
Example 1
Project: TwitchNotifier-master File: GuiEvents.java View source code |
@SubscribeEvent
public void onButtonClickPost(GuiScreenEvent.ActionPerformedEvent.Post event) {
if (event.getGui() instanceof GuiOptions) {
if (event.getButton().id == 1725) {
try {
IModGuiFactory guiFactory = FMLClientHandler.instance().getGuiFactoryFor(Loader.instance().getIndexedModList().get(Reference.MOD_ID));
GuiScreen newScreen = guiFactory.mainConfigGuiClass().getConstructor(GuiScreen.class).newInstance(event.getGui());
event.getGui().mc.displayGuiScreen(newScreen);
} catch (Exception ex) {
}
}
}
}
Example 2
Project: Obsidian-master File: ObsidianMainMenu.java View source code |
@Override
protected void actionPerformed(GuiButton button) {
switch(button.id) {
case // Singleplayer
1:
RenderUtil.MINECRAFT.displayGuiScreen(new GuiSelectWorld(this));
break;
case // Multiplayer
2:
RenderUtil.MINECRAFT.displayGuiScreen(new GuiMultiplayer(this));
break;
case // Options
3:
RenderUtil.MINECRAFT.displayGuiScreen(new GuiOptions(this, RenderUtil.MINECRAFT.gameSettings));
break;
case // Mods
4:
RenderUtil.MINECRAFT.displayGuiScreen(new GuiModList(this));
break;
case // Addons
5:
break;
case // Quit
6:
RenderUtil.MINECRAFT.shutdown();
}
}
Example 3
Project: ARKCraft-Code-master File: GuiMainMenuOverride.java View source code |
protected void actionPerformed(GuiButton button) throws IOException {
if (button.id == 0) {
this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
}
if (button.id == 5) {
this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings, this.mc.getLanguageManager()));
}
if (button.id == 1) {
this.mc.displayGuiScreen(new GuiSelectWorld(this));
}
if (button.id == 2) {
this.mc.displayGuiScreen(new GuiMultiplayer(this));
}
if (button.id == 14 && this.realmsButton.visible) {
this.switchToRealms();
}
if (button.id == 4) {
this.mc.shutdown();
}
if (button.id == 6) {
this.mc.displayGuiScreen(new net.minecraftforge.fml.client.GuiModList(this));
}
if (button.id == 11) {
this.mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings);
}
if (button.id == 12) {
ISaveFormat isaveformat = this.mc.getSaveLoader();
WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World");
if (worldinfo != null) {
GuiYesNo guiyesno = GuiSelectWorld.func_152129_a(this, worldinfo.getWorldName(), 12);
this.mc.displayGuiScreen(guiyesno);
}
}
}
Example 4
Project: GalacticFrontier-master File: MainMenu.java View source code |
protected void actionPerformed(GuiButton Button) {
int idSettings = 0;
int idSingleplayer = 1;
int idMultiplayer = 2;
int idShutdown = 4;
int idLanguage = 5;
int idModlist = 6;
int idDemoWorld = 11;
int idRealms = 14;
if (Button.id == idSettings) {
this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
}
if (Button.id == idLanguage) {
this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings, this.mc.getLanguageManager()));
}
if (Button.id == idSingleplayer) {
this.mc.displayGuiScreen(new GuiSelectWorld(this));
}
if (Button.id == idMultiplayer) {
this.mc.displayGuiScreen(new GuiMultiplayer(this));
}
if (Button.id == idRealms) {
this.startRealms();
}
if (Button.id == idShutdown) {
this.mc.shutdown();
}
if (Button.id == idModlist) {
this.mc.displayGuiScreen(new GuiModList(this));
}
if (Button.id == idDemoWorld) {
this.mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings);
}
// TODO FIGURE THIS OUT?
if (Button.id == 12) {
ISaveFormat isaveformat = this.mc.getSaveLoader();
WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World");
if (worldinfo != null) {
GuiYesNo guiyesno = GuiSelectWorld.func_152129_a((GuiYesNoCallback) this, worldinfo.getWorldName(), 12);
this.mc.displayGuiScreen(guiyesno);
}
}
}
Example 5
Project: DynamicMappings-master File: ClientMappings.java View source code |
@Mapping(provides = { "net/minecraft/client/gui/GuiOptions", "net/minecraft/client/gui/GuiLanguage", "net/minecraft/client/gui/GuiSelectWorld", "net/minecraft/client/gui/GuiMultiplayer", "net/minecraft/client/gui/GuiYesNo" }, dependsMethods = "net/minecraft/client/gui/GuiScreen actionPerformed (Lnet/minecraft/client/gui/GuiButton;)V", depends = { "net/minecraft/client/gui/GuiScreen", "net/minecraft/client/gui/GuiMainMenu" }) public boolean discoverGuiClasses() { ClassNode guiScreen = getClassNodeFromMapping("net/minecraft/client/gui/GuiScreen"); ClassNode guiMainMenu = getClassNodeFromMapping("net/minecraft/client/gui/GuiMainMenu"); if (guiScreen == null || guiMainMenu == null) return false; MethodNode actionPerformed = getMethodNodeFromMapping(guiMainMenu, "net/minecraft/client/gui/GuiScreen actionPerformed (Lnet/minecraft/client/gui/GuiButton;)V"); if (actionPerformed == null) return false; ClassNode guiOptions = null; ClassNode guiLanguage = null; ClassNode guiSelectWorld = null; ClassNode guiMultiplayer = null; ClassNode guiYesNo = null; List<TypeInsnNode> nodes = getAllInsnNodesOfType(actionPerformed.instructions.getFirst(), TypeInsnNode.class); for (TypeInsnNode node : nodes) { if (node.desc.startsWith("java")) continue; ClassNode cn = getClassNode(node.desc); if (cn == null) continue; if (!cn.superName.equals(guiScreen.name)) continue; if (guiOptions == null && searchConstantPoolForStrings(node.desc, "Options", "options.title", "options.video")) { addClassMapping("net/minecraft/client/gui/GuiOptions", node.desc); guiOptions = cn; } if (guiLanguage == null && searchConstantPoolForStrings(node.desc, "options.language", "options.languageWarning")) { addClassMapping("net/minecraft/client/gui/GuiLanguage", node.desc); guiLanguage = cn; } if (guiSelectWorld == null && searchConstantPoolForStrings(node.desc, "Select world", "selectWorld.title")) { addClassMapping("net/minecraft/client/gui/GuiSelectWorld", node.desc); guiSelectWorld = cn; } if (guiMultiplayer == null && searchConstantPoolForStrings(node.desc, "Unable to start LAN server detection: {}", "selectServer.edit")) { addClassMapping("net/minecraft/client/gui/GuiMultiplayer", node.desc); guiMultiplayer = cn; } if (guiYesNo == null && searchConstantPoolForStrings(node.desc, "gui.yes", "gui.no")) { addClassMapping("net/minecraft/client/gui/GuiYesNo", node.desc); guiYesNo = cn; } } return true; }
Example 6
Project: Glass-Pane-master File: GlassPaneTestHarness.java View source code |
@EventHandler
public void onInit(FMLInitializationEvent e) {
new PaneHarnessOptionsOverlay().autoOverlay(GuiOptions.class);
}
Example 7
Project: TimesOreForge-master File: KeyboardHandler.java View source code |
@Override
public void keyDown(EnumSet<TickType> types, KeyBinding kb, boolean tickEnd, boolean isRepeat) {
if (!(Minecraft.getMinecraft().currentScreen instanceof GuiOptions))
return;
if (kb.keyCode == this.getKeyBindings()[0].keyCode) {
Minecraft.getMinecraft().displayGuiScreen(new GuiSetting());
}
}