mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-26 20:55:44 +01:00
fix command NPE
This commit is contained in:
parent
c89724b391
commit
12a0c3b32a
@ -45,8 +45,6 @@ public class EventListen implements Listener {
|
||||
NPC npc = npcManager.getNPC(id);
|
||||
Location loc = npc.getTrait(SpawnLocation.class).getLocation();
|
||||
npc.spawn(loc);
|
||||
Messaging.log("Spawned " + npc.getId() + " at " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ()
|
||||
+ " in world " + loc.getWorld().getName());
|
||||
}
|
||||
toRespawn.remove(event.getChunk());
|
||||
}
|
||||
@ -63,8 +61,6 @@ public class EventListen implements Listener {
|
||||
Location loc = npc.getBukkitEntity().getLocation();
|
||||
if (event.getWorld().equals(loc.getWorld()) && event.getChunk().getX() == loc.getChunk().getX()
|
||||
&& event.getChunk().getZ() == loc.getChunk().getZ()) {
|
||||
Messaging.log("Despawned " + npc.getId() + " at " + loc.getX() + ", " + loc.getY() + ", " + loc.getZ()
|
||||
+ " in world " + loc.getWorld().getName());
|
||||
npc.getTrait(SpawnLocation.class).setLocation(loc);
|
||||
npc.despawn();
|
||||
respawn.add(npc.getId());
|
||||
|
@ -38,8 +38,8 @@ public class NPCCommands {
|
||||
public void showInfo(CommandContext args, Player player, NPC npc) {
|
||||
Messaging.send(player, StringHelper.wrapHeader(npc.getName()));
|
||||
Messaging.send(player, " <a>ID: <e>" + npc.getId());
|
||||
Messaging.send(player, " <a>Character: <e>" + npc.getCharacter() != null ? npc.getCharacter().getName()
|
||||
: "None");
|
||||
Messaging.send(player, " <a>Character: <e>" + (npc.getCharacter() != null ? npc.getCharacter().getName()
|
||||
: "None"));
|
||||
}
|
||||
|
||||
@Command(
|
||||
|
Loading…
Reference in New Issue
Block a user