From ff5a40ba4d7235ec5704688bf1d742e27bc4bbef Mon Sep 17 00:00:00 2001 From: loganb1max Date: Thu, 9 Jan 2020 00:00:57 -0600 Subject: [PATCH] Fix NPE --- src/main/java/me/loganb1max/minionsplus/model/Minion.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/me/loganb1max/minionsplus/model/Minion.java b/src/main/java/me/loganb1max/minionsplus/model/Minion.java index b6ec96d..9456ac8 100644 --- a/src/main/java/me/loganb1max/minionsplus/model/Minion.java +++ b/src/main/java/me/loganb1max/minionsplus/model/Minion.java @@ -44,6 +44,7 @@ public abstract class Minion { protected void findStand() { if (this.stand != null) return; + this.location.getChunk().load(); this.location.getWorld().getNearbyEntities(this.location, 0.5, 0.5, 0.5).stream().filter(entity -> entity instanceof ArmorStand && !entity.getCustomName().isEmpty()).findFirst().ifPresent(entity -> { this.stand = (ArmorStand) entity; }); @@ -248,7 +249,6 @@ public abstract class Minion { toReturn = new BreederMinion(owner, ownerName, location, energy, level, linkedBlocks); break; } - toReturn.findStand(); return toReturn; }