mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-29 22:23:59 +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);
|
return commands.executeSafe(command, args, sender, methodArgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onDependentPluginDisable() {
|
||||||
|
storeNPCs();
|
||||||
|
saves.saveToDiskImmediate();
|
||||||
|
saveOnDisable = false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDisable() {
|
public void onDisable() {
|
||||||
if (!enabled)
|
if (!enabled)
|
||||||
@ -286,9 +292,9 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
|
|||||||
despawnNPCs(saveOnDisable);
|
despawnNPCs(saveOnDisable);
|
||||||
HandlerList.unregisterAll(this);
|
HandlerList.unregisterAll(this);
|
||||||
npcRegistry = null;
|
npcRegistry = null;
|
||||||
NMS.shutdown();
|
|
||||||
enabled = false;
|
enabled = false;
|
||||||
saveOnDisable = true;
|
saveOnDisable = true;
|
||||||
|
NMS.shutdown();
|
||||||
CitizensAPI.shutdown();
|
CitizensAPI.shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -351,11 +357,6 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
|
|||||||
Bukkit.getPluginManager().disablePlugin(this);
|
Bukkit.getPluginManager().disablePlugin(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onDependentPluginDisable() {
|
|
||||||
storeNPCs();
|
|
||||||
saveOnDisable = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void registerCommandClass(Class<?> clazz) {
|
public void registerCommandClass(Class<?> clazz) {
|
||||||
try {
|
try {
|
||||||
commands.register(clazz);
|
commands.register(clazz);
|
||||||
|
Loading…
Reference in New Issue
Block a user