Skip to content

Commit ddee6c5

Browse files
committed
Add configuration for boolean placeholders
1 parent 84c5b5b commit ddee6c5

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

pvpmanager/src/main/java/me/chancesd/pvpmanager/integration/hook/PlaceHolderAPI.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import me.chancesd.pvpmanager.setting.Conf;
1313
import me.chancesd.pvpmanager.utils.CombatUtils;
1414
import me.chancesd.sdutils.utils.Utils;
15-
import me.clip.placeholderapi.PlaceholderAPIPlugin;
1615
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
1716

1817
public class PlaceHolderAPI extends PlaceholderExpansion {
@@ -85,9 +84,9 @@ public String onPlaceholderRequest(final Player player, final String identifier)
8584

8685
private String getPAPIBoolean(final boolean value) {
8786
if (value)
88-
return PlaceholderAPIPlugin.booleanTrue();
87+
return Conf.PLACEHOLDER_BOOLEAN_TRUE.asString();
8988
else
90-
return PlaceholderAPIPlugin.booleanFalse();
89+
return Conf.PLACEHOLDER_BOOLEAN_FALSE.asString();
9190
}
9291

9392
private void registerPlaceholder(final String name) {

pvpmanager/src/main/java/me/chancesd/pvpmanager/setting/Conf.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ public enum Conf {
157157
METRICS_OPT_OUT("Metrics", "Opt-out", false, Boolean.class),
158158
HARMFUL_POTIONS("Harmful Potions", "", Conf::getSet, List.class, Set.class),
159159

160+
PLACEHOLDER_BOOLEAN_TRUE("Placeholders", "Boolean Format.True", ChatUtils::colorize, String.class, String.class),
161+
PLACEHOLDER_BOOLEAN_FALSE("Placeholders", "Boolean Format.False", ChatUtils::colorize, String.class, String.class),
162+
160163
DEBUG_MODE("Debug Mode", "", Conf::setDebug, Boolean.class, Boolean.class);
161164

162165
public enum DropMode {

pvpmanager/src/main/resources/config.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,12 @@ Database:
296296
Password: '12345'
297297
Database: minecraft
298298

299+
# PlaceholderAPI boolean formatting
300+
Placeholders:
301+
Boolean Format:
302+
True: '&a✓'
303+
False: '&c✗'
304+
299305
# Should PvPManager be allowed to check for updates and tell you about them
300306
# Auto Update - After checking should the update be downloaded automatically for you?
301307
Update Check:

0 commit comments

Comments
 (0)