mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-14 12:11:30 +01:00
Fix save task
This commit is contained in:
parent
a3bf2d4e51
commit
d74ce4ae81
@ -330,13 +330,13 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
|
||||
}
|
||||
|
||||
private void scheduleSaveTask(int delay) {
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
|
||||
Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
storeNPCs();
|
||||
saves.saveToDisk();
|
||||
}
|
||||
});
|
||||
}, delay, delay);
|
||||
}
|
||||
|
||||
private void setupEconomy() {
|
||||
@ -418,8 +418,9 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
|
||||
boolean async = args.hasFlag('a');
|
||||
if (async) {
|
||||
saves.saveToDisk();
|
||||
} else
|
||||
} else {
|
||||
saves.saveToDiskImmediate();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean suggestClosestModifier(CommandSender sender, String command, String modifier) {
|
||||
|
@ -39,7 +39,7 @@ public class MCTargetStrategy implements PathStrategy, EntityTarget {
|
||||
this.target = ((CraftEntity) target).getHandle();
|
||||
Navigation nav = NMS.getNavigation(this.handle);
|
||||
this.targetNavigator = nav != null && !params.useNewPathfinder() ? new NavigationFieldWrapper(nav)
|
||||
: new AStarTargeter();
|
||||
: new AStarTargeter();
|
||||
this.aggro = aggro;
|
||||
}
|
||||
|
||||
@ -162,7 +162,7 @@ public class MCTargetStrategy implements PathStrategy, EntityTarget {
|
||||
private void setStrategy() {
|
||||
Location location = target.getBukkitEntity().getLocation(TARGET_LOCATION);
|
||||
strategy = npc.isFlyable() ? new FlyingAStarNavigationStrategy(npc, location, parameters)
|
||||
: new AStarNavigationStrategy(npc, location, parameters);
|
||||
: new AStarNavigationStrategy(npc, location, parameters);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user