Update
This commit is contained in:
parent
7d452469c4
commit
79e9cd65a5
36 changed files with 320 additions and 131 deletions
|
|
@ -56,6 +56,21 @@ public class PlayerTitles {
|
|||
}
|
||||
}
|
||||
|
||||
public void removeTitle(String title) {
|
||||
if (hasTitle(title)) {
|
||||
String[] newTitles = new String[playerTitles.length - 1];
|
||||
int index = 0;
|
||||
for (String playerTitle : playerTitles) {
|
||||
if (!playerTitle.equals(title)) {
|
||||
newTitles[index++] = playerTitle;
|
||||
}
|
||||
}
|
||||
PlayerStats.getPlayerStats(player).setStat("titles", new Gson().toJson(newTitles));
|
||||
GrimmsServer.instance.getServer().broadcastMessage("Title " + title + " was revoked from " + player.getDisplayName() + ".");
|
||||
PlayerTitleManager.checkTitles(player);
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasTitle(String title) {
|
||||
for (String playerTitle : playerTitles) {
|
||||
if (playerTitle.equals(title)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue