mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-11-28 12:56:51 +01:00
Remove obsolete special handling in settings save
This commit is contained in:
parent
149c6c65ee
commit
e9c97221ec
@ -25,7 +25,6 @@ import de.florianmichael.viafabricplus.protocoltranslator.ProtocolTranslator;
|
||||
import de.florianmichael.viafabricplus.save.AbstractSave;
|
||||
import de.florianmichael.viafabricplus.settings.SettingsManager;
|
||||
import de.florianmichael.viafabricplus.settings.base.AbstractSetting;
|
||||
import de.florianmichael.viafabricplus.settings.base.ButtonSetting;
|
||||
import de.florianmichael.viafabricplus.settings.base.SettingGroup;
|
||||
import de.florianmichael.viafabricplus.settings.impl.GeneralSettings;
|
||||
import de.florianmichael.viafabricplus.util.ChatUtil;
|
||||
@ -58,14 +57,15 @@ public class SettingsSave extends AbstractSave {
|
||||
@Override
|
||||
public void read(JsonObject object) {
|
||||
for (SettingGroup group : settingsManager.getGroups()) {
|
||||
final JsonObject groupObject = object.getAsJsonObject(AbstractSetting.mapTranslationKey(ChatUtil.uncoverTranslationKey(group.getName())));
|
||||
final String translationKey = ChatUtil.uncoverTranslationKey(group.getName());
|
||||
|
||||
final JsonObject groupObject = object.getAsJsonObject(AbstractSetting.mapTranslationKey(translationKey));
|
||||
for (AbstractSetting<?> setting : group.getSettings()) {
|
||||
if (!groupObject.has(setting.getTranslationKey()) && !(setting instanceof ButtonSetting)) {
|
||||
continue;
|
||||
}
|
||||
if (groupObject.has(setting.getTranslationKey())) {
|
||||
setting.read(groupObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (object.has("selected-protocol-version")) {
|
||||
selectedProtocolVersion = object.get("selected-protocol-version").getAsString();
|
||||
|
Loading…
Reference in New Issue
Block a user