mirror of
https://github.com/FancyInnovations/FancyPlugins.git
synced 2025-12-06 07:43:36 +00:00
Add flag to control the arm swing when updating npc (#106)
* fancynpcs: Add overloaded update and updateForAll methods to skip swing animation. * fancynpcs: remove unnecessary changes to other calls of update(player). * Revert version change * fancynpcs: pull default update(Player) method out to NPC class, and make non-abstract. * fancynpcs: make swinging arm default update behavior.
This commit is contained in:
@@ -118,12 +118,20 @@ public abstract class Npc {
|
||||
|
||||
public abstract void lookAt(Player player, Location location);
|
||||
|
||||
public abstract void update(Player player);
|
||||
public abstract void update(Player player, boolean swingArm);
|
||||
|
||||
public void update(Player player) {
|
||||
update(player, true);
|
||||
}
|
||||
|
||||
public void updateForAll(boolean swingArm) {
|
||||
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
|
||||
update(onlinePlayer, swingArm);
|
||||
}
|
||||
}
|
||||
|
||||
public void updateForAll() {
|
||||
for (Player onlinePlayer : Bukkit.getOnlinePlayers()) {
|
||||
update(onlinePlayer);
|
||||
}
|
||||
updateForAll(true);
|
||||
}
|
||||
|
||||
public abstract void move(Player player, boolean swingArm);
|
||||
|
||||
Reference in New Issue
Block a user