Skip to content

Commit

Permalink
Reload saves properly on /citizens reload
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Feb 28, 2016
1 parent a78be2a commit c4d9847
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/net/citizensnpcs/Citizens.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ private NPCDataStore createStorage(File folder) {
saves = new NBTStorage(new File(folder + File.separator + Setting.STORAGE_FILE.asString()),
"Citizens NPC Storage");
}
if (saves == null)
if (saves == null){
saves = new YamlStorage(new File(folder, Setting.STORAGE_FILE.asString()), "Citizens NPC Storage");
}
if (!saves.load())
return null;
return SimpleNPCDataStore.create(saves);
Expand Down Expand Up @@ -341,6 +342,7 @@ public void reload() throws NPCLoadException {
despawnNPCs();
ProfileFetcher.reset();
Skin.clearCache();
saves = createStorage(getDataFolder());
saves.loadInto(npcRegistry);

getServer().getPluginManager().callEvent(new CitizensReloadEvent());
Expand Down

0 comments on commit c4d9847

Please sign in to comment.