SteamWar/SpigotCore
Archiviert
13
0

Merge pull request 'Fix resourceBundleLoading' (#76) from fixMessageLoading into master

Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Lixfel 2020-12-19 12:18:27 +01:00
Commit ea025bb424

Datei anzeigen

@ -35,9 +35,11 @@ import java.util.ResourceBundle;
public class Message { public class Message {
private final String resourceBundleName; private final String resourceBundleName;
private final ClassLoader classLoader;
public Message(String resourceBundleName){ public Message(String resourceBundleName, ClassLoader classLoader){
this.resourceBundleName = resourceBundleName; this.resourceBundleName = resourceBundleName;
this.classLoader = classLoader;
} }
/* Parsing input to a message */ /* Parsing input to a message */
@ -61,7 +63,7 @@ public class Message {
else else
locale = Locale.getDefault(); locale = Locale.getDefault();
ResourceBundle resourceBundle = ResourceBundle.getBundle(resourceBundleName, locale); ResourceBundle resourceBundle = ResourceBundle.getBundle(resourceBundleName, locale, classLoader);
String pattern = ""; String pattern = "";
if(prefixed) if(prefixed)
pattern = resourceBundle.getObject("PREFIX") + " "; pattern = resourceBundle.getObject("PREFIX") + " ";