SpawnReason.COMMAND should try to load the destination spawn location

This commit is contained in:
fullwall 2020-03-28 01:20:20 +08:00
parent 947f4301f3
commit 4cc3c40c87
2 changed files with 1 additions and 3 deletions

View File

@ -1047,7 +1047,6 @@ public class NPCCommands {
min = 1,
permission = "citizens.npc.moveto")
public void moveto(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
// Spawn the NPC if it isn't spawned to prevent NPEs
if (!npc.isSpawned()) {
npc.spawn(npc.getTrait(CurrentLocation.class).getLocation(), SpawnReason.COMMAND);
}
@ -2024,7 +2023,6 @@ public class NPCCommands {
public void tphere(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
if (args.getSenderLocation() == null)
throw new ServerCommandException();
// Spawn the NPC if it isn't spawned to prevent NPEs
if (!npc.isSpawned()) {
npc.spawn(args.getSenderLocation(), SpawnReason.COMMAND);
if (!sender.hasPermission("citizens.npc.tphere.multiworld")

View File

@ -231,7 +231,7 @@ public class CitizensNPC extends AbstractNPC {
at = at.clone();
if (reason == SpawnReason.CHUNK_LOAD) {
if (reason == SpawnReason.CHUNK_LOAD || reason == SpawnReason.COMMAND) {
at.getChunk().load();
}