Fix NPE in /npc lookclose

This commit is contained in:
fullwall 2022-11-14 00:14:28 +08:00
parent ed9230c680
commit 12faab3b53
2 changed files with 4 additions and 2 deletions

View File

@ -286,7 +286,7 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
}
private void loadMavenLibraries() {
getLogger().info("[Citizens] Downloading libraries, please wait...");
getLogger().info("Loading external libraries...");
LibraryManager lib = new BukkitLibraryManager(this);
lib.addMavenCentral();
@ -324,6 +324,8 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
.relocate("net{}kyori", "clib{}net{}kyori").build());
lib.loadLibrary(Library.builder().groupId("net{}kyori").artifactId("examination-string").version("1.3.0")
.relocate("net{}kyori", "clib{}net{}kyori").build());
getLogger().info("Loaded.");
}
@Override

View File

@ -1308,7 +1308,7 @@ public class NPCCommands {
npc.getName());
toggle = false;
}
if (randomSwitchTargets) {
if (randomSwitchTargets != null) {
trait.setRandomlySwitchTargets(randomSwitchTargets);
Messaging.sendTr(sender, randomSwitchTargets ? Messages.LOOKCLOSE_RANDOM_TARGET_SWITCH_ENABLED
: Messages.LOOKCLOSE_RANDOM_TARGET_SWITCH_DISABLED, npc.getName());