This commit is contained in:
tyuXX 2025-04-04 17:54:24 +03:00
parent 7d452469c4
commit 79e9cd65a5
36 changed files with 320 additions and 131 deletions

View file

@ -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)) {