From bd9e3e5d94fe2dfae29c3f0476ec7275ef7ee04b Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 15 Mar 2022 11:40:20 +0100 Subject: [PATCH 1/3] Maybe fix resource bundle --- src/de/steamwar/bungeecore/Message.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/de/steamwar/bungeecore/Message.java b/src/de/steamwar/bungeecore/Message.java index a54694e..447b840 100644 --- a/src/de/steamwar/bungeecore/Message.java +++ b/src/de/steamwar/bungeecore/Message.java @@ -41,6 +41,11 @@ public class Message { public long getTimeToLive(String arg0, Locale arg1) { return 60000; //Cache only 1 minute } + + @Override + public boolean needsReload(String baseName, Locale locale, String format, ClassLoader loader, ResourceBundle bundle, long loadTime) { + return System.currentTimeMillis() - loadTime > 60000; //Reload if older than 1 minute + } }; public static TextComponent parseToComponent(String message, boolean prefixed, CommandSender sender, Object... params){ From 9047c8ef6ac7cb944ee72a6648d992f1a1c239cc Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 15 Mar 2022 14:22:12 +0100 Subject: [PATCH 2/3] Fix Message --- src/de/steamwar/bungeecore/Message.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/Message.java b/src/de/steamwar/bungeecore/Message.java index 447b840..f995694 100644 --- a/src/de/steamwar/bungeecore/Message.java +++ b/src/de/steamwar/bungeecore/Message.java @@ -44,7 +44,7 @@ public class Message { @Override public boolean needsReload(String baseName, Locale locale, String format, ClassLoader loader, ResourceBundle bundle, long loadTime) { - return System.currentTimeMillis() - loadTime > 60000; //Reload if older than 1 minute + return true; } }; @@ -71,7 +71,9 @@ public class Message { private static String parse(String message, boolean prefixed, Locale locale, Object... params){ if(locale == null) locale = Locale.getDefault(); + System.out.println("parse " + message + " " + locale); ResourceBundle resourceBundle = ResourceBundle.getBundle("de.steamwar.messages.BungeeCore", locale, CONTROL); + System.out.println(resourceBundle); String pattern = ""; if(prefixed) pattern = resourceBundle.getObject("PREFIX") + " "; From 6ddfe27ed14118aa7c70b5c6007764ac7540aa53 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Tue, 15 Mar 2022 14:23:28 +0100 Subject: [PATCH 3/3] Remove useless sout --- src/de/steamwar/bungeecore/Message.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/de/steamwar/bungeecore/Message.java b/src/de/steamwar/bungeecore/Message.java index f995694..992cedf 100644 --- a/src/de/steamwar/bungeecore/Message.java +++ b/src/de/steamwar/bungeecore/Message.java @@ -71,9 +71,7 @@ public class Message { private static String parse(String message, boolean prefixed, Locale locale, Object... params){ if(locale == null) locale = Locale.getDefault(); - System.out.println("parse " + message + " " + locale); ResourceBundle resourceBundle = ResourceBundle.getBundle("de.steamwar.messages.BungeeCore", locale, CONTROL); - System.out.println(resourceBundle); String pattern = ""; if(prefixed) pattern = resourceBundle.getObject("PREFIX") + " ";