3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-09-08 22:02:50 +02:00

Ensure we don't save and load config at same time

Dieser Commit ist enthalten in:
Myles 2016-11-14 18:46:27 +00:00
Ursprung eb78fe4bfc
Commit 7e837ef9db

Datei anzeigen

@ -33,7 +33,7 @@ public abstract class Config implements ConfigurationProvider {
reloadConfig(); reloadConfig();
} }
public Map<String, Object> loadConfig(File location) { public synchronized Map<String, Object> loadConfig(File location) {
List<String> unsupported = getUnsupportedOptions(); List<String> unsupported = getUnsupportedOptions();
URL jarConfigFile = Config.class.getClassLoader().getResource("config.yml"); URL jarConfigFile = Config.class.getClassLoader().getResource("config.yml");
try { try {
@ -87,7 +87,7 @@ public abstract class Config implements ConfigurationProvider {
protected abstract void handleConfig(Map<String, Object> config); protected abstract void handleConfig(Map<String, Object> config);
public void saveConfig(File location, Map<String, Object> config) { public synchronized void saveConfig(File location, Map<String, Object> config) {
try { try {
commentStore.writeComments(yaml.get().dump(config), location); commentStore.writeComments(yaml.get().dump(config), location);
} catch (IOException e) { } catch (IOException e) {