mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-16 20:31:30 +01:00
SpawnReason.COMMAND should try to load the destination spawn location
This commit is contained in:
parent
947f4301f3
commit
4cc3c40c87
@ -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")
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user