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() { public void run() {
for (Entity e : giants) { for (Entity e : giants) {
List<Entity> passengers = e.getPassengers(); List<Entity> passengers = e.getPassengers();
passengers.removeIf(n -> (n.getType() != EntityType.HUSK)); if (passengers.size() > 0) {
Location loc = passengers.get(0).getLocation(); passengers.removeIf(n -> (n.getType() != EntityType.HUSK));
e.setRotation(loc.getYaw(), loc.getPitch()); Location loc = passengers.get(0).getLocation();
e.setRotation(loc.getYaw(), loc.getPitch());
}
} }
} }
}.runTaskTimerAsynchronously(this, refreshDelay, 0L); }.runTaskTimerAsynchronously(this, refreshDelay, 0L);