Merge branch 'worldtype_customize' of https://github.com/ExtrabiomesXL/forge into gh-updates
This commit is contained in:
commit
8f6963fabf
2 changed files with 53 additions and 1 deletions
|
@ -0,0 +1,20 @@
|
|||
--- ../src_base/minecraft/net/minecraft/client/gui/GuiCreateWorld.java
|
||||
+++ ../src_work/minecraft/net/minecraft/client/gui/GuiCreateWorld.java
|
||||
@@ -375,7 +375,7 @@
|
||||
}
|
||||
else if (par1GuiButton.id == 8)
|
||||
{
|
||||
- this.mc.displayGuiScreen(new GuiCreateFlatWorld(this, this.field_82290_a));
|
||||
+ WorldType.worldTypes[this.worldTypeId].onCustomizeButton(this.mc, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -393,7 +393,7 @@
|
||||
this.buttonBonusItems.drawButton = this.moreOptions;
|
||||
this.buttonWorldType.drawButton = this.moreOptions;
|
||||
this.buttonAllowCommands.drawButton = this.moreOptions;
|
||||
- this.buttonCustomize.drawButton = this.moreOptions && WorldType.worldTypes[this.worldTypeId] == WorldType.FLAT;
|
||||
+ this.buttonCustomize.drawButton = this.moreOptions && (WorldType.worldTypes[this.worldTypeId].isCustomizable());
|
||||
StringTranslate var2;
|
||||
|
||||
if (this.moreOptions)
|
|
@ -1,6 +1,16 @@
|
|||
--- ../src_base/minecraft/net/minecraft/world/WorldType.java
|
||||
+++ ../src_work/minecraft/net/minecraft/world/WorldType.java
|
||||
@@ -224,4 +224,14 @@
|
||||
@@ -10,6 +10,9 @@
|
||||
import com.google.common.collect.ObjectArrays;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
+import net.minecraft.client.Minecraft;
|
||||
+import net.minecraft.client.gui.GuiCreateFlatWorld;
|
||||
+import net.minecraft.client.gui.GuiCreateWorld;
|
||||
import net.minecraft.world.*;
|
||||
import net.minecraft.world.gen.*;
|
||||
import net.minecraft.world.biome.*;
|
||||
@@ -224,4 +227,36 @@
|
||||
* Called when 'Create New World' button is pressed before starting game
|
||||
*/
|
||||
public void onGUICreateWorldPress() { }
|
||||
|
@ -13,5 +23,27 @@
|
|||
+ public int getSpawnFuzz()
|
||||
+ {
|
||||
+ return 20;
|
||||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * 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_82290_a));
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /*
|
||||
+ * Should world creation GUI show 'Customize' button for this world type?
|
||||
+ * @return if this world type has customization parameters
|
||||
+ */
|
||||
+ public boolean isCustomizable()
|
||||
+ {
|
||||
+ return this == FLAT;
|
||||
+ }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue