Fix placeholder replacements not working

This commit is contained in:
Phoenix616 2020-09-16 00:28:43 +01:00
parent 73a49f779b
commit dea38a1579
No known key found for this signature in database
GPG Key ID: 40E2321E71738EB0

View File

@ -117,8 +117,6 @@ public class RandomTeleport extends JavaPlugin implements RandomTeleportAPI {
.toArray(Material[]::new);
signVariables = getConfig().getStringList("sign-variables").stream().map(String::toLowerCase).collect(Collectors.toSet());
lang = new LanguageManager(this, getConfig().getString("lang"));
lang.setPlaceholderPrefix("{");
lang.setPlaceholderSuffix("}");
}
private void initOptionParsers() {
@ -288,7 +286,11 @@ public class RandomTeleport extends JavaPlugin implements RandomTeleportAPI {
}
public BaseComponent[] getComponentMessage(CommandSender sender, String key, String... replacements) {
return MineDown.parse(getLang(sender, key), replacements);
return new MineDown(getLang(sender, key))
.placeholderPrefix("{")
.placeholderSuffix("}")
.replace(replacements)
.toComponent();
}
public String getTextMessage(CommandSender sender, String key, String... replacements) {