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

This commit is contained in:
TheBrokenRail 2020-10-31 20:00:05 +00:00
parent 636a1556c6
commit c7b361b5c0
1 changed files with 2 additions and 1 deletions

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()));