mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-23 19:16:34 +01:00
Print the root cause of any exceptions while updating NPCs
This commit is contained in:
parent
e21d6daf48
commit
e1e05c6728
@ -36,6 +36,7 @@ import org.bukkit.metadata.FixedMetadataValue;
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.base.Splitter;
|
||||
import com.google.common.base.Throwables;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
@ -236,8 +237,9 @@ public class CitizensNPC extends AbstractNPC {
|
||||
navigator.run();
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Messaging.logTr(Messages.EXCEPTION_UPDATING_NPC, getId(), ex.getMessage());
|
||||
ex.printStackTrace();
|
||||
Throwable error = Throwables.getRootCause(ex);
|
||||
Messaging.logTr(Messages.EXCEPTION_UPDATING_NPC, getId(), error.getMessage());
|
||||
error.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -67,8 +67,9 @@ public class CreeperController extends MobEntityController {
|
||||
@Override
|
||||
public void bh() {
|
||||
super.bh();
|
||||
if (npc != null)
|
||||
if (npc != null) {
|
||||
npc.update();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user