This commit is contained in:
BuildTools 2022-01-29 15:36:32 +01:00
parent 1335b2e759
commit d9dd549597
1 changed files with 5 additions and 3 deletions

View File

@ -86,9 +86,11 @@ public class Main extends JavaPlugin implements Listener {
public void run() {
for (Entity e : giants) {
List<Entity> passengers = e.getPassengers();
passengers.removeIf(n -> (n.getType() != EntityType.HUSK));
Location loc = passengers.get(0).getLocation();
e.setRotation(loc.getYaw(), loc.getPitch());
if (passengers.size() > 0) {
passengers.removeIf(n -> (n.getType() != EntityType.HUSK));
Location loc = passengers.get(0).getLocation();
e.setRotation(loc.getYaw(), loc.getPitch());
}
}
}
}.runTaskTimerAsynchronously(this, refreshDelay, 0L);