fix: fixed NullPointerException

This commit is contained in:
Andrey Terentev 2025-04-12 13:45:11 +07:00
parent 7ebcad5fa7
commit f50d180394

View File

@ -40,7 +40,9 @@ public class DebugParamsContext extends PlayerContext {
taskDebugRendererAiPathFinder = Scheduler.ofPlayer(getPlayer()).repeatingTask(() -> {
for (var entity: getPlayer().getInstance().getNearbyEntities(getPlayer().getPosition(), 32)) {
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);
entity.sendPacketToViewers(packet);
}