Allow prefix to be configurable.

This commit is contained in:
drtshock 2014-10-21 16:52:16 -05:00 committed by t00thpick1
parent 947f82cb2f
commit 33bd9f7e81
2 changed files with 11 additions and 3 deletions

View File

@ -165,9 +165,11 @@ public class FScoreboard {
}
// Update faction 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);
}
}
}
}

View File

@ -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}"