From 4b4529c590aedcb6c5577aac2de673048229c072 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Mon, 16 May 2022 13:26:53 -0400 Subject: [PATCH] Prevent NPE with new language overrides --- .../java/org/geysermc/platform/fabric/GeyserFabricMod.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/GeyserFabricMod.java b/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/GeyserFabricMod.java index 3c175896f..f6a657bba 100644 --- a/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/GeyserFabricMod.java +++ b/bootstrap/fabric/src/main/java/org/geysermc/platform/fabric/GeyserFabricMod.java @@ -97,13 +97,15 @@ public class GeyserFabricMod implements ModInitializer, GeyserBootstrap { @Override public void onEnable() { - GeyserLocale.init(this); - dataFolder = FabricLoader.getInstance().getConfigDir().resolve("Geyser-Fabric"); if (!dataFolder.toFile().exists()) { //noinspection ResultOfMethodCallIgnored dataFolder.toFile().mkdir(); } + + // Init dataFolder first as local language overrides call getConfigFolder() + GeyserLocale.init(this); + try { File configFile = FileUtils.fileOrCopiedFromResource(dataFolder.resolve("config.yml").toFile(), "config.yml", (x) -> x.replaceAll("generateduuid", UUID.randomUUID().toString()), this);