From 9838c4d90b90d1d689fa13d4223dc2b9b226376c Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Sat, 29 Jan 2022 16:19:04 +0100 Subject: [PATCH] a --- src/main/java/pl/minecon724/giants/Main.java | 27 +++++++++++--------- src/main/resources/config.yml | 9 ++++--- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/main/java/pl/minecon724/giants/Main.java b/src/main/java/pl/minecon724/giants/Main.java index 96d35e1..d03585d 100644 --- a/src/main/java/pl/minecon724/giants/Main.java +++ b/src/main/java/pl/minecon724/giants/Main.java @@ -35,6 +35,7 @@ public class Main extends JavaPlugin implements Listener { boolean ai; boolean headRotations; + boolean attack; double chance; double attackDamage; double attackReach; @@ -84,20 +85,22 @@ public class Main extends JavaPlugin implements Listener { } } } - }; //.runTaskTimer(this, config.getLong("hitDelay"), 0L); - new BukkitRunnable() { - @Override - public void run() { - for (Entity e : giants) { - List passengers = e.getPassengers(); - if (passengers.size() > 0) { - passengers.removeIf(n -> (n.getType() != EntityType.HUSK)); - Location loc = passengers.get(0).getLocation(); - e.setRotation(loc.getYaw(), loc.getPitch()); + }.runTaskTimer(this, config.getLong("hitDelay"), 0L); + if (headRotations) { + new BukkitRunnable() { + @Override + public void run() { + for (Entity e : giants) { + List passengers = e.getPassengers(); + 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); + }.runTaskTimerAsynchronously(this, refreshDelay, 0L); + } } @EventHandler diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 1756919..e9998b7 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -12,9 +12,10 @@ attackReach: 2 # See https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionEffectType.html # Set to [] to disable effects: - - "JUMP:2" - -# No need to change this + - "JUMP:1" +# Head rotations, disabling can slightly improve performance headRotations: true refreshDelay: 20 -expandUp: 0 \ No newline at end of file +# No need to change this +expandUp: 0 +attack: true \ No newline at end of file