From fa60eeb121bbe3b089999a844173b72a0c40b9df Mon Sep 17 00:00:00 2001 From: Lixfel Date: Fri, 5 Feb 2021 13:25:46 +0100 Subject: [PATCH] Test ttl Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/Message.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/bungeecore/Message.java b/src/de/steamwar/bungeecore/Message.java index 096878a..63d851f 100644 --- a/src/de/steamwar/bungeecore/Message.java +++ b/src/de/steamwar/bungeecore/Message.java @@ -34,6 +34,13 @@ import java.util.ResourceBundle; public class Message { + private static final ResourceBundle.Control CONTROL = new ResourceBundle.Control() { + @Override + public long getTimeToLive(String arg0, Locale arg1) { + return 60000; //Cache only 1 minute + } + }; + public static TextComponent parseToComponent(String message, boolean prefixed, CommandSender sender, Object... params){ return new TextComponent(TextComponent.fromLegacyText(parse(message, prefixed, sender, params))); } @@ -53,7 +60,7 @@ public class Message { if(locale == null) locale = Locale.getDefault(); - ResourceBundle resourceBundle = ResourceBundle.getBundle("de.steamwar.messages.BungeeCore", locale); + ResourceBundle resourceBundle = ResourceBundle.getBundle("de.steamwar.messages.BungeeCore", locale, CONTROL); String pattern = ""; if(prefixed) pattern = resourceBundle.getObject("PREFIX") + " ";