mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-26 12:46:04 +01:00
Save to disk on dependent plugin disable
This commit is contained in:
parent
9904e034fd
commit
1ef3e6b56b
@ -277,6 +277,12 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
|
||||
return commands.executeSafe(command, args, sender, methodArgs);
|
||||
}
|
||||
|
||||
public void onDependentPluginDisable() {
|
||||
storeNPCs();
|
||||
saves.saveToDiskImmediate();
|
||||
saveOnDisable = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDisable() {
|
||||
if (!enabled)
|
||||
@ -286,9 +292,9 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
|
||||
despawnNPCs(saveOnDisable);
|
||||
HandlerList.unregisterAll(this);
|
||||
npcRegistry = null;
|
||||
NMS.shutdown();
|
||||
enabled = false;
|
||||
saveOnDisable = true;
|
||||
NMS.shutdown();
|
||||
CitizensAPI.shutdown();
|
||||
}
|
||||
|
||||
@ -351,11 +357,6 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
|
||||
Bukkit.getPluginManager().disablePlugin(this);
|
||||
}
|
||||
|
||||
public void onDependentPluginDisable() {
|
||||
storeNPCs();
|
||||
saveOnDisable = false;
|
||||
}
|
||||
|
||||
public void registerCommandClass(Class<?> clazz) {
|
||||
try {
|
||||
commands.register(clazz);
|
||||
|
Loading…
Reference in New Issue
Block a user