From 33bd9f7e8188c4695a56cf9cb21451232b8b49f7 Mon Sep 17 00:00:00 2001 From: drtshock Date: Tue, 21 Oct 2014 16:52:16 -0500 Subject: [PATCH] Allow prefix to be configurable. --- .../massivecraft/factions/scoreboards/FScoreboard.java | 8 +++++--- src/main/resources/config.yml | 6 ++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/scoreboards/FScoreboard.java b/src/main/java/com/massivecraft/factions/scoreboards/FScoreboard.java index 9ac2925a..55105f9f 100644 --- a/src/main/java/com/massivecraft/factions/scoreboards/FScoreboard.java +++ b/src/main/java/com/massivecraft/factions/scoreboards/FScoreboard.java @@ -165,9 +165,11 @@ public class FScoreboard { } // Update faction prefix - String prefix = faction.getRelationTo(this.fplayer).getColor() + "[" + faction.getTag().substring(0, Math.min(9, faction.getTag().length())) + "] " + ChatColor.RESET; - if (team.getPrefix() == null || !team.getPrefix().equals(prefix)) { - team.setPrefix(prefix); + if(P.p.getConfig().getBoolean("scoreboard.default-prefixes", false)) { + String prefix = faction.getRelationTo(this.fplayer).getColor() + "[" + faction.getTag().substring(0, Math.min(9, faction.getTag().length())) + "] " + ChatColor.RESET; + if (team.getPrefix() == null || !team.getPrefix().equals(prefix)) { + team.setPrefix(prefix); + } } } } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 6c2b9176..e72c1972 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -52,9 +52,15 @@ scoreboard: # Replace {name} - player's name. {faction} - player's faction title, factionless if none. # {totalOnline} - total players on the server. {balance} - player's balance. # {maxPower} - player's max power. + default-enabled: false # Default to false to keep original functionality. default-title: "i love drt" # Can use any of the values from above but this won't update once it's set (so don't set {balance}). default-update-interval: 2 # in seconds. + + # This will show faction prefixes colored based on relation on nametags and in the tab. + # The scoreboard needs to be enabled for this to work. + default-prefixes: true + default: - "&6Your Faction" - "{faction}"