From 0d9f97b20d67bedd5cb44c3554e52d24822222c8 Mon Sep 17 00:00:00 2001 From: legoraft <50689727+legoraft@users.noreply.github.com> Date: Thu, 16 Nov 2023 10:08:42 +0100 Subject: [PATCH] saved config on unloading of the world --- src/main/java/com/survivaltweaks/survivalTweaks.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/com/survivaltweaks/survivalTweaks.java b/src/main/java/com/survivaltweaks/survivalTweaks.java index cf56442..351e79f 100644 --- a/src/main/java/com/survivaltweaks/survivalTweaks.java +++ b/src/main/java/com/survivaltweaks/survivalTweaks.java @@ -32,6 +32,10 @@ public void onInitialize() { CONFIG.load(configDir.resolve("survivaltweaks.properties")); CONFIG_PATH = configDir.resolve("survivaltweaks.properties"); })); + + ServerWorldEvents.UNLOAD.register(((server, world) -> { + CONFIG.save(CONFIG_PATH); + })); } }