fix: fixed NullPointerException
This commit is contained in:
parent
7ebcad5fa7
commit
f50d180394
@ -40,7 +40,9 @@ public class DebugParamsContext extends PlayerContext {
|
|||||||
taskDebugRendererAiPathFinder = Scheduler.ofPlayer(getPlayer()).repeatingTask(() -> {
|
taskDebugRendererAiPathFinder = Scheduler.ofPlayer(getPlayer()).repeatingTask(() -> {
|
||||||
for (var entity: getPlayer().getInstance().getNearbyEntities(getPlayer().getPosition(), 32)) {
|
for (var entity: getPlayer().getInstance().getNearbyEntities(getPlayer().getPosition(), 32)) {
|
||||||
if (entity instanceof EntityCreature creature) {
|
if (entity instanceof EntityCreature creature) {
|
||||||
for (var point: creature.getNavigator().getNodes()) {
|
var nodes = creature.getNavigator().getNodes();
|
||||||
|
if (nodes == null) continue;
|
||||||
|
for (var point: nodes) {
|
||||||
var packet = new ParticlePacket(PARTICLE_AI_PATH, point.x(), point.y() + 0.5, point.z(), 0, 0, 0, 0, 1);
|
var packet = new ParticlePacket(PARTICLE_AI_PATH, point.x(), point.y() + 0.5, point.z(), 0, 0, 0, 0, 1);
|
||||||
entity.sendPacketToViewers(packet);
|
entity.sendPacketToViewers(packet);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user