mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 18:45:29 +01:00
Change /npc mount permission, force chunk load on spawning due to chunk load
This commit is contained in:
parent
2efdd3fcfe
commit
d0b358a27c
@ -634,7 +634,7 @@ public class EventListen implements Listener {
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return npc.spawn(spawn);
|
return npc.spawn(spawn, SpawnReason.CHUNK_LOAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void storeForRespawn(NPC npc) {
|
private void storeForRespawn(NPC npc) {
|
||||||
|
@ -954,7 +954,7 @@ public class NPCCommands {
|
|||||||
min = 1,
|
min = 1,
|
||||||
max = 1,
|
max = 1,
|
||||||
flags = "c",
|
flags = "c",
|
||||||
permission = "citizens.npc.controllable")
|
permission = "citizens.npc.mount")
|
||||||
public void mount(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
|
public void mount(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
|
||||||
if (args.hasValueFlag("onnpc")) {
|
if (args.hasValueFlag("onnpc")) {
|
||||||
NPC mount;
|
NPC mount;
|
||||||
|
@ -226,6 +226,10 @@ public class CitizensNPC extends AbstractNPC {
|
|||||||
|
|
||||||
at = at.clone();
|
at = at.clone();
|
||||||
|
|
||||||
|
if (reason == SpawnReason.CHUNK_LOAD) {
|
||||||
|
at.getChunk().load();
|
||||||
|
}
|
||||||
|
|
||||||
getTrait(CurrentLocation.class).setLocation(at);
|
getTrait(CurrentLocation.class).setLocation(at);
|
||||||
entityController.spawn(at, this);
|
entityController.spawn(at, this);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user