From 43927ec7f388ee0a30be5ae20502fd4e2f7c929c Mon Sep 17 00:00:00 2001 From: thedarkcolour <30441001+thedarkcolour@users.noreply.github.com> Date: Sun, 12 May 2024 12:40:43 -0700 Subject: [PATCH] Fix overriding default world type when config is set to false --- .gitignore | 1 + .../java/thedarkcolour/exdeorum/client/ClientHandler.java | 2 +- src/main/java/thedarkcolour/exdeorum/config/EConfig.java | 4 ---- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index f3bb7731..b8dc667d 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ out *.iws *.iml .idea +logs # gradle build diff --git a/src/main/java/thedarkcolour/exdeorum/client/ClientHandler.java b/src/main/java/thedarkcolour/exdeorum/client/ClientHandler.java index 50d130f0..75440d68 100644 --- a/src/main/java/thedarkcolour/exdeorum/client/ClientHandler.java +++ b/src/main/java/thedarkcolour/exdeorum/client/ClientHandler.java @@ -151,7 +151,7 @@ public class ClientHandler { // Sets Ex Deorum world type as default, or use SkyBlock Builder if it is installed private static void onScreenOpen(ScreenEvent.Opening event) { - if (event.getNewScreen() instanceof CreateWorldScreen screen) { + if (event.getNewScreen() instanceof CreateWorldScreen screen && EConfig.COMMON.setVoidWorldAsDefault.get()) { var ctx = screen.getUiState().getSettings(); screen.getUiState().setWorldType(new WorldCreationUiState.WorldTypeEntry(ctx.worldgenLoadContext().registryOrThrow(Registries.WORLD_PRESET).getHolder(ASMHooks.overrideDefaultWorldPreset()).orElse(null))); } diff --git a/src/main/java/thedarkcolour/exdeorum/config/EConfig.java b/src/main/java/thedarkcolour/exdeorum/config/EConfig.java index c1a3ba98..aac4e03b 100644 --- a/src/main/java/thedarkcolour/exdeorum/config/EConfig.java +++ b/src/main/java/thedarkcolour/exdeorum/config/EConfig.java @@ -40,7 +40,6 @@ public class EConfig { public static class Client { public final BooleanValue useFastInfestedLeaves; - public final BooleanValue setVoidWorldAsDefault; public Client(ForgeConfigSpec.Builder builder) { builder.comment("Client configuration for Ex Deorum").push("client"); @@ -48,9 +47,6 @@ public class EConfig { this.useFastInfestedLeaves = builder .comment("Whether to use a simplified renderer for infested leaves (reduces FPS lag with lots of infested trees)") .define("use_fast_infested_leaves", false); - this.setVoidWorldAsDefault = builder - .comment("Whether the Void World type is set as the default world preset. (DEPRECATED - USE THE OPTION IN THE COMMON CONFIG INSTEAD)") - .define("set_void_world_as_default", true); builder.pop(); }