From dee87975b0d6a45055ecc9ada68eb9c9d1b76bd5 Mon Sep 17 00:00:00 2001 From: TheRBZ Date: Tue, 6 Jul 2021 12:04:17 +0100 Subject: [PATCH] Allow customisation of %pvptoggle_pvp_state% --- src/com/github/aasmus/pvptoggle/utils/PlaceholderAPIHook.java | 2 +- src/resources/config.yml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/com/github/aasmus/pvptoggle/utils/PlaceholderAPIHook.java b/src/com/github/aasmus/pvptoggle/utils/PlaceholderAPIHook.java index f4c5be2..a380707 100644 --- a/src/com/github/aasmus/pvptoggle/utils/PlaceholderAPIHook.java +++ b/src/com/github/aasmus/pvptoggle/utils/PlaceholderAPIHook.java @@ -20,7 +20,7 @@ public String onPlaceholderRequest(Player player, String identifier) { //Placeholder: %pvptoggle_positive_rep% if(identifier.equals("pvp_state")) { - return PvPToggle.instance.players.get(player.getUniqueId()) ? "&aOff" : "&cOn"; + return PvPToggle.instance.players.get(player.getUniqueId()) ? PvPToggle.instance.getConfig().getString("MESSAGES.PLACEHOLDER_OFF") : PvPToggle.instance.getConfig().getString("MESSAGES.PLACEHOLDER_ON"); } return null; diff --git a/src/resources/config.yml b/src/resources/config.yml index bfbadcd..d7045ca 100644 --- a/src/resources/config.yml +++ b/src/resources/config.yml @@ -32,4 +32,6 @@ MESSAGES: PVP_WORLD_CHANGE_DISABLED: '&aYour pvp has been disabled because the world you entered does not allow pvp.' PVP_WORLD_CHANGE_REQUIRED: '&aYour pvp has been enabled because the world you enter requires pvp.' PVP_WORLD_CANNOT_CHANGE_SELF: '&cYou cannot change pvp state in this world.' - PVP_WORLD_CANNOT_CHANGE_OTHERS: '&cYou cannot change pvp state in that world.' \ No newline at end of file + PVP_WORLD_CANNOT_CHANGE_OTHERS: '&cYou cannot change pvp state in that world.' + PLACEHOLDER_OFF: '&aOff' + PLACEHOLDER_ON: '&cOn' \ No newline at end of file