Fixed parsing [gamemode] in placeholders (#1574)

This commit is contained in:
BONNe 2020-11-17 01:58:58 +02:00 committed by GitHub
parent 5321e1dda6
commit 93d7fad860
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -112,7 +112,7 @@ public class PlaceholderAPIHook extends PlaceholderHook {
public String replacePlaceholders(@NonNull Player player, @NonNull String string) {
// Transform [gamemode] in string to the game mode description name, or remove it for the default replacement
String newString = BentoBox.getInstance().getIWM().getAddon(player.getWorld()).map(gm ->
string.replace(TextVariables.GAMEMODE, gm.getDescription().getName())
string.replace(TextVariables.GAMEMODE, gm.getDescription().getName().toLowerCase())
).orElse(removeGMPlaceholder(string));
return PlaceholderAPI.setPlaceholders(player, newString);
}