Skip to content

Commit

Permalink
Disable flock caching
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Mar 2, 2021
1 parent 8a87326 commit f46285b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions main/src/main/java/net/citizensnpcs/trait/FollowTrait.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public boolean isEnabled() {
}

@Override
public void onAttach() {
flock = new Flocker(npc, new RadiusNPCFlock(4, 20), new SeparationBehavior(1));
public void onDespawn() {
flock = null;
}

@EventHandler
Expand All @@ -71,6 +71,11 @@ private void onEntityDamage(EntityDamageByEntityEvent event) {
}
}

@Override
public void onSpawn() {
flock = new Flocker(npc, new RadiusNPCFlock(4, 0), new SeparationBehavior(1));
}

@Override
public void run() {
if (player == null || !player.isValid()) {
Expand Down

0 comments on commit f46285b

Please sign in to comment.