3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-10-01 23:50:11 +02:00

Set default values for classes as well (#1387)

Geyser can now start even if the config file is empty. Tested on Spigot and doesn't affect custom values.
Dieser Commit ist enthalten in:
Camotoy 2020-10-10 18:08:21 -04:00 committet von GitHub
Ursprung ec609fa868
Commit ffcff96bea
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -34,6 +34,7 @@ import org.geysermc.connector.common.serializer.AsteriskSerializer;
import java.nio.file.Path; import java.nio.file.Path;
import java.util.Map; import java.util.Map;
import java.util.UUID;
@Getter @Getter
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
@ -45,8 +46,8 @@ public abstract class GeyserJacksonConfiguration implements GeyserConfiguration
@Setter @Setter
private boolean autoconfiguredRemote = false; private boolean autoconfiguredRemote = false;
private BedrockConfiguration bedrock; private BedrockConfiguration bedrock = new BedrockConfiguration();
private RemoteConfiguration remote; private RemoteConfiguration remote = new RemoteConfiguration();
@JsonProperty("floodgate-key-file") @JsonProperty("floodgate-key-file")
private String floodgateKeyFile = "public-key.pem"; private String floodgateKeyFile = "public-key.pem";
@ -106,7 +107,7 @@ public abstract class GeyserJacksonConfiguration implements GeyserConfiguration
@JsonProperty("force-resource-packs") @JsonProperty("force-resource-packs")
private boolean forceResourcePacks = true; private boolean forceResourcePacks = true;
private MetricsInfo metrics; private MetricsInfo metrics = new MetricsInfo();
@Getter @Getter
public static class BedrockConfiguration implements IBedrockConfiguration { public static class BedrockConfiguration implements IBedrockConfiguration {
@ -154,7 +155,7 @@ public abstract class GeyserJacksonConfiguration implements GeyserConfiguration
private boolean enabled = true; private boolean enabled = true;
@JsonProperty("uuid") @JsonProperty("uuid")
private String uniqueId = "generateuuid"; private String uniqueId = UUID.randomUUID().toString();
} }
@JsonProperty("scoreboard-packet-threshold") @JsonProperty("scoreboard-packet-threshold")