From 4fba6bfd337a36732748b42371c1819fb4931bac Mon Sep 17 00:00:00 2001 From: aro Date: Wed, 21 Dec 2022 10:35:07 +0100 Subject: [PATCH] investigating: error on Files#copy --- .../net/artelnatif/nicko/config/NickoConfiguration.java | 2 +- .../java/net/artelnatif/nicko/i18n/LocaleManager.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nicko-core/src/main/java/net/artelnatif/nicko/config/NickoConfiguration.java b/nicko-core/src/main/java/net/artelnatif/nicko/config/NickoConfiguration.java index d80a852..b51badf 100644 --- a/nicko-core/src/main/java/net/artelnatif/nicko/config/NickoConfiguration.java +++ b/nicko-core/src/main/java/net/artelnatif/nicko/config/NickoConfiguration.java @@ -23,7 +23,7 @@ public class NickoConfiguration { public ConfigurationSection getStorageSection() { return getConfig().getConfigurationSection("storage"); } - public ConfigurationSection getLocaleSection() { return getBungeecordSection().getConfigurationSection("locale"); } + public ConfigurationSection getLocaleSection() { return getConfig().getConfigurationSection("locale"); } public ConfigurationSection getRedisSection() { return getBungeecordSection().getConfigurationSection("redis"); } diff --git a/nicko-core/src/main/java/net/artelnatif/nicko/i18n/LocaleManager.java b/nicko-core/src/main/java/net/artelnatif/nicko/i18n/LocaleManager.java index 18d169b..89ab54e 100644 --- a/nicko-core/src/main/java/net/artelnatif/nicko/i18n/LocaleManager.java +++ b/nicko-core/src/main/java/net/artelnatif/nicko/i18n/LocaleManager.java @@ -4,6 +4,8 @@ import net.artelnatif.nicko.NickoBukkit; import java.io.*; import java.nio.file.Files; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; import java.util.Arrays; import java.util.Properties; @@ -34,10 +36,8 @@ public class LocaleManager { try { if (resource != null) { - if (!file.exists()) { - instance.getLogger().info("Installed Custom language file as \"custom.properties\""); - Files.copy(resource, file.toPath()); - } + instance.getLogger().info("Installing custom language file as \"custom.properties\""); + Files.copy(resource, Paths.get(file.toURI()), StandardCopyOption.REPLACE_EXISTING); } } catch (IOException e) { // TODO: 12/19/22 Handle error