Saves tracked signs after loading
Previously, if a tracked sign was removed during loading, while it wasn't added to tracked signs, tracked signs wasn't saved, so on the next startup it would be loaded again.
This commit is contained in:
parent
d50d9b42c4
commit
79f3f8e3d2
@ -77,6 +77,13 @@ public final class TrackedSignManager {
|
||||
for (String key : signSection.getKeys(false)) {
|
||||
loadSign(signSection, key);
|
||||
}
|
||||
|
||||
//Save tracked signs in case some were invalidated after loading
|
||||
try {
|
||||
TrackedSignManager.saveTrackedSigns();
|
||||
} catch (IOException e) {
|
||||
PaidSigns.getInstance().getLogger().log(Level.WARNING, "Unable to save tracked signs");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -120,7 +127,7 @@ public final class TrackedSignManager {
|
||||
*
|
||||
* @throws IOException <p>If unable to write to the data file</p>
|
||||
*/
|
||||
private static void saveTrackedSigns() throws IOException {
|
||||
public static void saveTrackedSigns() throws IOException {
|
||||
YamlConfiguration configuration = YamlConfiguration.loadConfiguration(signsFile);
|
||||
ConfigurationSection signSection = configuration.createSection("trackedSigns");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user