From 4c290d5d3c71f7790e4c0397717fecc625eac958 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Fri, 18 Dec 2020 15:48:34 +0100 Subject: [PATCH] Fix resourceBundleLoading --- SpigotCore_Main/src/de/steamwar/message/Message.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/SpigotCore_Main/src/de/steamwar/message/Message.java b/SpigotCore_Main/src/de/steamwar/message/Message.java index 077f78b..065a560 100644 --- a/SpigotCore_Main/src/de/steamwar/message/Message.java +++ b/SpigotCore_Main/src/de/steamwar/message/Message.java @@ -35,9 +35,11 @@ import java.util.ResourceBundle; public class Message { private final String resourceBundleName; + private final ClassLoader classLoader; - public Message(String resourceBundleName){ + public Message(String resourceBundleName, ClassLoader classLoader){ this.resourceBundleName = resourceBundleName; + this.classLoader = classLoader; } /* Parsing input to a message */ @@ -61,7 +63,7 @@ public class Message { else locale = Locale.getDefault(); - ResourceBundle resourceBundle = ResourceBundle.getBundle(resourceBundleName, locale); + ResourceBundle resourceBundle = ResourceBundle.getBundle(resourceBundleName, locale, classLoader); String pattern = ""; if(prefixed) pattern = resourceBundle.getObject("PREFIX") + " "; -- 2.39.5