use GM methods for prefix/suffix so we return group values if no player

value exists.
This commit is contained in:
Sleaker 2012-02-19 09:11:58 -08:00
parent 3cb2a172f7
commit 2cc2dee7eb

View File

@ -266,12 +266,30 @@ public class Chat_GroupManager extends Chat {
@Override
public String getPlayerPrefix(String worldName, String playerName) {
return getPlayerInfoString(worldName, playerName, "prefix", "");
AnjoPermissionsHandler handler;
if (worldName == null) {
handler = groupManager.getWorldsHolder().getWorldPermissionsByPlayerName(playerName);
} else {
handler = groupManager.getWorldsHolder().getWorldPermissions(worldName);
}
if (handler == null) {
return "";
}
return handler.getUserPrefix(playerName);
}
@Override
public String getPlayerSuffix(String worldName, String playerName) {
return getPlayerInfoString(worldName, playerName, "suffix", "");
AnjoPermissionsHandler handler;
if (worldName == null) {
handler = groupManager.getWorldsHolder().getWorldPermissionsByPlayerName(playerName);
} else {
handler = groupManager.getWorldsHolder().getWorldPermissions(worldName);
}
if (handler == null) {
return "";
}
return handler.getUserSuffix(playerName);
}
@Override