Removed stream function.
Stream functions generate new objects. Looping through the values is more efficient.
This commit is contained in:
parent
0387732482
commit
06b034c86e
|
@ -59,7 +59,15 @@ public abstract class NPC {
|
|||
|
||||
public void destroy() {
|
||||
NPCManager.remove(this);
|
||||
shown.stream().filter(u -> !autoHidden.contains(u)).forEach(u -> hide(Bukkit.getPlayer(u), true));
|
||||
|
||||
// Destroy NPC for every player that is still seeing it.
|
||||
for (UUID uuid : shown) {
|
||||
if (autoHidden.contains(uuid)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
hide(Bukkit.getPlayer(uuid), true);
|
||||
}
|
||||
}
|
||||
|
||||
public Set<UUID> getShown() {
|
||||
|
|
Loading…
Reference in New Issue