Skip to content

Commit

Permalink
remove despawned npcs properly
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jan 18, 2022
1 parent e4fcb29 commit 6ea919c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Expand Up @@ -1226,7 +1226,7 @@ public String toString() {

@Override
public boolean isUnique() {
return entity != null || uuid != null || isFake;
return entity != null || uuid != null || isFake || npc != null;
}

public LocationTag doLocationTag(Attribute attribute) {
Expand Down
Expand Up @@ -62,7 +62,9 @@ public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException
for (Argument arg : scriptEntry) {
if (!scriptEntry.hasObject("entities")
&& arg.matchesArgumentList(EntityTag.class)) {
EntityTag.allowDespawnedNpcs = true;
scriptEntry.addObject("entities", arg.asType(ListTag.class).filter(EntityTag.class, scriptEntry));
EntityTag.allowDespawnedNpcs = false;
}
else if (!scriptEntry.hasObject("world")
&& arg.matchesArgumentType(WorldTag.class)) {
Expand Down

0 comments on commit 6ea919c

Please sign in to comment.