Closed Nuckerr closed 1 year ago
Can you show me an example?
The code looks like this:
glow.clearGlowing(player)
team.players
.filter { it.uniqueId != player.uniqueId }
.filter { it.isOnline }
.map { it.player!! }
.filter { it.gameMode != GameMode.SPECTATOR }
.forEach {
val color = getColorTeamAsInt(getTeamId(team)!!)
val textColor = TextColor.color(color)
glow.setGlowing(it, player, NamedTextColor.nearestTo(textColor).toChatColor())
glow.setGlowing(player, it, NamedTextColor.nearestTo(textColor).toChatColor())
}
fun GlowingEntities.clearGlowing(entity: Entity) {
Bukkit.getOnlinePlayers().forEach {
unsetGlowing(entity, it)
if(entity is Player) unsetGlowing(it, entity);
}
}
Ah yeah it's because GlowingEntities change the team to change the color (related to #5 and #9). To avoid that, set the "color" parameter of the "setGlowing" method to null: the player will now glow with its team color.
When I set a glow, it changes the player's nametag. How can I avoid this?