Fix /npc remove --world

This commit is contained in:
fullwall 2022-04-19 18:13:40 +08:00
parent 719f115f0c
commit 0a6225a8a3
1 changed files with 1 additions and 1 deletions

View File

@ -1802,7 +1802,7 @@ public class NPCCommands {
if (args.hasValueFlag("world")) {
String world = args.getFlag("world");
for (NPC rem : Lists.newArrayList(CitizensAPI.getNPCRegistry())) {
Location loc = npc.getStoredLocation();
Location loc = rem.getStoredLocation();
if (loc != null && loc.getWorld() != null && (loc.getWorld().getUID().toString().equals(world)
|| loc.getWorld().getName().equalsIgnoreCase(world))) {
history.add(sender, new RemoveNPCHistoryItem(rem));