mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-11-04 09:19:33 +01:00
Fixed crash when protocol from config doesn't exist anymore
This commit is contained in:
parent
5422e3cef8
commit
89aa3f7482
@ -24,6 +24,7 @@ import de.florianmichael.viafabricplus.base.settings.base.SettingGroup;
|
||||
import de.florianmichael.viafabricplus.base.settings.groups.*;
|
||||
import de.florianmichael.viafabricplus.base.FileSaver;
|
||||
import de.florianmichael.vialoadingbase.ViaLoadingBase;
|
||||
import de.florianmichael.vialoadingbase.model.ComparableProtocolVersion;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@ -64,7 +65,9 @@ public class SettingsSystem extends FileSaver {
|
||||
@Override
|
||||
public void read(JsonObject object) {
|
||||
if (object.has("protocol")) {
|
||||
ViaLoadingBase.getInstance().reload(ViaLoadingBase.fromProtocolId(object.get("protocol").getAsInt()));
|
||||
final ComparableProtocolVersion protocolVersion = ViaLoadingBase.fromProtocolId(object.get("protocol").getAsInt());
|
||||
|
||||
if (protocolVersion != null) ViaLoadingBase.getInstance().reload(protocolVersion);
|
||||
}
|
||||
for (SettingGroup group : groups) {
|
||||
for (AbstractSetting<?> setting : group.getSettings()) {
|
||||
|
Loading…
Reference in New Issue
Block a user