Skip to content

Commit

Permalink
Closes #34 - Skip sending scoreboard to Citizens NPCs
Browse files Browse the repository at this point in the history
  • Loading branch information
r4g3baby committed Feb 22, 2022
1 parent 767eec8 commit b45de79
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class ScoreboardTask : BukkitRunnable() {
val possibleBoards = HashMap<Player, List<Scoreboard>>()
for (world in Bukkit.getWorlds()) {
val players = world.players.filter { player ->
// Skip Citizens NPCs
if (player.hasMetadata("NPC")) return@filter false

val playerData = SimpleScore.manager.playersData.get(player)
// No need to waste time computing scoreboards for players that won't see it
if (playerData.isHidden || playerData.isDisabled) return@filter false
Expand Down

0 comments on commit b45de79

Please sign in to comment.