Fix Null Pointer
Some checks failed
Herobrine-Rewoven/pipeline/head There was a failure building this commit

This commit is contained in:
TheBrokenRail 2020-10-31 20:00:05 +00:00
parent 636a1556c6
commit c7b361b5c0

View File

@ -198,7 +198,8 @@ public class HerobrineEntity extends LivingEntity implements Monster {
reset = true;
List<? extends PlayerEntity> players = getEntityWorld().getPlayers();
Collections.shuffle(players);
if (players.size() > 0 || getNearestPlayer().distanceTo(this) >= HardcodedConfig.HEROBRINE_MAX_DISTANCE) {
PlayerentityPlayerentity nearest = getNearestPlayer();
if (players.size() > 0 || nearest == null || nearest.distanceTo(this) >= HardcodedConfig.HEROBRINE_MAX_DISTANCE) {
for (PlayerEntity player : players) {
if (player.isAlive()) {
getAI().setStage(new TeleportStage(this, player.getUuid()));