Disable flock caching

This commit is contained in:
fullwall 2021-03-02 20:52:41 +08:00
parent 8a87326c44
commit f46285b238
1 changed files with 7 additions and 2 deletions

View File

@ -53,8 +53,8 @@ public class FollowTrait extends Trait {
}
@Override
public void onAttach() {
flock = new Flocker(npc, new RadiusNPCFlock(4, 20), new SeparationBehavior(1));
public void onDespawn() {
flock = null;
}
@EventHandler
@ -71,6 +71,11 @@ public class FollowTrait extends Trait {
}
}
@Override
public void onSpawn() {
flock = new Flocker(npc, new RadiusNPCFlock(4, 0), new SeparationBehavior(1));
}
@Override
public void run() {
if (player == null || !player.isValid()) {