Skip to content

Commit

Permalink
Allow players to have multiple prefixes
Browse files Browse the repository at this point in the history
Signed-off-by: TheMolkaPL <themolkapl@gmail.com>
  • Loading branch information
TheMolkaPL authored and Electroid committed Jan 2, 2020
1 parent 8a7fec6 commit 8dc5855
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/tc/oc/pgm/prefix/ConfigPrefixProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,13 @@ public void removePlayer(UUID uuid) {
private String getPrefixFromConfig(UUID uuid) {
final Player player = Bukkit.getPlayer(uuid);
if (player == null) return "";

StringBuilder builder = new StringBuilder();
for (Prefix prefix : Prefixes.getPrefixes().values()) {
if (player.hasPermission(prefix.permission)) {
return prefix.toString();
builder.append(prefix.toString());
}
}
return "";
return builder.toString();
}
}

0 comments on commit 8dc5855

Please sign in to comment.