Fix overriding default world type when config is set to false
This commit is contained in:
parent
47ee5c571b
commit
43927ec7f3
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -12,6 +12,7 @@ out
|
||||||
*.iws
|
*.iws
|
||||||
*.iml
|
*.iml
|
||||||
.idea
|
.idea
|
||||||
|
logs
|
||||||
|
|
||||||
# gradle
|
# gradle
|
||||||
build
|
build
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,7 @@ public class ClientHandler {
|
||||||
|
|
||||||
// Sets Ex Deorum world type as default, or use SkyBlock Builder if it is installed
|
// Sets Ex Deorum world type as default, or use SkyBlock Builder if it is installed
|
||||||
private static void onScreenOpen(ScreenEvent.Opening event) {
|
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();
|
var ctx = screen.getUiState().getSettings();
|
||||||
screen.getUiState().setWorldType(new WorldCreationUiState.WorldTypeEntry(ctx.worldgenLoadContext().registryOrThrow(Registries.WORLD_PRESET).getHolder(ASMHooks.overrideDefaultWorldPreset()).orElse(null)));
|
screen.getUiState().setWorldType(new WorldCreationUiState.WorldTypeEntry(ctx.worldgenLoadContext().registryOrThrow(Registries.WORLD_PRESET).getHolder(ASMHooks.overrideDefaultWorldPreset()).orElse(null)));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,6 @@ public class EConfig {
|
||||||
|
|
||||||
public static class Client {
|
public static class Client {
|
||||||
public final BooleanValue useFastInfestedLeaves;
|
public final BooleanValue useFastInfestedLeaves;
|
||||||
public final BooleanValue setVoidWorldAsDefault;
|
|
||||||
|
|
||||||
public Client(ForgeConfigSpec.Builder builder) {
|
public Client(ForgeConfigSpec.Builder builder) {
|
||||||
builder.comment("Client configuration for Ex Deorum").push("client");
|
builder.comment("Client configuration for Ex Deorum").push("client");
|
||||||
|
|
@ -48,9 +47,6 @@ public class EConfig {
|
||||||
this.useFastInfestedLeaves = builder
|
this.useFastInfestedLeaves = builder
|
||||||
.comment("Whether to use a simplified renderer for infested leaves (reduces FPS lag with lots of infested trees)")
|
.comment("Whether to use a simplified renderer for infested leaves (reduces FPS lag with lots of infested trees)")
|
||||||
.define("use_fast_infested_leaves", false);
|
.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();
|
builder.pop();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user