mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-27 11:14:44 +02:00
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:
@ -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());
|
||||
}
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user