Fixed a bug where party members didn't have properly colored names, added some optimization and removed some unnecessary API

This commit is contained in:
nossr50
2020-11-09 13:19:54 -08:00
parent 8c5123f494
commit 34d9f70ac0
12 changed files with 124 additions and 95 deletions

View File

@ -1,6 +1,7 @@
package com.gmail.nossr50.util;
import com.gmail.nossr50.api.ItemSpawnReason;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.events.items.McMMOItemSpawnEvent;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.runnables.player.PlayerProfileLoadingTask;
@ -299,4 +300,14 @@ public final class Misc {
public static @NotNull Random getRandom() {
return random;
}
/**
* Whether or not a player is the party leader of a party
*
* @param mmoPlayer target player
* @return true if the player is the party leader
*/
public static boolean isPartyLeader(@NotNull McMMOPlayer mmoPlayer) {
return mmoPlayer.getParty().getLeader().getUniqueId().equals(mmoPlayer.getPlayer().getUniqueId());
}
}

View File

@ -1,7 +1,5 @@
package com.gmail.nossr50.util.text;
import com.gmail.nossr50.chat.author.Author;
import com.gmail.nossr50.datatypes.chat.ChatChannel;
import com.gmail.nossr50.mcMMO;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.ComponentBuilder;
@ -130,8 +128,4 @@ public class TextUtils {
TextComponent componentForm = ofLegacyTextRaw(string);
return customLegacySerializer.serialize(componentForm);
}
public static @NotNull String sanitizeAuthorName(@NotNull Author author, @NotNull ChatChannel chatChannel) {
return sanitizeForSerializer(author.getAuthoredName(ChatChannel.ADMIN));
}
}