Removed stream function.
Stream functions generate new objects. Looping through the values is more efficient.
This commit is contained in:
@@ -59,7 +59,15 @@ public abstract class NPC {
|
|||||||
|
|
||||||
public void destroy() {
|
public void destroy() {
|
||||||
NPCManager.remove(this);
|
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() {
|
public Set<UUID> getShown() {
|
||||||
|
|||||||
Reference in New Issue
Block a user