GuiCustomizeWorldScreen .java

net.minecraft.client.gui.GuiCustomizeWorldScreen (class): members: field_175332_D, field_175333_f, field_175334_E, field_175335_g, field_175336_F.

net.minecraft.client.guiclass1,006 linesclientextends GuiScreen51.5 KB

Implements

API Surface (14)

boolean apply(String p_apply_1_)
void initGui()
void handleMouseInput()
String func_175323_a()
void func_175324_a(String p_175324_1_)
void func_175319_a(int p_175319_1_, String p_175319_2_)
String getText(int id, String name, float value)
void func_175321_a(int p_175321_1_, boolean p_175321_2_)
void onTick(int id, float value)
void actionPerformed(GuiButton button)
void keyTyped(char typedChar, int keyCode)
void mouseClicked(int mouseX, int mouseY, int mouseButton)
void mouseReleased(int mouseX, int mouseY, int state)
void drawScreen(int mouseX, int mouseY, float partialTicks)

Fields & Constants (21)

field_175343_i
field_175341_a
field_175333_f
field_175335_g
field_175342_h
field_175349_r
field_175348_s
field_175347_t
field_175346_u
field_175345_v
field_175344_w
field_175352_x
field_175351_y
field_175350_z
field_175338_A
field_175339_B
field_175340_C
field_175332_D
field_175334_E
field_175336_F
random

String literals (68)

"Customize World Settings"
"Page 1 of 3"
"Basic Settings"
"options.customizeTitle"
"createWorld.customize.custom.prev"
"createWorld.customize.custom.next"
"createWorld.customize.custom.defaults"
"createWorld.customize.custom.randomize"
"createWorld.customize.custom.presets"
"gui.done"
"gui.yes"
"gui.no"
"createWorld.customize.custom.seaLevel"
"createWorld.customize.custom.useCaves"
"createWorld.customize.custom.useStrongholds"
"createWorld.customize.custom.useVillages"
"createWorld.customize.custom.useMineShafts"
"createWorld.customize.custom.useTemples"
"createWorld.customize.custom.useMonuments"
"createWorld.customize.custom.useRavines"
"createWorld.customize.custom.useDungeons"
"createWorld.customize.custom.dungeonChance"
"createWorld.customize.custom.useWaterLakes"
"createWorld.customize.custom.waterLakeChance"

Full Source

GuiCustomizeWorldScreen.java1006 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.client.gui;
2
3
import com.google.common.base.Predicate;
4
import com.google.common.primitives.Floats;
5
import java.io.IOException;
6
import java.util.Random;
7
import net.minecraft.client.renderer.GlStateManager;
8
import net.minecraft.client.renderer.Tessellator;
9
import net.minecraft.client.renderer.WorldRenderer;
10
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
11
import net.minecraft.client.resources.I18n;
12
import net.minecraft.util.MathHelper;
13
import net.minecraft.world.biome.BiomeGenBase;
14
import net.minecraft.world.gen.ChunkProviderSettings;
15
16
public class GuiCustomizeWorldScreen extends GuiScreen implements GuiSlider.FormatHelper, GuiPageButtonList.GuiResponder
17
{
18
    private GuiCreateWorld field_175343_i;
19
    protected String field_175341_a = "Customize World Settings";
20
    protected String field_175333_f = "Page 1 of 3";
21
    protected String field_175335_g = "Basic Settings";
22
    protected String[] field_175342_h = new String[4];
23
    private GuiPageButtonList field_175349_r;
24
    private GuiButton field_175348_s;
25
    private GuiButton field_175347_t;
26
    private GuiButton field_175346_u;
27
    private GuiButton field_175345_v;
28
    private GuiButton field_175344_w;
29
    private GuiButton field_175352_x;
30
    private GuiButton field_175351_y;
31
    private GuiButton field_175350_z;
32
    private boolean field_175338_A = false;
33
    private int field_175339_B = 0;
34
    private boolean field_175340_C = false;
35
    private Predicate<String> field_175332_D = new Predicate<String>()
36
    {
37
        public boolean apply(String p_apply_1_)
38
        {
39
            Float f = Floats.tryParse(p_apply_1_);
40
            return p_apply_1_.length() == 0 || f != null && Floats.isFinite(f.floatValue()) && f.floatValue() >= 0.0F;
41
        }
42
    };
43
    private ChunkProviderSettings.Factory field_175334_E = new ChunkProviderSettings.Factory();
44
    private ChunkProviderSettings.Factory field_175336_F;
45
46
    /** A Random instance for this world customization */
47
    private Random random = new Random();
48
49
    public GuiCustomizeWorldScreen(GuiScreen p_i45521_1_, String p_i45521_2_)
50
    {
51
        this.field_175343_i = (GuiCreateWorld)p_i45521_1_;
52
        this.func_175324_a(p_i45521_2_);
53
    }
54
55
    /**
56
     * Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
57
     * window resizes, the buttonList is cleared beforehand.
58
     */
59
    public void initGui()
60
    {
61
        int i = 0;
62
        int j = 0;
63
64
        if (this.field_175349_r != null)
65
        {
66
            i = this.field_175349_r.func_178059_e();
67
            j = this.field_175349_r.getAmountScrolled();
68
        }
69
70
        this.field_175341_a = I18n.format("options.customizeTitle", new Object[0]);
71
        this.buttonList.clear();
72
        this.buttonList.add(this.field_175345_v = new GuiButton(302, 20, 5, 80, 20, I18n.format("createWorld.customize.custom.prev", new Object[0])));
73
        this.buttonList.add(this.field_175344_w = new GuiButton(303, this.width - 100, 5, 80, 20, I18n.format("createWorld.customize.custom.next", new Object[0])));
74
        this.buttonList.add(this.field_175346_u = new GuiButton(304, this.width / 2 - 187, this.height - 27, 90, 20, I18n.format("createWorld.customize.custom.defaults", new Object[0])));
75
        this.buttonList.add(this.field_175347_t = new GuiButton(301, this.width / 2 - 92, this.height - 27, 90, 20, I18n.format("createWorld.customize.custom.randomize", new Object[0])));
76
        this.buttonList.add(this.field_175350_z = new GuiButton(305, this.width / 2 + 3, this.height - 27, 90, 20, I18n.format("createWorld.customize.custom.presets", new Object[0])));
77
        this.buttonList.add(this.field_175348_s = new GuiButton(300, this.width / 2 + 98, this.height - 27, 90, 20, I18n.format("gui.done", new Object[0])));
78
        this.field_175346_u.enabled = this.field_175338_A;
79
        this.field_175352_x = new GuiButton(306, this.width / 2 - 55, 160, 50, 20, I18n.format("gui.yes", new Object[0]));
80
        this.field_175352_x.visible = false;
81
        this.buttonList.add(this.field_175352_x);
82
        this.field_175351_y = new GuiButton(307, this.width / 2 + 5, 160, 50, 20, I18n.format("gui.no", new Object[0]));
83
        this.field_175351_y.visible = false;
84
        this.buttonList.add(this.field_175351_y);
85
86
        if (this.field_175339_B != 0)
87
        {
88
            this.field_175352_x.visible = true;
89
            this.field_175351_y.visible = true;
90
        }
91
92
        this.func_175325_f();
93
94
        if (i != 0)
95
        {
96
            this.field_175349_r.func_181156_c(i);
97
            this.field_175349_r.scrollBy(j);
98
            this.func_175328_i();
99
        }
100
    }
101
102
    /**
103
     * Handles mouse input.
104
     */
105
    public void handleMouseInput() throws IOException
106
    {
107
        super.handleMouseInput();
108
        this.field_175349_r.handleMouseInput();
109
    }
110
111
    private void func_175325_f()
112
    {
113
        GuiPageButtonList.GuiListEntry[] aguipagebuttonlist$guilistentry = new GuiPageButtonList.GuiListEntry[] {new GuiPageButtonList.GuiSlideEntry(160, I18n.format("createWorld.customize.custom.seaLevel", new Object[0]), true, this, 1.0F, 255.0F, (float)this.field_175336_F.seaLevel), new GuiPageButtonList.GuiButtonEntry(148, I18n.format("createWorld.customize.custom.useCaves", new Object[0]), true, this.field_175336_F.useCaves), new GuiPageButtonList.GuiButtonEntry(150, I18n.format("createWorld.customize.custom.useStrongholds", new Object[0]), true, this.field_175336_F.useStrongholds), new GuiPageButtonList.GuiButtonEntry(151, I18n.format("createWorld.customize.custom.useVillages", new Object[0]), true, this.field_175336_F.useVillages), new GuiPageButtonList.GuiButtonEntry(152, I18n.format("createWorld.customize.custom.useMineShafts", new Object[0]), true, this.field_175336_F.useMineShafts), new GuiPageButtonList.GuiButtonEntry(153, I18n.format("createWorld.customize.custom.useTemples", new Object[0]), true, this.field_175336_F.useTemples), new GuiPageButtonList.GuiButtonEntry(210, I18n.format("createWorld.customize.custom.useMonuments", new Object[0]), true, this.field_175336_F.useMonuments), new GuiPageButtonList.GuiButtonEntry(154, I18n.format("createWorld.customize.custom.useRavines", new Object[0]), true, this.field_175336_F.useRavines), new GuiPageButtonList.GuiButtonEntry(149, I18n.format("createWorld.customize.custom.useDungeons", new Object[0]), true, this.field_175336_F.useDungeons), new GuiPageButtonList.GuiSlideEntry(157, I18n.format("createWorld.customize.custom.dungeonChance", new Object[0]), true, this, 1.0F, 100.0F, (float)this.field_175336_F.dungeonChance), new GuiPageButtonList.GuiButtonEntry(155, I18n.format("createWorld.customize.custom.useWaterLakes", new Object[0]), true, this.field_175336_F.useWaterLakes), new GuiPageButtonList.GuiSlideEntry(158, I18n.format("createWorld.customize.custom.waterLakeChance", new Object[0]), true, this, 1.0F, 100.0F, (float)this.field_175336_F.waterLakeChance), new GuiPageButtonList.GuiButtonEntry(156, I18n.format("createWorld.customize.custom.useLavaLakes", new Object[0]), true, this.field_175336_F.useLavaLakes), new GuiPageButtonList.GuiSlideEntry(159, I18n.format("createWorld.customize.custom.lavaLakeChance", new Object[0]), true, this, 10.0F, 100.0F, (float)this.field_175336_F.lavaLakeChance), new GuiPageButtonList.GuiButtonEntry(161, I18n.format("createWorld.customize.custom.useLavaOceans", new Object[0]), true, this.field_175336_F.useLavaOceans), new GuiPageButtonList.GuiSlideEntry(162, I18n.format("createWorld.customize.custom.fixedBiome", new Object[0]), true, this, -1.0F, 37.0F, (float)this.field_175336_F.fixedBiome), new GuiPageButtonList.GuiSlideEntry(163, I18n.format("createWorld.customize.custom.biomeSize", new Object[0]), true, this, 1.0F, 8.0F, (float)this.field_175336_F.biomeSize), new GuiPageButtonList.GuiSlideEntry(164, I18n.format("createWorld.customize.custom.riverSize", new Object[0]), true, this, 1.0F, 5.0F, (float)this.field_175336_F.riverSize)};
114
        GuiPageButtonList.GuiListEntry[] aguipagebuttonlist$guilistentry1 = new GuiPageButtonList.GuiListEntry[] {new GuiPageButtonList.GuiLabelEntry(416, I18n.format("tile.dirt.name", new Object[0]), false), null, new GuiPageButtonList.GuiSlideEntry(165, I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, (float)this.field_175336_F.dirtSize), new GuiPageButtonList.GuiSlideEntry(166, I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, (float)this.field_175336_F.dirtCount), new GuiPageButtonList.GuiSlideEntry(167, I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.dirtMinHeight), new GuiPageButtonList.GuiSlideEntry(168, I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.dirtMaxHeight), new GuiPageButtonList.GuiLabelEntry(417, I18n.format("tile.gravel.name", new Object[0]), false), null, new GuiPageButtonList.GuiSlideEntry(169, I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, (float)this.field_175336_F.gravelSize), new GuiPageButtonList.GuiSlideEntry(170, I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, (float)this.field_175336_F.gravelCount), new GuiPageButtonList.GuiSlideEntry(171, I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.gravelMinHeight), new GuiPageButtonList.GuiSlideEntry(172, I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.gravelMaxHeight), new GuiPageButtonList.GuiLabelEntry(418, I18n.format("tile.stone.granite.name", new Object[0]), false), null, new GuiPageButtonList.GuiSlideEntry(173, I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, (float)this.field_175336_F.graniteSize), new GuiPageButtonList.GuiSlideEntry(174, I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, (float)this.field_175336_F.graniteCount), new GuiPageButtonList.GuiSlideEntry(175, I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.graniteMinHeight), new GuiPageButtonList.GuiSlideEntry(176, I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.graniteMaxHeight), new GuiPageButtonList.GuiLabelEntry(419, I18n.format("tile.stone.diorite.name", new Object[0]), false), null, new GuiPageButtonList.GuiSlideEntry(177, I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, (float)this.field_175336_F.dioriteSize), new GuiPageButtonList.GuiSlideEntry(178, I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, (float)this.field_175336_F.dioriteCount), new GuiPageButtonList.GuiSlideEntry(179, I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.dioriteMinHeight), new GuiPageButtonList.GuiSlideEntry(180, I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.dioriteMaxHeight), new GuiPageButtonList.GuiLabelEntry(420, I18n.format("tile.stone.andesite.name", new Object[0]), false), null, new GuiPageButtonList.GuiSlideEntry(181, I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, (float)this.field_175336_F.andesiteSize), new GuiPageButtonList.GuiSlideEntry(182, I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, (float)this.field_175336_F.andesiteCount), new GuiPageButtonList.GuiSlideEntry(183, I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.andesiteMinHeight), new GuiPageButtonList.GuiSlideEntry(184, I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.andesiteMaxHeight), new GuiPageButtonList.GuiLabelEntry(421, I18n.format("tile.oreCoal.name", new Object[0]), false), null, new GuiPageButtonList.GuiSlideEntry(185, I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, (float)this.field_175336_F.coalSize), new GuiPageButtonList.GuiSlideEntry(186, I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, (float)this.field_175336_F.coalCount), new GuiPageButtonList.GuiSlideEntry(187, I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.coalMinHeight), new GuiPageButtonList.GuiSlideEntry(189, I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.coalMaxHeight), new GuiPageButtonList.GuiLabelEntry(422, I18n.format("tile.oreIron.name", new Object[0]), false), null, new GuiPageButtonList.GuiSlideEntry(190, I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, (float)this.field_175336_F.ironSize), new GuiPageButtonList.GuiSlideEntry(191, I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, (float)this.field_175336_F.ironCount), new GuiPageButtonList.GuiSlideEntry(192, I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.ironMinHeight), new GuiPageButtonList.GuiSlideEntry(193, I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.ironMaxHeight), new GuiPageButtonList.GuiLabelEntry(423, I18n.format("tile.oreGold.name", new Object[0]), false), null, new GuiPageButtonList.GuiSlideEntry(194, I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, (float)this.field_175336_F.goldSize), new GuiPageButtonList.GuiSlideEntry(195, I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, (float)this.field_175336_F.goldCount), new GuiPageButtonList.GuiSlideEntry(196, I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.goldMinHeight), new GuiPageButtonList.GuiSlideEntry(197, I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.goldMaxHeight), new GuiPageButtonList.GuiLabelEntry(424, I18n.format("tile.oreRedstone.name", new Object[0]), false), null, new GuiPageButtonList.GuiSlideEntry(198, I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, (float)this.field_175336_F.redstoneSize), new GuiPageButtonList.GuiSlideEntry(199, I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, (float)this.field_175336_F.redstoneCount), new GuiPageButtonList.GuiSlideEntry(200, I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.redstoneMinHeight), new GuiPageButtonList.GuiSlideEntry(201, I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.redstoneMaxHeight), new GuiPageButtonList.GuiLabelEntry(425, I18n.format("tile.oreDiamond.name", new Object[0]), false), null, new GuiPageButtonList.GuiSlideEntry(202, I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, (float)this.field_175336_F.diamondSize), new GuiPageButtonList.GuiSlideEntry(203, I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, (float)this.field_175336_F.diamondCount), new GuiPageButtonList.GuiSlideEntry(204, I18n.format("createWorld.customize.custom.minHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.diamondMinHeight), new GuiPageButtonList.GuiSlideEntry(205, I18n.format("createWorld.customize.custom.maxHeight", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.diamondMaxHeight), new GuiPageButtonList.GuiLabelEntry(426, I18n.format("tile.oreLapis.name", new Object[0]), false), null, new GuiPageButtonList.GuiSlideEntry(206, I18n.format("createWorld.customize.custom.size", new Object[0]), false, this, 1.0F, 50.0F, (float)this.field_175336_F.lapisSize), new GuiPageButtonList.GuiSlideEntry(207, I18n.format("createWorld.customize.custom.count", new Object[0]), false, this, 0.0F, 40.0F, (float)this.field_175336_F.lapisCount), new GuiPageButtonList.GuiSlideEntry(208, I18n.format("createWorld.customize.custom.center", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.lapisCenterHeight), new GuiPageButtonList.GuiSlideEntry(209, I18n.format("createWorld.customize.custom.spread", new Object[0]), false, this, 0.0F, 255.0F, (float)this.field_175336_F.lapisSpread)};
115
        GuiPageButtonList.GuiListEntry[] aguipagebuttonlist$guilistentry2 = new GuiPageButtonList.GuiListEntry[] {new GuiPageButtonList.GuiSlideEntry(100, I18n.format("createWorld.customize.custom.mainNoiseScaleX", new Object[0]), false, this, 1.0F, 5000.0F, this.field_175336_F.mainNoiseScaleX), new GuiPageButtonList.GuiSlideEntry(101, I18n.format("createWorld.customize.custom.mainNoiseScaleY", new Object[0]), false, this, 1.0F, 5000.0F, this.field_175336_F.mainNoiseScaleY), new GuiPageButtonList.GuiSlideEntry(102, I18n.format("createWorld.customize.custom.mainNoiseScaleZ", new Object[0]), false, this, 1.0F, 5000.0F, this.field_175336_F.mainNoiseScaleZ), new GuiPageButtonList.GuiSlideEntry(103, I18n.format("createWorld.customize.custom.depthNoiseScaleX", new Object[0]), false, this, 1.0F, 2000.0F, this.field_175336_F.depthNoiseScaleX), new GuiPageButtonList.GuiSlideEntry(104, I18n.format("createWorld.customize.custom.depthNoiseScaleZ", new Object[0]), false, this, 1.0F, 2000.0F, this.field_175336_F.depthNoiseScaleZ), new GuiPageButtonList.GuiSlideEntry(105, I18n.format("createWorld.customize.custom.depthNoiseScaleExponent", new Object[0]), false, this, 0.01F, 20.0F, this.field_175336_F.depthNoiseScaleExponent), new GuiPageButtonList.GuiSlideEntry(106, I18n.format("createWorld.customize.custom.baseSize", new Object[0]), false, this, 1.0F, 25.0F, this.field_175336_F.baseSize), new GuiPageButtonList.GuiSlideEntry(107, I18n.format("createWorld.customize.custom.coordinateScale", new Object[0]), false, this, 1.0F, 6000.0F, this.field_175336_F.coordinateScale), new GuiPageButtonList.GuiSlideEntry(108, I18n.format("createWorld.customize.custom.heightScale", new Object[0]), false, this, 1.0F, 6000.0F, this.field_175336_F.heightScale), new GuiPageButtonList.GuiSlideEntry(109, I18n.format("createWorld.customize.custom.stretchY", new Object[0]), false, this, 0.01F, 50.0F, this.field_175336_F.stretchY), new GuiPageButtonList.GuiSlideEntry(110, I18n.format("createWorld.customize.custom.upperLimitScale", new Object[0]), false, this, 1.0F, 5000.0F, this.field_175336_F.upperLimitScale), new GuiPageButtonList.GuiSlideEntry(111, I18n.format("createWorld.customize.custom.lowerLimitScale", new Object[0]), false, this, 1.0F, 5000.0F, this.field_175336_F.lowerLimitScale), new GuiPageButtonList.GuiSlideEntry(112, I18n.format("createWorld.customize.custom.biomeDepthWeight", new Object[0]), false, this, 1.0F, 20.0F, this.field_175336_F.biomeDepthWeight), new GuiPageButtonList.GuiSlideEntry(113, I18n.format("createWorld.customize.custom.biomeDepthOffset", new Object[0]), false, this, 0.0F, 20.0F, this.field_175336_F.biomeDepthOffset), new GuiPageButtonList.GuiSlideEntry(114, I18n.format("createWorld.customize.custom.biomeScaleWeight", new Object[0]), false, this, 1.0F, 20.0F, this.field_175336_F.biomeScaleWeight), new GuiPageButtonList.GuiSlideEntry(115, I18n.format("createWorld.customize.custom.biomeScaleOffset", new Object[0]), false, this, 0.0F, 20.0F, this.field_175336_F.biomeScaleOffset)};
116
        GuiPageButtonList.GuiListEntry[] aguipagebuttonlist$guilistentry3 = new GuiPageButtonList.GuiListEntry[] {new GuiPageButtonList.GuiLabelEntry(400, I18n.format("createWorld.customize.custom.mainNoiseScaleX", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(132, String.format("%5.3f", new Object[]{Float.valueOf(this.field_175336_F.mainNoiseScaleX)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(401, I18n.format("createWorld.customize.custom.mainNoiseScaleY", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(133, String.format("%5.3f", new Object[]{Float.valueOf(this.field_175336_F.mainNoiseScaleY)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(402, I18n.format("createWorld.customize.custom.mainNoiseScaleZ", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(134, String.format("%5.3f", new Object[]{Float.valueOf(this.field_175336_F.mainNoiseScaleZ)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(403, I18n.format("createWorld.customize.custom.depthNoiseScaleX", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(135, String.format("%5.3f", new Object[]{Float.valueOf(this.field_175336_F.depthNoiseScaleX)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(404, I18n.format("createWorld.customize.custom.depthNoiseScaleZ", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(136, String.format("%5.3f", new Object[]{Float.valueOf(this.field_175336_F.depthNoiseScaleZ)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(405, I18n.format("createWorld.customize.custom.depthNoiseScaleExponent", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(137, String.format("%2.3f", new Object[]{Float.valueOf(this.field_175336_F.depthNoiseScaleExponent)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(406, I18n.format("createWorld.customize.custom.baseSize", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(138, String.format("%2.3f", new Object[]{Float.valueOf(this.field_175336_F.baseSize)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(407, I18n.format("createWorld.customize.custom.coordinateScale", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(139, String.format("%5.3f", new Object[]{Float.valueOf(this.field_175336_F.coordinateScale)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(408, I18n.format("createWorld.customize.custom.heightScale", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(140, String.format("%5.3f", new Object[]{Float.valueOf(this.field_175336_F.heightScale)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(409, I18n.format("createWorld.customize.custom.stretchY", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(141, String.format("%2.3f", new Object[]{Float.valueOf(this.field_175336_F.stretchY)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(410, I18n.format("createWorld.customize.custom.upperLimitScale", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(142, String.format("%5.3f", new Object[]{Float.valueOf(this.field_175336_F.upperLimitScale)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(411, I18n.format("createWorld.customize.custom.lowerLimitScale", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(143, String.format("%5.3f", new Object[]{Float.valueOf(this.field_175336_F.lowerLimitScale)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(412, I18n.format("createWorld.customize.custom.biomeDepthWeight", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(144, String.format("%2.3f", new Object[]{Float.valueOf(this.field_175336_F.biomeDepthWeight)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(413, I18n.format("createWorld.customize.custom.biomeDepthOffset", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(145, String.format("%2.3f", new Object[]{Float.valueOf(this.field_175336_F.biomeDepthOffset)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(414, I18n.format("createWorld.customize.custom.biomeScaleWeight", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(146, String.format("%2.3f", new Object[]{Float.valueOf(this.field_175336_F.biomeScaleWeight)}), false, this.field_175332_D), new GuiPageButtonList.GuiLabelEntry(415, I18n.format("createWorld.customize.custom.biomeScaleOffset", new Object[0]) + ":", false), new GuiPageButtonList.EditBoxEntry(147, String.format("%2.3f", new Object[]{Float.valueOf(this.field_175336_F.biomeScaleOffset)}), false, this.field_175332_D)};
117
        this.field_175349_r = new GuiPageButtonList(this.mc, this.width, this.height, 32, this.height - 32, 25, this, new GuiPageButtonList.GuiListEntry[][] {aguipagebuttonlist$guilistentry, aguipagebuttonlist$guilistentry1, aguipagebuttonlist$guilistentry2, aguipagebuttonlist$guilistentry3});
118
119
        for (int i = 0; i < 4; ++i)
120
        {
121
            this.field_175342_h[i] = I18n.format("createWorld.customize.custom.page" + i, new Object[0]);
122
        }
123
124
        this.func_175328_i();
125
    }
126
127
    public String func_175323_a()
128
    {
129
        return this.field_175336_F.toString().replace("\n", "");
130
    }
131
132
    public void func_175324_a(String p_175324_1_)
133
    {
134
        if (p_175324_1_ != null && p_175324_1_.length() != 0)
135
        {
136
            this.field_175336_F = ChunkProviderSettings.Factory.jsonToFactory(p_175324_1_);
137
        }
138
        else
139
        {
140
            this.field_175336_F = new ChunkProviderSettings.Factory();
141
        }
142
    }
143
144
    public void func_175319_a(int p_175319_1_, String p_175319_2_)
145
    {
146
        float f = 0.0F;
147
148
        try
149
        {
150
            f = Float.parseFloat(p_175319_2_);
151
        }
152
        catch (NumberFormatException var5)
153
        {
154
            ;
155
        }
156
157
        float f1 = 0.0F;
158
159
        switch (p_175319_1_)
160
        {
161
            case 132:
162
                f1 = this.field_175336_F.mainNoiseScaleX = MathHelper.clamp_float(f, 1.0F, 5000.0F);
163
                break;
164
165
            case 133:
166
                f1 = this.field_175336_F.mainNoiseScaleY = MathHelper.clamp_float(f, 1.0F, 5000.0F);
167
                break;
168
169
            case 134:
170
                f1 = this.field_175336_F.mainNoiseScaleZ = MathHelper.clamp_float(f, 1.0F, 5000.0F);
171
                break;
172
173
            case 135:
174
                f1 = this.field_175336_F.depthNoiseScaleX = MathHelper.clamp_float(f, 1.0F, 2000.0F);
175
                break;
176
177
            case 136:
178
                f1 = this.field_175336_F.depthNoiseScaleZ = MathHelper.clamp_float(f, 1.0F, 2000.0F);
179
                break;
180
181
            case 137:
182
                f1 = this.field_175336_F.depthNoiseScaleExponent = MathHelper.clamp_float(f, 0.01F, 20.0F);
183
                break;
184
185
            case 138:
186
                f1 = this.field_175336_F.baseSize = MathHelper.clamp_float(f, 1.0F, 25.0F);
187
                break;
188
189
            case 139:
190
                f1 = this.field_175336_F.coordinateScale = MathHelper.clamp_float(f, 1.0F, 6000.0F);
191
                break;
192
193
            case 140:
194
                f1 = this.field_175336_F.heightScale = MathHelper.clamp_float(f, 1.0F, 6000.0F);
195
                break;
196
197
            case 141:
198
                f1 = this.field_175336_F.stretchY = MathHelper.clamp_float(f, 0.01F, 50.0F);
199
                break;
200
201
            case 142:
202
                f1 = this.field_175336_F.upperLimitScale = MathHelper.clamp_float(f, 1.0F, 5000.0F);
203
                break;
204
205
            case 143:
206
                f1 = this.field_175336_F.lowerLimitScale = MathHelper.clamp_float(f, 1.0F, 5000.0F);
207
                break;
208
209
            case 144:
210
                f1 = this.field_175336_F.biomeDepthWeight = MathHelper.clamp_float(f, 1.0F, 20.0F);
211
                break;
212
213
            case 145:
214
                f1 = this.field_175336_F.biomeDepthOffset = MathHelper.clamp_float(f, 0.0F, 20.0F);
215
                break;
216
217
            case 146:
218
                f1 = this.field_175336_F.biomeScaleWeight = MathHelper.clamp_float(f, 1.0F, 20.0F);
219
                break;
220
221
            case 147:
222
                f1 = this.field_175336_F.biomeScaleOffset = MathHelper.clamp_float(f, 0.0F, 20.0F);
223
        }
224
225
        if (f1 != f && f != 0.0F)
226
        {
227
            ((GuiTextField)this.field_175349_r.func_178061_c(p_175319_1_)).setText(this.func_175330_b(p_175319_1_, f1));
228
        }
229
230
        ((GuiSlider)this.field_175349_r.func_178061_c(p_175319_1_ - 132 + 100)).func_175218_a(f1, false);
231
232
        if (!this.field_175336_F.equals(this.field_175334_E))
233
        {
234
            this.func_181031_a(true);
235
        }
236
    }
237
238
    private void func_181031_a(boolean p_181031_1_)
239
    {
240
        this.field_175338_A = p_181031_1_;
241
        this.field_175346_u.enabled = p_181031_1_;
242
    }
243
244
    public String getText(int id, String name, float value)
245
    {
246
        return name + ": " + this.func_175330_b(id, value);
247
    }
248
249
    private String func_175330_b(int p_175330_1_, float p_175330_2_)
250
    {
251
        switch (p_175330_1_)
252
        {
253
            case 100:
254
            case 101:
255
            case 102:
256
            case 103:
257
            case 104:
258
            case 107:
259
            case 108:
260
            case 110:
261
            case 111:
262
            case 132:
263
            case 133:
264
            case 134:
265
            case 135:
266
            case 136:
267
            case 139:
268
            case 140:
269
            case 142:
270
            case 143:
271
                return String.format("%5.3f", new Object[] {Float.valueOf(p_175330_2_)});
272
273
            case 105:
274
            case 106:
275
            case 109:
276
            case 112:
277
            case 113:
278
            case 114:
279
            case 115:
280
            case 137:
281
            case 138:
282
            case 141:
283
            case 144:
284
            case 145:
285
            case 146:
286
            case 147:
287
                return String.format("%2.3f", new Object[] {Float.valueOf(p_175330_2_)});
288
289
            case 116:
290
            case 117:
291
            case 118:
292
            case 119:
293
            case 120:
294
            case 121:
295
            case 122:
296
            case 123:
297
            case 124:
298
            case 125:
299
            case 126:
300
            case 127:
301
            case 128:
302
            case 129:
303
            case 130:
304
            case 131:
305
            case 148:
306
            case 149:
307
            case 150:
308
            case 151:
309
            case 152:
310
            case 153:
311
            case 154:
312
            case 155:
313
            case 156:
314
            case 157:
315
            case 158:
316
            case 159:
317
            case 160:
318
            case 161:
319
            default:
320
                return String.format("%d", new Object[] {Integer.valueOf((int)p_175330_2_)});
321
322
            case 162:
323
                if (p_175330_2_ < 0.0F)
324
                {
325
                    return I18n.format("gui.all", new Object[0]);
326
                }
327
                else if ((int)p_175330_2_ >= BiomeGenBase.hell.biomeID)
328
                {
329
                    BiomeGenBase biomegenbase1 = BiomeGenBase.getBiomeGenArray()[(int)p_175330_2_ + 2];
330
                    return biomegenbase1 != null ? biomegenbase1.biomeName : "?";
331
                }
332
                else
333
                {
334
                    BiomeGenBase biomegenbase = BiomeGenBase.getBiomeGenArray()[(int)p_175330_2_];
335
                    return biomegenbase != null ? biomegenbase.biomeName : "?";
336
                }
337
        }
338
    }
339
340
    public void func_175321_a(int p_175321_1_, boolean p_175321_2_)
341
    {
342
        switch (p_175321_1_)
343
        {
344
            case 148:
345
                this.field_175336_F.useCaves = p_175321_2_;
346
                break;
347
348
            case 149:
349
                this.field_175336_F.useDungeons = p_175321_2_;
350
                break;
351
352
            case 150:
353
                this.field_175336_F.useStrongholds = p_175321_2_;
354
                break;
355
356
            case 151:
357
                this.field_175336_F.useVillages = p_175321_2_;
358
                break;
359
360
            case 152:
361
                this.field_175336_F.useMineShafts = p_175321_2_;
362
                break;
363
364
            case 153:
365
                this.field_175336_F.useTemples = p_175321_2_;
366
                break;
367
368
            case 154:
369
                this.field_175336_F.useRavines = p_175321_2_;
370
                break;
371
372
            case 155:
373
                this.field_175336_F.useWaterLakes = p_175321_2_;
374
                break;
375
376
            case 156:
377
                this.field_175336_F.useLavaLakes = p_175321_2_;
378
                break;
379
380
            case 161:
381
                this.field_175336_F.useLavaOceans = p_175321_2_;
382
                break;
383
384
            case 210:
385
                this.field_175336_F.useMonuments = p_175321_2_;
386
        }
387
388
        if (!this.field_175336_F.equals(this.field_175334_E))
389
        {
390
            this.func_181031_a(true);
391
        }
392
    }
393
394
    public void onTick(int id, float value)
395
    {
396
        switch (id)
397
        {
398
            case 100:
399
                this.field_175336_F.mainNoiseScaleX = value;
400
                break;
401
402
            case 101:
403
                this.field_175336_F.mainNoiseScaleY = value;
404
                break;
405
406
            case 102:
407
                this.field_175336_F.mainNoiseScaleZ = value;
408
                break;
409
410
            case 103:
411
                this.field_175336_F.depthNoiseScaleX = value;
412
                break;
413
414
            case 104:
415
                this.field_175336_F.depthNoiseScaleZ = value;
416
                break;
417
418
            case 105:
419
                this.field_175336_F.depthNoiseScaleExponent = value;
420
                break;
421
422
            case 106:
423
                this.field_175336_F.baseSize = value;
424
                break;
425
426
            case 107:
427
                this.field_175336_F.coordinateScale = value;
428
                break;
429
430
            case 108:
431
                this.field_175336_F.heightScale = value;
432
                break;
433
434
            case 109:
435
                this.field_175336_F.stretchY = value;
436
                break;
437
438
            case 110:
439
                this.field_175336_F.upperLimitScale = value;
440
                break;
441
442
            case 111:
443
                this.field_175336_F.lowerLimitScale = value;
444
                break;
445
446
            case 112:
447
                this.field_175336_F.biomeDepthWeight = value;
448
                break;
449
450
            case 113:
451
                this.field_175336_F.biomeDepthOffset = value;
452
                break;
453
454
            case 114:
455
                this.field_175336_F.biomeScaleWeight = value;
456
                break;
457
458
            case 115:
459
                this.field_175336_F.biomeScaleOffset = value;
460
461
            case 116:
462
            case 117:
463
            case 118:
464
            case 119:
465
            case 120:
466
            case 121:
467
            case 122:
468
            case 123:
469
            case 124:
470
            case 125:
471
            case 126:
472
            case 127:
473
            case 128:
474
            case 129:
475
            case 130:
476
            case 131:
477
            case 132:
478
            case 133:
479
            case 134:
480
            case 135:
481
            case 136:
482
            case 137:
483
            case 138:
484
            case 139:
485
            case 140:
486
            case 141:
487
            case 142:
488
            case 143:
489
            case 144:
490
            case 145:
491
            case 146:
492
            case 147:
493
            case 148:
494
            case 149:
495
            case 150:
496
            case 151:
497
            case 152:
498
            case 153:
499
            case 154:
500
            case 155:
501
            case 156:
502
            case 161:
503
            case 188:
504
            default:
505
                break;
506
507
            case 157:
508
                this.field_175336_F.dungeonChance = (int)value;
509
                break;
510
511
            case 158:
512
                this.field_175336_F.waterLakeChance = (int)value;
513
                break;
514
515
            case 159:
516
                this.field_175336_F.lavaLakeChance = (int)value;
517
                break;
518
519
            case 160:
520
                this.field_175336_F.seaLevel = (int)value;
521
                break;
522
523
            case 162:
524
                this.field_175336_F.fixedBiome = (int)value;
525
                break;
526
527
            case 163:
528
                this.field_175336_F.biomeSize = (int)value;
529
                break;
530
531
            case 164:
532
                this.field_175336_F.riverSize = (int)value;
533
                break;
534
535
            case 165:
536
                this.field_175336_F.dirtSize = (int)value;
537
                break;
538
539
            case 166:
540
                this.field_175336_F.dirtCount = (int)value;
541
                break;
542
543
            case 167:
544
                this.field_175336_F.dirtMinHeight = (int)value;
545
                break;
546
547
            case 168:
548
                this.field_175336_F.dirtMaxHeight = (int)value;
549
                break;
550
551
            case 169:
552
                this.field_175336_F.gravelSize = (int)value;
553
                break;
554
555
            case 170:
556
                this.field_175336_F.gravelCount = (int)value;
557
                break;
558
559
            case 171:
560
                this.field_175336_F.gravelMinHeight = (int)value;
561
                break;
562
563
            case 172:
564
                this.field_175336_F.gravelMaxHeight = (int)value;
565
                break;
566
567
            case 173:
568
                this.field_175336_F.graniteSize = (int)value;
569
                break;
570
571
            case 174:
572
                this.field_175336_F.graniteCount = (int)value;
573
                break;
574
575
            case 175:
576
                this.field_175336_F.graniteMinHeight = (int)value;
577
                break;
578
579
            case 176:
580
                this.field_175336_F.graniteMaxHeight = (int)value;
581
                break;
582
583
            case 177:
584
                this.field_175336_F.dioriteSize = (int)value;
585
                break;
586
587
            case 178:
588
                this.field_175336_F.dioriteCount = (int)value;
589
                break;
590
591
            case 179:
592
                this.field_175336_F.dioriteMinHeight = (int)value;
593
                break;
594
595
            case 180:
596
                this.field_175336_F.dioriteMaxHeight = (int)value;
597
                break;
598
599
            case 181:
600
                this.field_175336_F.andesiteSize = (int)value;
601
                break;
602
603
            case 182:
604
                this.field_175336_F.andesiteCount = (int)value;
605
                break;
606
607
            case 183:
608
                this.field_175336_F.andesiteMinHeight = (int)value;
609
                break;
610
611
            case 184:
612
                this.field_175336_F.andesiteMaxHeight = (int)value;
613
                break;
614
615
            case 185:
616
                this.field_175336_F.coalSize = (int)value;
617
                break;
618
619
            case 186:
620
                this.field_175336_F.coalCount = (int)value;
621
                break;
622
623
            case 187:
624
                this.field_175336_F.coalMinHeight = (int)value;
625
                break;
626
627
            case 189:
628
                this.field_175336_F.coalMaxHeight = (int)value;
629
                break;
630
631
            case 190:
632
                this.field_175336_F.ironSize = (int)value;
633
                break;
634
635
            case 191:
636
                this.field_175336_F.ironCount = (int)value;
637
                break;
638
639
            case 192:
640
                this.field_175336_F.ironMinHeight = (int)value;
641
                break;
642
643
            case 193:
644
                this.field_175336_F.ironMaxHeight = (int)value;
645
                break;
646
647
            case 194:
648
                this.field_175336_F.goldSize = (int)value;
649
                break;
650
651
            case 195:
652
                this.field_175336_F.goldCount = (int)value;
653
                break;
654
655
            case 196:
656
                this.field_175336_F.goldMinHeight = (int)value;
657
                break;
658
659
            case 197:
660
                this.field_175336_F.goldMaxHeight = (int)value;
661
                break;
662
663
            case 198:
664
                this.field_175336_F.redstoneSize = (int)value;
665
                break;
666
667
            case 199:
668
                this.field_175336_F.redstoneCount = (int)value;
669
                break;
670
671
            case 200:
672
                this.field_175336_F.redstoneMinHeight = (int)value;
673
                break;
674
675
            case 201:
676
                this.field_175336_F.redstoneMaxHeight = (int)value;
677
                break;
678
679
            case 202:
680
                this.field_175336_F.diamondSize = (int)value;
681
                break;
682
683
            case 203:
684
                this.field_175336_F.diamondCount = (int)value;
685
                break;
686
687
            case 204:
688
                this.field_175336_F.diamondMinHeight = (int)value;
689
                break;
690
691
            case 205:
692
                this.field_175336_F.diamondMaxHeight = (int)value;
693
                break;
694
695
            case 206:
696
                this.field_175336_F.lapisSize = (int)value;
697
                break;
698
699
            case 207:
700
                this.field_175336_F.lapisCount = (int)value;
701
                break;
702
703
            case 208:
704
                this.field_175336_F.lapisCenterHeight = (int)value;
705
                break;
706
707
            case 209:
708
                this.field_175336_F.lapisSpread = (int)value;
709
        }
710
711
        if (id >= 100 && id < 116)
712
        {
713
            Gui gui = this.field_175349_r.func_178061_c(id - 100 + 132);
714
715
            if (gui != null)
716
            {
717
                ((GuiTextField)gui).setText(this.func_175330_b(id, value));
718
            }
719
        }
720
721
        if (!this.field_175336_F.equals(this.field_175334_E))
722
        {
723
            this.func_181031_a(true);
724
        }
725
    }
726
727
    /**
728
     * Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
729
     */
730
    protected void actionPerformed(GuiButton button) throws IOException
731
    {
732
        if (button.enabled)
733
        {
734
            switch (button.id)
735
            {
736
                case 300:
737
                    this.field_175343_i.chunkProviderSettingsJson = this.field_175336_F.toString();
738
                    this.mc.displayGuiScreen(this.field_175343_i);
739
                    break;
740
741
                case 301:
742
                    for (int i = 0; i < this.field_175349_r.getSize(); ++i)
743
                    {
744
                        GuiPageButtonList.GuiEntry guipagebuttonlist$guientry = this.field_175349_r.getListEntry(i);
745
                        Gui gui = guipagebuttonlist$guientry.func_178022_a();
746
747
                        if (gui instanceof GuiButton)
748
                        {
749
                            GuiButton guibutton = (GuiButton)gui;
750
751
                            if (guibutton instanceof GuiSlider)
752
                            {
753
                                float f = ((GuiSlider)guibutton).func_175217_d() * (0.75F + this.random.nextFloat() * 0.5F) + (this.random.nextFloat() * 0.1F - 0.05F);
754
                                ((GuiSlider)guibutton).func_175219_a(MathHelper.clamp_float(f, 0.0F, 1.0F));
755
                            }
756
                            else if (guibutton instanceof GuiListButton)
757
                            {
758
                                ((GuiListButton)guibutton).func_175212_b(this.random.nextBoolean());
759
                            }
760
                        }
761
762
                        Gui gui1 = guipagebuttonlist$guientry.func_178021_b();
763
764
                        if (gui1 instanceof GuiButton)
765
                        {
766
                            GuiButton guibutton1 = (GuiButton)gui1;
767
768
                            if (guibutton1 instanceof GuiSlider)
769
                            {
770
                                float f1 = ((GuiSlider)guibutton1).func_175217_d() * (0.75F + this.random.nextFloat() * 0.5F) + (this.random.nextFloat() * 0.1F - 0.05F);
771
                                ((GuiSlider)guibutton1).func_175219_a(MathHelper.clamp_float(f1, 0.0F, 1.0F));
772
                            }
773
                            else if (guibutton1 instanceof GuiListButton)
774
                            {
775
                                ((GuiListButton)guibutton1).func_175212_b(this.random.nextBoolean());
776
                            }
777
                        }
778
                    }
779
780
                    return;
781
782
                case 302:
783
                    this.field_175349_r.func_178071_h();
784
                    this.func_175328_i();
785
                    break;
786
787
                case 303:
788
                    this.field_175349_r.func_178064_i();
789
                    this.func_175328_i();
790
                    break;
791
792
                case 304:
793
                    if (this.field_175338_A)
794
                    {
795
                        this.func_175322_b(304);
796
                    }
797
798
                    break;
799
800
                case 305:
801
                    this.mc.displayGuiScreen(new GuiScreenCustomizePresets(this));
802
                    break;
803
804
                case 306:
805
                    this.func_175331_h();
806
                    break;
807
808
                case 307:
809
                    this.field_175339_B = 0;
810
                    this.func_175331_h();
811
            }
812
        }
813
    }
814
815
    private void func_175326_g()
816
    {
817
        this.field_175336_F.func_177863_a();
818
        this.func_175325_f();
819
        this.func_181031_a(false);
820
    }
821
822
    private void func_175322_b(int p_175322_1_)
823
    {
824
        this.field_175339_B = p_175322_1_;
825
        this.func_175329_a(true);
826
    }
827
828
    private void func_175331_h() throws IOException
829
    {
830
        switch (this.field_175339_B)
831
        {
832
            case 300:
833
                this.actionPerformed((GuiListButton)this.field_175349_r.func_178061_c(300));
834
                break;
835
836
            case 304:
837
                this.func_175326_g();
838
        }
839
840
        this.field_175339_B = 0;
841
        this.field_175340_C = true;
842
        this.func_175329_a(false);
843
    }
844
845
    private void func_175329_a(boolean p_175329_1_)
846
    {
847
        this.field_175352_x.visible = p_175329_1_;
848
        this.field_175351_y.visible = p_175329_1_;
849
        this.field_175347_t.enabled = !p_175329_1_;
850
        this.field_175348_s.enabled = !p_175329_1_;
851
        this.field_175345_v.enabled = !p_175329_1_;
852
        this.field_175344_w.enabled = !p_175329_1_;
853
        this.field_175346_u.enabled = this.field_175338_A && !p_175329_1_;
854
        this.field_175350_z.enabled = !p_175329_1_;
855
        this.field_175349_r.func_181155_a(!p_175329_1_);
856
    }
857
858
    private void func_175328_i()
859
    {
860
        this.field_175345_v.enabled = this.field_175349_r.func_178059_e() != 0;
861
        this.field_175344_w.enabled = this.field_175349_r.func_178059_e() != this.field_175349_r.func_178057_f() - 1;
862
        this.field_175333_f = I18n.format("book.pageIndicator", new Object[] {Integer.valueOf(this.field_175349_r.func_178059_e() + 1), Integer.valueOf(this.field_175349_r.func_178057_f())});
863
        this.field_175335_g = this.field_175342_h[this.field_175349_r.func_178059_e()];
864
        this.field_175347_t.enabled = this.field_175349_r.func_178059_e() != this.field_175349_r.func_178057_f() - 1;
865
    }
866
867
    /**
868
     * Fired when a key is typed (except F11 which toggles full screen). This is the equivalent of
869
     * KeyListener.keyTyped(KeyEvent e). Args : character (character on the key), keyCode (lwjgl Keyboard key code)
870
     */
871
    protected void keyTyped(char typedChar, int keyCode) throws IOException
872
    {
873
        super.keyTyped(typedChar, keyCode);
874
875
        if (this.field_175339_B == 0)
876
        {
877
            switch (keyCode)
878
            {
879
                case 200:
880
                    this.func_175327_a(1.0F);
881
                    break;
882
883
                case 208:
884
                    this.func_175327_a(-1.0F);
885
                    break;
886
887
                default:
888
                    this.field_175349_r.func_178062_a(typedChar, keyCode);
889
            }
890
        }
891
    }
892
893
    private void func_175327_a(float p_175327_1_)
894
    {
895
        Gui gui = this.field_175349_r.func_178056_g();
896
897
        if (gui instanceof GuiTextField)
898
        {
899
            float f = p_175327_1_;
900
901
            if (GuiScreen.isShiftKeyDown())
902
            {
903
                f = p_175327_1_ * 0.1F;
904
905
                if (GuiScreen.isCtrlKeyDown())
906
                {
907
                    f *= 0.1F;
908
                }
909
            }
910
            else if (GuiScreen.isCtrlKeyDown())
911
            {
912
                f = p_175327_1_ * 10.0F;
913
914
                if (GuiScreen.isAltKeyDown())
915
                {
916
                    f *= 10.0F;
917
                }
918
            }
919
920
            GuiTextField guitextfield = (GuiTextField)gui;
921
            Float f1 = Floats.tryParse(guitextfield.getText());
922
923
            if (f1 != null)
924
            {
925
                f1 = Float.valueOf(f1.floatValue() + f);
926
                int i = guitextfield.getId();
927
                String s = this.func_175330_b(guitextfield.getId(), f1.floatValue());
928
                guitextfield.setText(s);
929
                this.func_175319_a(i, s);
930
            }
931
        }
932
    }
933
934
    /**
935
     * Called when the mouse is clicked. Args : mouseX, mouseY, clickedButton
936
     */
937
    protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException
938
    {
939
        super.mouseClicked(mouseX, mouseY, mouseButton);
940
941
        if (this.field_175339_B == 0 && !this.field_175340_C)
942
        {
943
            this.field_175349_r.mouseClicked(mouseX, mouseY, mouseButton);
944
        }
945
    }
946
947
    /**
948
     * Called when a mouse button is released.  Args : mouseX, mouseY, releaseButton
949
     */
950
    protected void mouseReleased(int mouseX, int mouseY, int state)
951
    {
952
        super.mouseReleased(mouseX, mouseY, state);
953
954
        if (this.field_175340_C)
955
        {
956
            this.field_175340_C = false;
957
        }
958
        else if (this.field_175339_B == 0)
959
        {
960
            this.field_175349_r.mouseReleased(mouseX, mouseY, state);
961
        }
962
    }
963
964
    /**
965
     * Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks
966
     */
967
    public void drawScreen(int mouseX, int mouseY, float partialTicks)
968
    {
969
        this.drawDefaultBackground();
970
        this.field_175349_r.drawScreen(mouseX, mouseY, partialTicks);
971
        this.drawCenteredString(this.fontRendererObj, this.field_175341_a, this.width / 2, 2, 16777215);
972
        this.drawCenteredString(this.fontRendererObj, this.field_175333_f, this.width / 2, 12, 16777215);
973
        this.drawCenteredString(this.fontRendererObj, this.field_175335_g, this.width / 2, 22, 16777215);
974
        super.drawScreen(mouseX, mouseY, partialTicks);
975
976
        if (this.field_175339_B != 0)
977
        {
978
            drawRect(0, 0, this.width, this.height, Integer.MIN_VALUE);
979
            this.drawHorizontalLine(this.width / 2 - 91, this.width / 2 + 90, 99, -2039584);
980
            this.drawHorizontalLine(this.width / 2 - 91, this.width / 2 + 90, 185, -6250336);
981
            this.drawVerticalLine(this.width / 2 - 91, 99, 185, -2039584);
982
            this.drawVerticalLine(this.width / 2 + 90, 99, 185, -6250336);
983
            float f = 85.0F;
984
            float f1 = 180.0F;
985
            GlStateManager.disableLighting();
986
            GlStateManager.disableFog();
987
            Tessellator tessellator = Tessellator.getInstance();
988
            WorldRenderer worldrenderer = tessellator.getWorldRenderer();
989
            this.mc.getTextureManager().bindTexture(optionsBackground);
990
            GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
991
            float f2 = 32.0F;
992
            worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
993
            worldrenderer.pos((double)(this.width / 2 - 90), 185.0D, 0.0D).tex(0.0D, 2.65625D).color(64, 64, 64, 64).endVertex();
994
            worldrenderer.pos((double)(this.width / 2 + 90), 185.0D, 0.0D).tex(5.625D, 2.65625D).color(64, 64, 64, 64).endVertex();
995
            worldrenderer.pos((double)(this.width / 2 + 90), 100.0D, 0.0D).tex(5.625D, 0.0D).color(64, 64, 64, 64).endVertex();
996
            worldrenderer.pos((double)(this.width / 2 - 90), 100.0D, 0.0D).tex(0.0D, 0.0D).color(64, 64, 64, 64).endVertex();
997
            tessellator.draw();
998
            this.drawCenteredString(this.fontRendererObj, I18n.format("createWorld.customize.custom.confirmTitle", new Object[0]), this.width / 2, 105, 16777215);
999
            this.drawCenteredString(this.fontRendererObj, I18n.format("createWorld.customize.custom.confirm1", new Object[0]), this.width / 2, 125, 16777215);
1000
            this.drawCenteredString(this.fontRendererObj, I18n.format("createWorld.customize.custom.confirm2", new Object[0]), this.width / 2, 135, 16777215);
1001
            this.field_175352_x.drawButton(this.mc, mouseX, mouseY);
1002
            this.field_175351_y.drawButton(this.mc, mouseX, mouseY);
1003
        }
1004
    }
1005
}
1006

Deobfuscated MCP 1.8.9 source of GuiCustomizeWorldScreen from Marcelektro/MavenMCP-1.8.9 (net/minecraft/client/gui/GuiCustomizeWorldScreen.java), stored verbatim.