From a135d3c4da45989fe655effb81209d7b38c67b30 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Sun, 26 May 2024 22:20:53 -0400 Subject: [PATCH] More development --- .../geyser/configuration/GeyserConfig.java | 10 ++++++++++ .../configuration/GeyserPluginConfig.java | 19 +++++++++++++++++++ .../configuration/GeyserRemoteConfig.java | 12 +++++++----- 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/configuration/GeyserConfig.java b/core/src/main/java/org/geysermc/geyser/configuration/GeyserConfig.java index 03068bb25..b50d172e0 100644 --- a/core/src/main/java/org/geysermc/geyser/configuration/GeyserConfig.java +++ b/core/src/main/java/org/geysermc/geyser/configuration/GeyserConfig.java @@ -260,6 +260,15 @@ public interface GeyserConfig { void port(int port); + @Override + @Comment(""" + What type of authentication Bedrock players will be checked against when logging into the Java server. + Can be floodgate (see https://wiki.geysermc.org/floodgate/), online, or offline.""") + @NonNull + default AuthType authType() { + return AuthType.ONLINE; + } + @Comment(""" Whether to enable PROXY protocol or not while connecting to the server. This is useful only when: @@ -322,6 +331,7 @@ public interface GeyserConfig { @DefaultNumeric(1400) int mtu(); + @Comment("Do not change!") default int version() { return Constants.CONFIG_VERSION; } diff --git a/core/src/main/java/org/geysermc/geyser/configuration/GeyserPluginConfig.java b/core/src/main/java/org/geysermc/geyser/configuration/GeyserPluginConfig.java index b7c0fd9b6..0676f0e8c 100644 --- a/core/src/main/java/org/geysermc/geyser/configuration/GeyserPluginConfig.java +++ b/core/src/main/java/org/geysermc/geyser/configuration/GeyserPluginConfig.java @@ -57,12 +57,31 @@ public interface GeyserPluginConfig extends GeyserConfig { return GeyserImpl.getInstance().getBootstrap().getServerBindAddress(); } + @Override + default void address(String address) { + throw new IllegalStateException(); + } + @Override @Exclude default int port() { return GeyserImpl.getInstance().getBootstrap().getServerPort(); } + @Override + default void port(int port) { + throw new IllegalStateException(); + } + +// @Nonnull +// @Comment(""" +// What type of authentication Bedrock players will be checked against when logging into the Java server. +// Floodgate allows Bedrock players to join without needing a Java account. It's not recommended to change this.""") +// @Override +// default AuthType authType() { +// return AuthType.FLOODGATE; +// } + @Override @Exclude default boolean forwardHostname() { diff --git a/core/src/main/java/org/geysermc/geyser/configuration/GeyserRemoteConfig.java b/core/src/main/java/org/geysermc/geyser/configuration/GeyserRemoteConfig.java index 603a675af..e44fdedd0 100644 --- a/core/src/main/java/org/geysermc/geyser/configuration/GeyserRemoteConfig.java +++ b/core/src/main/java/org/geysermc/geyser/configuration/GeyserRemoteConfig.java @@ -25,7 +25,8 @@ package org.geysermc.geyser.configuration; -import org.spongepowered.configurate.interfaces.meta.Exclude; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.geysermc.geyser.api.network.AuthType; import org.spongepowered.configurate.interfaces.meta.defaults.DefaultNumeric; import org.spongepowered.configurate.interfaces.meta.defaults.DefaultString; import org.spongepowered.configurate.objectmapping.ConfigSerializable; @@ -36,6 +37,8 @@ import org.spongepowered.configurate.objectmapping.meta.Comment; */ @ConfigSerializable public interface GeyserRemoteConfig extends GeyserConfig { +// @Override // For config placement +// BedrockConfig bedrock(); @Override RemoteConfig java(); @@ -52,10 +55,9 @@ public interface GeyserRemoteConfig extends GeyserConfig { @DefaultNumeric(25565) int port(); - @Override - @Exclude - default int protocolVersion() { - return JavaConfig.super.protocolVersion(); + @Override // For config placement + default @NonNull AuthType authType() { + return JavaConfig.super.authType(); } @Override