Skip to content

Commit

Permalink
Merge pull request #49
Browse files Browse the repository at this point in the history
Spigot | Fix NullPointerException when trying to vanish near some entities
  • Loading branch information
Syrent committed Dec 9, 2022
2 parents b9465f4 + 6234d0b commit d6beb9f
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,11 @@ class VanishManager(
}
}

// TODO: mob.target is nullable
player.world.entities.stream()
.filter { entity -> entity is Creature }
.map { entity -> entity as Creature }
.filter { mob -> mob.target != null }
.filter { mob -> player.uniqueId == mob.target!!.uniqueId }
.filter { mob -> player.uniqueId == mob.target?.uniqueId }
.forEach { mob -> mob.target = null }

addPotionEffects(player)
Expand Down

0 comments on commit d6beb9f

Please sign in to comment.