Set bop worldtype by default
This commit is contained in:
parent
94dcd5f2d7
commit
b51d9a4dce
|
@ -105,7 +105,7 @@ curseforge {
|
|||
changelog = changelog_file
|
||||
}
|
||||
|
||||
releaseType = 'beta'
|
||||
releaseType = 'alpha'
|
||||
|
||||
mainArtifact(jar) {
|
||||
displayName = "Biomes O' Plenty ${version}"
|
||||
|
|
|
@ -2,6 +2,8 @@ package biomesoplenty.client.handler;
|
|||
|
||||
import biomesoplenty.common.world.BOPWorldTypeUtil;
|
||||
import biomesoplenty.core.BiomesOPlenty;
|
||||
import biomesoplenty.init.ModBiomes;
|
||||
import biomesoplenty.init.ModConfig;
|
||||
import com.mojang.datafixers.util.Function4;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.screen.*;
|
||||
|
@ -71,6 +73,19 @@ public class GuiEventHandler
|
|||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onGuiPostInit(GuiScreenEvent.InitGuiEvent.Post event)
|
||||
{
|
||||
Screen gui = event.getGui();
|
||||
|
||||
if (ModConfig.ClientConfig.useWorldType.get() && gui instanceof CreateWorldScreen)
|
||||
{
|
||||
WorldOptionsScreen optionsScreen = ((CreateWorldScreen)gui).worldGenSettingsComponent;
|
||||
optionsScreen.preset = Optional.of(ModBiomes.biomeGeneratorTypeScreenBOP);
|
||||
optionsScreen.settings = optionsScreen.preset.get().create(optionsScreen.registryHolder, optionsScreen.settings.seed(), optionsScreen.settings.generateFeatures(), optionsScreen.settings.generateBonusChest());
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onGuiDraw(GuiScreenEvent.DrawScreenEvent event)
|
||||
{
|
||||
|
|
|
@ -26,13 +26,13 @@ public class ModConfig
|
|||
public static final ForgeConfigSpec.Builder BUILDER = new ForgeConfigSpec.Builder();
|
||||
public static final ForgeConfigSpec SPEC;
|
||||
|
||||
// TODO: public static final ForgeConfigSpec.BooleanValue useWorldType;
|
||||
public static final ForgeConfigSpec.BooleanValue useWorldType;
|
||||
|
||||
static
|
||||
{
|
||||
BUILDER.comment("Client-related options.");
|
||||
BUILDER.push("gui");
|
||||
// TODO: useWorldType = BUILDER.comment("Select the Biomes O' Plenty world type by default.").define("use_world_type", true);
|
||||
useWorldType = BUILDER.comment("Select the Biomes O' Plenty world type by default.").define("use_world_type", true);
|
||||
BUILDER.pop();
|
||||
|
||||
SPEC = BUILDER.build();
|
||||
|
|
Loading…
Reference in New Issue