From a28a7123af6b0cd903c2c588bd21956c2742eeb2 Mon Sep 17 00:00:00 2001 From: Adubbz Date: Sat, 3 Dec 2016 09:03:20 +1100 Subject: [PATCH] Fixed superflat world customization with 'default to bop worldtype' config option enabled. Closes #686 --- .../biomesoplenty/common/handler/GuiEventHandler.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/biomesoplenty/common/handler/GuiEventHandler.java b/src/main/java/biomesoplenty/common/handler/GuiEventHandler.java index 3b4c566d7..aa6e0dcd9 100644 --- a/src/main/java/biomesoplenty/common/handler/GuiEventHandler.java +++ b/src/main/java/biomesoplenty/common/handler/GuiEventHandler.java @@ -12,6 +12,7 @@ import biomesoplenty.common.config.MiscConfigurationHandler; import biomesoplenty.common.init.ModBiomes; import net.minecraft.client.gui.GuiCreateWorld; import net.minecraft.client.gui.GuiScreen; +import net.minecraft.world.WorldType; import net.minecraftforge.client.event.GuiScreenEvent.InitGuiEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.relauncher.Side; @@ -24,12 +25,14 @@ public class GuiEventHandler public void onPreInitCreateWorld(InitGuiEvent.Pre event) { GuiScreen screenGui = event.getGui(); - + if (MiscConfigurationHandler.useBoPWorldTypeDefault && screenGui instanceof GuiCreateWorld) { GuiCreateWorld createWorldGui = (GuiCreateWorld)screenGui; - - createWorldGui.selectedIndex = ModBiomes.worldTypeBOP.getWorldTypeID(); + + // Do not change back when returning from the 'Customize' screen + if (createWorldGui.selectedIndex == WorldType.DEFAULT.getWorldTypeID()) + createWorldGui.selectedIndex = ModBiomes.worldTypeBOP.getWorldTypeID(); } } }