mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-14 20:21:19 +01:00
Validate state
This commit is contained in:
parent
71b8744060
commit
5447561d3d
@ -381,9 +381,14 @@ public class Citizens extends JavaPlugin implements CitizensPlugin {
|
||||
|
||||
@Override
|
||||
public void setDefaultNPCDataStore(NPCDataStore store) {
|
||||
saves.storeAll(npcRegistry);
|
||||
saves.saveToDiskImmediate();
|
||||
despawnNPCs();
|
||||
if (store == null) {
|
||||
throw new IllegalArgumentException("must be non-null");
|
||||
}
|
||||
if (saves != null) {
|
||||
saves.storeAll(npcRegistry);
|
||||
saves.saveToDiskImmediate();
|
||||
despawnNPCs();
|
||||
}
|
||||
this.saves = store;
|
||||
this.npcRegistry = new CitizensNPCRegistry(saves);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user