本文整理汇总了Java中net.minecraft.client.gui.GuiCreateWorld类的典型用法代码示例。如果您正苦于以下问题:Java GuiCreateWorld类的具体用法?Java GuiCreateWorld怎么用?Java GuiCreateWorld使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GuiCreateWorld类属于net.minecraft.client.gui包,在下文中一共展示了GuiCreateWorld类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import net.minecraft.client.gui.GuiCreateWorld; //导入依赖的package包/类
@Override
protected void actionPerformed(GuiButton button) {
if (!button.enabled) return;
switch (button.id) {
case 0:
if (buttonRegenMode.enabled)
preset = regenMode;
break;
case 3:
// If going to the more options screen, hide the button.
// If going back to the main screen, show the button again.
boolean inMoreOptions = ReflectionHelper.getPrivateValue(GuiCreateWorld.class, this, "field_146344_y");
buttonRegenMode.visible = inMoreOptions;
break;
case 9:
regenMode = EnumPreset.values()[(regenMode.ordinal() + 1) % EnumPreset.values().length];
buttonRegenMode.displayString = getRegenButtonString();
break;
}
super.actionPerformed(button);
}
示例2: addOptionsButtonToGui
import net.minecraft.client.gui.GuiCreateWorld; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public static void addOptionsButtonToGui(GuiCreateWorld gui, List<GuiButton> buttonList)
{
if (gui == null)
{
_optionsGuiButton = null;
}
else
{
if (_optionsGuiButton == null)
{
WorldConfig.loadedOptionOverrides[0] = null;
GuiCustomOreGenSettings button = new GuiCustomOreGenSettings(gui);
_optionsGuiButton = new GuiOpenMenuButton(gui, 99, 0, 0, 150, 20, "Custom Ore Generation...", button);
}
GuiOpenMenuButton button1 = _optionsGuiButton;
if (!buttonList.contains(button1))
{
button1.xPosition = (gui.width - button1.getWidth()) / 2;
button1.yPosition = 165;
buttonList.add(button1);
}
}
}
示例3: onCustomizeButton
import net.minecraft.client.gui.GuiCreateWorld; //导入依赖的package包/类
@Override
public void onCustomizeButton(Minecraft mc, GuiCreateWorld guiCreateWorld) {
// testing time
ExampleMod.logger.info("wheee");
/*BiomeSettings testsettings = new DefaultBiomeSettings();
BiomeSettings testammendment = new BiomeSettings();
BiomeSettings.BiomeReplacement testreplace = new BiomeSettings.BiomeReplacement();
testreplace.replace = Biomes.MUSHROOM_ISLAND.getRegistryName();
testreplace.name = Biomes.MESA.getRegistryName();
testammendment.replacements.put(testreplace.getMapKey(), testreplace);
testsettings.apply(testammendment);
String json = testsettings.writeToJson();
ATG.logger.info("Json 1: "+json);
BiomeSettings test2 = new BiomeSettings().readFromJson(json);
String json2 = test2.writeToJson();
ATG.logger.info("Json 2: "+json2);*/
//GeneralUtil.printBiomeInformation();
DefaultWorldSettings testsettings = new DefaultWorldSettings();
testsettings.applyDefaultModuleStack();
ExampleMod.logger.info(testsettings.writeToJson());
}
示例4: guiEvent
import net.minecraft.client.gui.GuiCreateWorld; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void guiEvent(GuiScreenEvent.InitGuiEvent.Post event)
{
if(!(event.gui instanceof GuiCreateWorld)) return;
GuiButton gmodebtn = (GuiButton) event.buttonList.get(2);
GuiButton apocSelt = new GuiButton(11, event.gui.width / 2 + 5, 110, 150, 20, StatCollector.translateToLocal("internal.genuineea.ApocButton"));
gmodebtn.xPosition -= 80;
gmodebtn.yPosition -= 5;
apocSelectBTN = apocSelt;
event.buttonList.add(apocSelt);
}
示例5: actionEvent
import net.minecraft.client.gui.GuiCreateWorld; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void actionEvent(ActionPerformedEvent.Post event)
{
if(!(event.gui instanceof GuiCreateWorld)) return;
if(event.button.id == 11)
{
event.gui.mc.displayGuiScreen(new GuiApocSelect(event.gui));
}
else if(event.button.id == 3)
{
apocSelectBTN.visible = !apocSelectBTN.visible;
}
}
示例6: onGuiOpen
import net.minecraft.client.gui.GuiCreateWorld; //导入依赖的package包/类
@SubscribeEvent
public void onGuiOpen(GuiOpenEvent event) {
EnumControl regenControl = AdvHealthOptions.config.<EnumControl>get(AHOGlobalConfig.generalControl);
if ((regenControl == EnumControl.HIDDEN) ||
!(event.gui instanceof GuiCreateWorld) ||
(event.gui instanceof AHOGuiCreateWorld)) return;
// Replace default create world GUI with custom one. This might be
// bad if other mods do the same, or try to modify the default one.
Minecraft mc = Minecraft.getMinecraft();
mc.displayGuiScreen(new AHOGuiCreateWorld(mc.currentScreen));
event.setCanceled(true);
}
示例7: drawScreen
import net.minecraft.client.gui.GuiCreateWorld; //导入依赖的package包/类
@Override
public void drawScreen(int par1, int par2, float par3) {
boolean inMoreOptions = ReflectionHelper.getPrivateValue(GuiCreateWorld.class, this, "field_146344_y");
if (!inMoreOptions) {
GuiTextField textField = ReflectionHelper.getPrivateValue(GuiCreateWorld.class, this, "field_146333_g");
String resultFolder = ReflectionHelper.getPrivateValue(GuiCreateWorld.class, this, "field_146336_i");
String gameModeLine1 = ReflectionHelper.getPrivateValue(GuiCreateWorld.class, this, "field_146323_G");
String gameModeLine2 = ReflectionHelper.getPrivateValue(GuiCreateWorld.class, this, "field_146328_H");
drawDefaultBackground();
drawCenteredString(fontRendererObj, LocalizationUtils.translate("selectWorld.create"), width / 2, 20, -1);
drawString(fontRendererObj, LocalizationUtils.translate("selectWorld.enterName"), width / 2 - 100, 47, 0xFFA0A0A0);
drawString(fontRendererObj, LocalizationUtils.translate("selectWorld.resultFolder") + " " + resultFolder, width / 2 - 100, 85, 0xFFA0A0A0);
textField.drawTextBox();
drawString(fontRendererObj, gameModeLine1, width / 2 - 100, 122, 0xFFA0A0A0);
drawString(fontRendererObj, gameModeLine2, width / 2 - 100, 134, 0xFFA0A0A0);
String regenModeDesc = ((regenMode == EnumPreset.CUSTOM)
? AdvHealthOptions.config.<String>get(AHOGlobalConfig.generalDescription)
: (AHOLocalization.REGEN_MODE + "." + regenMode.toString().toLowerCase() + ".desc"));
regenModeDesc = LocalizationUtils.translate(regenModeDesc);
drawString(fontRendererObj, regenModeDesc, width / 2 - 100, 172, 0xFFA0A0A0);
for (int i = 0; i < buttonList.size(); ++i)
((GuiButton)buttonList.get(i)).drawButton(mc, par1, par2);
for (int i = 0; i < labelList.size(); ++i)
((GuiLabel)labelList.get(i)).func_146159_a(mc, par1, par2);
} else super.drawScreen(par1, par2, par3);
}
示例8: onCustomizeButton
import net.minecraft.client.gui.GuiCreateWorld; //导入依赖的package包/类
/**
* Called when the 'Customize' button is pressed on world creation GUI
* @param instance The minecraft instance
* @param guiCreateWorld the createworld GUI
*/
@SideOnly(Side.CLIENT)
public void onCustomizeButton(Minecraft instance, GuiCreateWorld guiCreateWorld)
{
if (this == FLAT)
{
instance.displayGuiScreen(new GuiCreateFlatWorld(guiCreateWorld, guiCreateWorld.field_146334_a));
}
}
示例9: onOpenGui
import net.minecraft.client.gui.GuiCreateWorld; //导入依赖的package包/类
@SubscribeEvent
@SideOnly(Side.CLIENT) //Modders should never do this, im just lazy, and I KNOW what im doing.
public void onOpenGui(GuiOpenEvent e)
{
//If we're opening the new world screen from the world selection, default to void world.
if (e.getGui() instanceof GuiCreateWorld && Minecraft.getMinecraft().currentScreen instanceof GuiWorldSelection)
{
//Auto-select void world.
GuiCreateWorld cw = (GuiCreateWorld)e.getGui();
ReflectionHelper.setPrivateValue(GuiCreateWorld.class, cw, worldType.getId(),
"field_146331_K", "selectedIndex");
}
}
示例10: func_73875_a
import net.minecraft.client.gui.GuiCreateWorld; //导入依赖的package包/类
protected void func_73875_a(GuiButton p_73875_1_) {
if(p_73875_1_.field_73742_g) {
if(p_73875_1_.field_73741_f == 2) {
String var2 = this.func_74063_d(this.field_74080_m);
if(var2 != null) {
this.field_74084_s = true;
GuiYesNo var3 = func_74061_a(this, var2, this.field_74080_m);
this.field_73882_e.func_71373_a(var3);
}
} else if(p_73875_1_.field_73741_f == 1) {
this.func_74064_e(this.field_74080_m);
} else if(p_73875_1_.field_73741_f == 3) {
this.field_73882_e.func_71373_a(new GuiCreateWorld(this));
} else if(p_73875_1_.field_73741_f == 6) {
this.field_73882_e.func_71373_a(new GuiRenameWorld(this, this.func_74069_a(this.field_74080_m)));
} else if(p_73875_1_.field_73741_f == 0) {
this.field_73882_e.func_71373_a(this.field_74077_a);
} else if(p_73875_1_.field_73741_f == 7) {
GuiCreateWorld var5 = new GuiCreateWorld(this);
ISaveHandler var6 = this.field_73882_e.func_71359_d().func_75804_a(this.func_74069_a(this.field_74080_m), false);
WorldInfo var4 = var6.func_75757_d();
var6.func_75759_a();
var5.func_82286_a(var4);
this.field_73882_e.func_71373_a(var5);
} else {
this.field_74079_o.func_77219_a(p_73875_1_);
}
}
}
示例11: onCustomizeButton
import net.minecraft.client.gui.GuiCreateWorld; //导入依赖的package包/类
/**
* Called when the 'Customize' button is pressed on world creation GUI
* @param instance The minecraft instance
* @param guiCreateWorld the createworld GUI
*/
@SideOnly(Side.CLIENT)
public void onCustomizeButton(Minecraft instance, GuiCreateWorld guiCreateWorld)
{
if (this == FLAT)
{
instance.displayGuiScreen(new GuiCreateFlatWorld(guiCreateWorld, guiCreateWorld.generatorOptionsToUse));
}
}
示例12: onInitGui
import net.minecraft.client.gui.GuiCreateWorld; //导入依赖的package包/类
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onInitGui(GuiScreenEvent.InitGuiEvent.Post event) {
if (event.getGui() instanceof GuiCreateWorld)
{
ServerState.addOptionsButtonToGui((GuiCreateWorld)event.getGui(), event.getButtonList());
}
}
示例13: onActionPerformed
import net.minecraft.client.gui.GuiCreateWorld; //导入依赖的package包/类
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onActionPerformed(GuiScreenEvent.ActionPerformedEvent.Post event) {
if (event.getGui() instanceof GuiCreateWorld)
{
ServerState.updateOptionsButtonVisibility((GuiCreateWorld)event.getGui());
}
}
示例14: handleGuiOpen
import net.minecraft.client.gui.GuiCreateWorld; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@ForgeSubscribe
public void handleGuiOpen(GuiOpenEvent event)
{
if (event.gui == null)
{
return;
}
if (event.gui.getClass().equals(GuiCreateWorld.class))
{
GuiScreen parent = ObfuscationReflectionHelper.getPrivateValue(GuiCreateWorld.class, (GuiCreateWorld) event.gui, 0);
event.gui = new HackedCreateWorld(parent);
}
else if (event.gui.getClass().equals(GuiSelectWorld.class))
{
for (Field f : GuiSelectWorld.class.getDeclaredFields())
{
if (f.getType().isArray())
{
try
{
f.setAccessible(true);
String[] strings = Arrays.copyOf((String[]) f.get(event.gui), 4);
strings[3] = I18n.getString("gamemode." + Constants.GAMEMODE);
f.set(event.gui, strings);
return;
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
}
}
示例15: onOpenGui
import net.minecraft.client.gui.GuiCreateWorld; //导入依赖的package包/类
@SubscribeEvent
public static void onOpenGui(GuiScreenEvent.InitGuiEvent event)
{
if (event.getGui() instanceof GuiContainer)
{
if (!SettingsFlags.instance.enableCustomInventory)
{
return;
}
GuiContainer gc = (GuiContainer) event.getGui();
if ((gc instanceof GuiInventory || gc instanceof GuiContainerCreative) && Minecraft.getMinecraft().player.capabilities.isCreativeMode)
{
return;
}
Container c = gc.inventorySlots;
for (int i = 0; i < c.inventorySlots.size(); ++i)
{
Slot s = c.inventorySlots.get(i);
if (s.getClass().equals(Slot.class) && s.inventory instanceof InventoryPlayer && !(s instanceof ManagedSlot) && s.getSlotIndex() >= 9 && s.getSlotIndex() < 36)
{
ManagedSlot wrapper = new ManagedSlot(s);
c.inventorySlots.remove(i);
c.inventorySlots.add(i, wrapper);
}
}
}
if (event.getGui() instanceof GuiCreateWorld)
{
if (!SettingsFlags.instance.enableInvasiveChanges)
{
return;
}
try
{
Field f = null;
Field[] allFlds = GuiCreateWorld.class.getDeclaredFields();
for (int i = allFlds.length - 1; i >= 0; --i)
{
if (allFlds[i].getType() == Integer.TYPE)
{
f = allFlds[i];
break;
}
}
f.setAccessible(true);
f.set(event.getGui(), ExPMisc.worldTypeExP.getId());
}
catch (Exception ex)
{
ExPMisc.modLogger.log(LogLevel.Debug, "Could not reflect GuiCreateWorld!", ex);
}
}
}