Skip to content

Commit

Permalink
make sure path is not null in case MeleeAttackGoal set it to null
Browse files Browse the repository at this point in the history
fix #1443
  • Loading branch information
Cheaterpaul committed Oct 26, 2024
1 parent fdbc429 commit 7adb977
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ public boolean canUse() {
if (avoidSun) {

Path path = this.path;

//noinspection ConstantValue
if (path != null && mob.getCommandSenderWorld().canSeeSkyFromBelowWater(new BlockPos(Mth.floor(this.mob.getX()), (int) (this.mob.getBoundingBox().minY + 0.5D), Mth.floor(this.mob.getZ())))) {
if (path == null) {
return false;
}
if (mob.getCommandSenderWorld().canSeeSkyFromBelowWater(new BlockPos(Mth.floor(this.mob.getX()), (int) (this.mob.getBoundingBox().minY + 0.5D), Mth.floor(this.mob.getZ())))) {
return false;
}

Expand Down

0 comments on commit 7adb977

Please sign in to comment.