From de8320f21951f6ad17340e4a13add8f9cbd15284 Mon Sep 17 00:00:00 2001 From: TudbuT Date: Wed, 29 May 2024 21:34:23 +0200 Subject: [PATCH] make seedoverlay not spam log sometimes, add save config btn --- .../com/baseband/client/configuration/Configuration.java | 4 ++++ .../java/com/baseband/client/module/client/Client.java | 7 +++++++ .../baseband/client/util/adapt/SimpleWorldGenerator.java | 3 +++ 3 files changed, 14 insertions(+) diff --git a/Client/src/main/java/com/baseband/client/configuration/Configuration.java b/Client/src/main/java/com/baseband/client/configuration/Configuration.java index 7d448b9..9d249b4 100644 --- a/Client/src/main/java/com/baseband/client/configuration/Configuration.java +++ b/Client/src/main/java/com/baseband/client/configuration/Configuration.java @@ -30,4 +30,8 @@ public class Configuration { INSTANCE.registry.unregister(handle.name, handle.tcn); handle.tcn = null; } + + public static void save() { + INSTANCE.registry.save(); + } } diff --git a/Client/src/main/java/com/baseband/client/module/client/Client.java b/Client/src/main/java/com/baseband/client/module/client/Client.java index 8f1cce1..9f25606 100644 --- a/Client/src/main/java/com/baseband/client/module/client/Client.java +++ b/Client/src/main/java/com/baseband/client/module/client/Client.java @@ -1,5 +1,6 @@ package com.baseband.client.module.client; +import com.baseband.client.configuration.Configuration; import com.baseband.client.configuration.annotation.Config; import com.baseband.client.util.interact.ServerDataManager; import com.baseband.client.util.misc.Description; @@ -51,6 +52,12 @@ public class Client extends Feature { @Config("Clear targets") public KeyBind clearTargetsBind = new KeyBind(null, this::clearTargets, this); + @Trigger("Save config") + public void saveConfig() { + Configuration.save(); + BaseBand.notify("Config saved to disk"); + } + public GuiTheme.ITheme getTheme() { return theme; diff --git a/Client/src/main/java/com/baseband/client/util/adapt/SimpleWorldGenerator.java b/Client/src/main/java/com/baseband/client/util/adapt/SimpleWorldGenerator.java index cee2cb6..d26c3c5 100644 --- a/Client/src/main/java/com/baseband/client/util/adapt/SimpleWorldGenerator.java +++ b/Client/src/main/java/com/baseband/client/util/adapt/SimpleWorldGenerator.java @@ -120,6 +120,9 @@ public class SimpleWorldGenerator implements IChunkProvider { continue; } } + try { + FieldFinder.findUnmarked(Chunk.class, ChunkPos.class, 0).set(null, null); + } catch (Exception ignored) {} return false; }