1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2026-01-06 15:41:50 +00:00

Configurate: Sectionification (#5904)

* Init: config sections

* Start on adding tests, move migrations over to ConfigMigrations class

* Get rid of auth section again, rename that one config option, fix mtu migration

* Move custom skulls config options to the bottom of the gameplay settings

* Add more tests
This commit is contained in:
chris
2025-11-03 14:30:48 +01:00
committed by GitHub
parent d045508aae
commit 77d1dcaeec
53 changed files with 2947 additions and 463 deletions

View File

@@ -45,7 +45,7 @@ public class FloodgateKeyLoader {
}
}
Path floodgateKey = geyserDataFolder.resolve(config.floodgateKeyFile());
Path floodgateKey = geyserDataFolder.resolve(config.advanced().floodgateKeyFile());
if (!Files.exists(floodgateKey)) {
logger.error(GeyserLocale.getLocaleStringLog("geyser.bootstrap.floodgate.not_installed"));

View File

@@ -215,7 +215,7 @@ public class GeyserImpl implements GeyserApi, EventRegistrar {
public void initialize() {
// Setup encryption early so we don't start if we can't auth
if (!config().disableXboxAuth()) {
if (config().advanced().bedrock().validateBedrockLogin()) {
try {
EncryptionUtils.getMojangPublicKey();
} catch (Throwable t) {
@@ -316,20 +316,20 @@ public class GeyserImpl implements GeyserApi, EventRegistrar {
Registries.RESOURCE_PACKS.load();
// Warnings to users who enable options that they might not need.
if (config.bedrock().useHaproxyProtocol()) {
if (config.advanced().bedrock().useHaproxyProtocol()) {
logger.warning("Geyser is configured to expect HAProxy protocol for incoming Bedrock connections.");
logger.warning("If you do not know what this is, open the Geyser config, and set \"use-haproxy-protocol\" under the \"bedrock\" section to \"false\".");
logger.warning("If you do not know what this is, open the Geyser config, and set \"use-haproxy-protocol\" under the \"advanced/bedrock\" section to \"false\".");
}
if (config.java().useHaproxyProtocol()) {
if (config.advanced().java().useHaproxyProtocol()) {
logger.warning("Geyser is configured to use proxy protocol when connecting to the Java server.");
logger.warning("If you do not know what this is, open the Geyser config, and set \"use-haproxy-protocol\" under the \"java\" section to \"false\".");
logger.warning("If you do not know what this is, open the Geyser config, and set \"use-haproxy-protocol\" under the \"advanced/java\" section to \"false\".");
}
if (config.disableXboxAuth()) {
if (!config.advanced().bedrock().validateBedrockLogin()) {
logger.error("XBOX AUTHENTICATION IS DISABLED ON THIS GEYSER INSTANCE!");
logger.error("While this allows using Bedrock edition proxies, it also opens up the ability for hackers to connect with any username they choose.");
logger.error("To change this, set \"disable-xbox-auth\" to \"false\" in Geyser's config-advanced.yml file.");
logger.error("To change this, set \"disable-xbox-auth\" to \"false\" in Geyser's config file.");
}
String geyserUdpPort = System.getProperty("geyserUdpPort", "");
@@ -416,7 +416,7 @@ public class GeyserImpl implements GeyserApi, EventRegistrar {
if (parsedPort < 1 || parsedPort > 65535) {
throw new NumberFormatException("The broadcast port must be between 1 and 65535 inclusive!");
}
config.bedrock().broadcastPort(parsedPort);
config.advanced().bedrock().broadcastPort(parsedPort);
logger.info("Broadcast port set from system property: " + parsedPort);
} catch (NumberFormatException e) {
logger.error(String.format("Invalid broadcast port from system property: %s! Defaulting to configured port.", broadcastPort + " (" + e.getMessage() + ")"));
@@ -424,8 +424,8 @@ public class GeyserImpl implements GeyserApi, EventRegistrar {
}
// It's set to 0 only if no system property or manual config value was set
if (config.bedrock().broadcastPort() == 0) {
config.bedrock().broadcastPort(config.bedrock().port());
if (config.advanced().bedrock().broadcastPort() == 0) {
config.advanced().bedrock().broadcastPort(config.bedrock().port());
}
if (!(config instanceof GeyserPluginConfig)) {
@@ -440,7 +440,7 @@ public class GeyserImpl implements GeyserApi, EventRegistrar {
logger.debug("Found SRV record \"" + remoteAddress + ":" + remotePort + "\"");
}
}
} else if (!config.useDirectConnection()) {
} else if (!config.advanced().java().useDirectConnection()) {
logger.warning("The use-direct-connection config option is deprecated. Please reach out to us on Discord if there's a reason it needs to be disabled.");
}
@@ -456,9 +456,9 @@ public class GeyserImpl implements GeyserApi, EventRegistrar {
logger.debug("Epoll is not available; Erosion's Unix socket handling will not work.");
}
BedrockDimension.changeBedrockNetherId(config.netherRoofWorkaround()); // Apply End dimension ID workaround to Nether
BedrockDimension.changeBedrockNetherId(config.gameplay().netherRoofWorkaround()); // Apply End dimension ID workaround to Nether
int bedrockThreadCount = Integer.getInteger("Geyser.BedrockNetworkThreads", config.bedrockNetworkThreadCount());
int bedrockThreadCount = Integer.getInteger("Geyser.BedrockNetworkThreads", -1);
if (bedrockThreadCount == -1) {
// Copy the code from Netty's default thread count fallback
bedrockThreadCount = Math.max(1, SystemPropertyUtil.getInt("io.netty.eventLoopThreads", NettyRuntime.availableProcessors() * 2));
@@ -546,8 +546,8 @@ public class GeyserImpl implements GeyserApi, EventRegistrar {
metrics.addCustomChart(new SimplePie("defaultLocale", GeyserLocale::getDefaultLocale));
metrics.addCustomChart(new SimplePie("version", () -> GeyserImpl.VERSION));
metrics.addCustomChart(new SimplePie("javaHaProxyProtocol", () -> String.valueOf(config.java().useHaproxyProtocol())));
metrics.addCustomChart(new SimplePie("bedrockHaProxyProtocol", () -> String.valueOf(config.bedrock().useHaproxyProtocol())));
metrics.addCustomChart(new SimplePie("javaHaProxyProtocol", () -> String.valueOf(config.advanced().java().useHaproxyProtocol())));
metrics.addCustomChart(new SimplePie("bedrockHaProxyProtocol", () -> String.valueOf(config.advanced().bedrock().useHaproxyProtocol())));
metrics.addCustomChart(new AdvancedPie("playerPlatform", () -> {
Map<String, Integer> valueMap = new HashMap<>();
for (GeyserSession session : sessionManager.getAllSessions()) {

View File

@@ -80,7 +80,7 @@ public class ConnectionTestCommand extends GeyserCommand {
// Replace "<" and ">" symbols if they are present to avoid the common issue of people including them
final String ip = ipArgument.replace("<", "").replace(">", "");
final int port = portArgument != null ? portArgument : geyser.config().bedrock().broadcastPort(); // default bedrock port
final int port = portArgument != null ? portArgument : geyser.config().advanced().bedrock().broadcastPort(); // default bedrock port
// Issue: people commonly checking placeholders
if (ip.equals("ip")) {
@@ -109,7 +109,7 @@ public class ConnectionTestCommand extends GeyserCommand {
GeyserConfig config = geyser.config();
// Issue: do the ports not line up? We only check this if players don't override the broadcast port - if they do, they (hopefully) know what they're doing
if (config.bedrock().broadcastPort() == config.bedrock().port()) {
if (config.advanced().bedrock().broadcastPort() == config.bedrock().port()) {
if (port != config.bedrock().port()) {
if (portArgument != null) {
source.sendMessage("The port you are testing with (" + port + ") is not the same as you set in your Geyser configuration ("
@@ -126,9 +126,9 @@ public class ConnectionTestCommand extends GeyserCommand {
}
}
} else {
if (config.bedrock().broadcastPort() != port) {
if (config.advanced().bedrock().broadcastPort() != port) {
source.sendMessage("The port you are testing with (" + port + ") is not the same as the broadcast port set in your Geyser configuration ("
+ config.bedrock().broadcastPort() + "). ");
+ config.advanced().bedrock().broadcastPort() + "). ");
source.sendMessage("You ONLY need to change the broadcast port if clients connects with a port different from the port Geyser is running on.");
source.sendMessage("Re-run the command with the port in the config, or change the `bedrock` `broadcast-port` in the config.");
}
@@ -140,7 +140,7 @@ public class ConnectionTestCommand extends GeyserCommand {
}
// Issue: did someone turn on enable-proxy-protocol, and they didn't mean it?
if (config.bedrock().useHaproxyProtocol()) {
if (config.advanced().bedrock().useHaproxyProtocol()) {
source.sendMessage("You have the `use-haproxy-protocol` setting enabled. " +
"Unless you're deliberately using additional software that REQUIRES this setting, you may not need it enabled.");
}

View File

@@ -26,11 +26,6 @@
package org.geysermc.geyser.configuration;
import com.google.common.annotations.VisibleForTesting;
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.util.UUID;
import java.util.function.Consumer;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.checkerframework.common.returnsreceiver.qual.This;
import org.geysermc.geyser.GeyserBootstrap;
@@ -43,42 +38,46 @@ import org.spongepowered.configurate.transformation.ConfigurationTransformation;
import org.spongepowered.configurate.yaml.NodeStyle;
import org.spongepowered.configurate.yaml.YamlConfigurationLoader;
import static org.spongepowered.configurate.NodePath.path;
import static org.spongepowered.configurate.transformation.TransformAction.remove;
import static org.spongepowered.configurate.transformation.TransformAction.rename;
import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
import java.util.function.Consumer;
public final class ConfigLoader {
private static final String HEADER = """
--------------------------------
Geyser Configuration File
A bridge between Minecraft: Bedrock Edition and Minecraft: Java Edition.
GitHub: https://github.com/GeyserMC/Geyser
Discord: https://discord.gg/geysermc
Wiki: https://geysermc.org/wiki
NOTICE: See https://geysermc.org/wiki/geyser/setup/ for the setup guide. Many video tutorials are outdated.
In most cases, especially with server hosting providers, further hosting-specific configuration is required.
--------------------------------""";
--------------------------------
Geyser Configuration File
A bridge between Minecraft: Bedrock Edition and Minecraft: Java Edition.
GitHub: https://github.com/GeyserMC/Geyser
Discord: https://discord.gg/geysermc
Wiki: https://geysermc.org/wiki
NOTICE: See https://geysermc.org/wiki/geyser/setup/ for the setup guide. Many video tutorials are outdated.
In most cases, especially with server hosting providers, further hosting-specific configuration is required.
--------------------------------""";
/**
* Only nullable for testing.
*/
private final @Nullable GeyserBootstrap bootstrap;
private PlatformType platformType;
private @Nullable Consumer<CommentedConfigurationNode> transformer;
private File configFile;
/**
* Only set during testing.
*/
@VisibleForTesting
CommentedConfigurationNode configurationNode;
public ConfigLoader(GeyserBootstrap bootstrap) {
this.bootstrap = bootstrap;
this.platformType = bootstrap.platformType();
configFile = new File(bootstrap.getConfigFolder().toFile(), "config.yml");
}
public ConfigLoader(GeyserBootstrap bootstrap, String configFileName) {
this.bootstrap = bootstrap;
configFile = new File(bootstrap.getConfigFolder().toFile(), configFileName);
}
@VisibleForTesting
ConfigLoader(File file) {
this.bootstrap = null;
@@ -129,66 +128,7 @@ public final class ConfigLoader {
CommentedConfigurationNode node = loader.load();
boolean originallyEmpty = !configFile.exists() || node.isNull();
var migrations = ConfigurationTransformation.versionedBuilder()
.versionKey("config-version")
// Pre-Configurate
.addVersion(5, ConfigurationTransformation.builder()
.addAction(path("legacy-ping-passthrough"), configClass == GeyserRemoteConfig.class ? remove() : (path, value) -> {
// Invert value
value.set(!value.getBoolean());
return new Object[]{"integrated-ping-passthrough"};
})
.addAction(path("remote"), rename("java"))
.addAction(path("floodgate-key-file"), (path, value) -> {
// Elimate any legacy config values
if ("public-key.pem".equals(value.getString())) {
value.set("key.pem");
}
return null;
})
.addAction(path("default-locale"), (path, value) -> {
if (value.getString() == null) {
value.set("system");
}
return null;
})
.addAction(path("show-cooldown"), (path, value) -> {
String s = value.getString();
if (s != null) {
switch (s) {
case "true" -> value.set("title");
case "false" -> value.set("disabled");
}
}
return null;
})
.addAction(path("addNonBedrockItems"), rename("enableCustomContent"))
.addAction(path("aboveBedrockNetherBuilding"), rename("netherRoofWorkaround"))
.addAction(path("metrics", "uuid"), (path, value) -> {
if ("generateduuid".equals(value.getString())) {
// Manually copied config without Metrics UUID creation?
value.set(UUID.randomUUID());
}
return null;
})
.addAction(path("remote", "address"), (path, value) -> {
if ("auto".equals(value.getString())) {
// Auto-convert back to localhost
value.set("127.0.0.1");
}
return null;
})
.addAction(path("metrics", "enabled"), (path, value) -> {
// Move to the root, not in the Metrics class.
return new Object[]{"enable-metrics"};
})
.addAction(path("bedrock", "motd1"), rename("primary-motd"))
.addAction(path("bedrock", "motd2"), rename("secondary-motd"))
.addAction(path("bedrock", "enableProxyProtocol"), rename("useProxyProtocol"))
.addAction(path("enableProxyConnections"), rename("disableXboxAuth"))
.build())
.build();
ConfigurationTransformation.Versioned migrations = ConfigMigrations.TRANSFORMER.apply(configClass);
int currentVersion = migrations.version(node);
migrations.apply(node);
int newVersion = migrations.version(node);
@@ -222,28 +162,35 @@ public final class ConfigLoader {
if (this.bootstrap != null) { // Null for testing only.
this.bootstrap.getGeyserLogger().setDebug(config.debugMode());
} else {
this.configurationNode = newRoot;
}
return config;
}
@VisibleForTesting
CommentedConfigurationNode loadConfigurationNode(Class<? extends GeyserConfig> configClass, PlatformType platformType) {
this.platformType = platformType;
load(configClass);
return configurationNode.copy();
}
private YamlConfigurationLoader createLoader(File file) {
return YamlConfigurationLoader.builder()
.file(file)
.indent(2)
.nodeStyle(NodeStyle.BLOCK)
.defaultOptions(options -> InterfaceDefaultOptions.addTo(options, builder -> {
if (this.bootstrap != null) { // Testing only.
builder.addProcessor(ExcludePlatform.class, excludePlatform(bootstrap.platformType().platformName()))
.addProcessor(PluginSpecific.class, integrationSpecific(bootstrap.platformType() != PlatformType.STANDALONE));
}
builder.addProcessor(ExcludePlatform.class, excludePlatform(platformType.platformName()))
.addProcessor(PluginSpecific.class, integrationSpecific(platformType != PlatformType.STANDALONE));
})
.shouldCopyDefaults(false) // If we use ConfigurationNode#get(type, default), do not write the default back to the node.
.header(ConfigLoader.HEADER)
.serializers(builder -> builder.register(new LowercaseEnumSerializer())))
.build();
}
private static Processor.Factory<ExcludePlatform, Object> excludePlatform(String thisPlatform) {
return (data, fieldType) -> (value, destination) -> {
for (String platform : data.platforms()) {

View File

@@ -0,0 +1,166 @@
/*
* Copyright (c) 2025 GeyserMC. http://geysermc.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* @author GeyserMC
* @link https://github.com/GeyserMC/Geyser
*/
package org.geysermc.geyser.configuration;
import org.spongepowered.configurate.ConfigurateException;
import org.spongepowered.configurate.transformation.ConfigurationTransformation;
import org.spongepowered.configurate.transformation.TransformAction;
import java.util.Arrays;
import java.util.UUID;
import java.util.function.Function;
import static org.spongepowered.configurate.NodePath.path;
import static org.spongepowered.configurate.transformation.TransformAction.remove;
import static org.spongepowered.configurate.transformation.TransformAction.rename;
public class ConfigMigrations {
public static final Function<Class<? extends GeyserConfig>, ConfigurationTransformation.Versioned> TRANSFORMER = (configClass) ->
ConfigurationTransformation.versionedBuilder()
.versionKey("config-version")
.addVersion(5, ConfigurationTransformation.builder()
// Java section
.addAction(path("remote"), rename("java"))
.addAction(path("remote", "address"), (path, value) -> {
if ("auto".equals(value.getString())) {
// Auto-convert back to localhost
value.set("127.0.0.1");
}
return null;
})
// Motd section
.addAction(path("bedrock", "motd1"), renameAndMove("motd", "primary-motd"))
.addAction(path("bedrock", "motd2"), renameAndMove("motd", "secondary-motd"))
.addAction(path("passthrough-motd"), moveTo("motd"))
.addAction(path("passthrough-player-counts"), moveTo("motd"))
.addAction(path("ping-passthrough-interval"), moveTo("motd"))
.addAction(path("max-players"), moveTo("motd"))
.addAction(path("legacy-ping-passthrough"), configClass == GeyserRemoteConfig.class ? remove() : (path, value) -> {
// Invert value
value.set(!value.getBoolean());
return new Object[]{ "motd", "integrated-ping-passthrough" };
})
// gameplay
.addAction(path("command-suggestions"), moveTo("gameplay"))
.addAction(path("forward-player-ping"), moveTo("gameplay"))
.addAction(path("show-cooldown"), (path, value) -> {
String s = value.getString();
if (s != null) {
switch (s) {
case "true" -> value.set("title");
case "false" -> value.set("disabled");
}
}
return new Object[]{ "gameplay", "show-cooldown" };
})
.addAction(path("bedrock", "server-name"), moveTo("gameplay"))
.addAction(path("show-coordinates"), moveTo("gameplay"))
.addAction(path("disable-bedrock-scaffolding"), moveTo("gameplay"))
.addAction(path("custom-skull-render-distance"), moveTo("gameplay"))
.addAction(path("force-resource-packs"), moveTo("gameplay"))
.addAction(path("xbox-achievements-enabled"), moveTo("gameplay"))
.addAction(path("unusable-space-block"), moveTo("gameplay"))
.addAction(path("unusable-space-block"), moveTo("gameplay"))
.addAction(path("add-non-bedrock-items"), renameAndMove("gameplay", "enable-custom-content"))
.addAction(path("above-bedrock-nether-building"), renameAndMove("gameplay", "nether-roof-workaround"))
.addAction(path("xbox-achievements-enabled"), moveTo("gameplay"))
.addAction(path("max-visible-custom-skulls"), moveTo("gameplay"))
.addAction(path("allow-custom-skulls"), (path, value) -> {
if (!value.getBoolean()) {
value.raw(0);
return new Object[]{ "gameplay", "max-visible-custom-skulls" };
}
return null;
})
// Advanced section
.addAction(path("cache-images"), moveTo("advanced"))
.addAction(path("scoreboard-packet-threshold"), moveTo("advanced"))
.addAction(path("add-team-suggestions"), moveTo("advanced"))
.addAction(path("floodgate-key-file"), (path, value) -> {
// Elimate any legacy config values
if ("public-key.pem".equals(value.getString())) {
value.set("key.pem");
}
return new Object[]{ "advanced", "floodgate-key-file" };
})
// Bedrock
.addAction(path("bedrock", "broadcast-port"), moveTo("advanced", "bedrock"))
.addAction(path("bedrock", "compression-level"), renameAndMove("advanced", "bedrock", "compression-level"))
.addAction(path("bedrock", "enable-proxy-protocol"), renameAndMove("advanced", "bedrock", "use-haproxy-protocol"))
.addAction(path("bedrock", "proxy-protocol-whitelisted-ips"), renameAndMove("advanced", "bedrock", "proxy-protocol-whitelisted-ips"))
.addAction(path("mtu"), moveTo("advanced", "bedrock"))
// Java
.addAction(path("remote", "use-proxy-protocol"), renameAndMove("advanced", "java", "use-haproxy-protocol"))
.addAction(path("disable-compression"), renameAndMove("advanced", "java", "disable-compression"))
.addAction(path("use-direct-connection"), renameAndMove("advanced", "java", "use-direct-connection"))
// Other
.addAction(path("default-locale"), (path, value) -> {
if (value.getString() == null) {
value.set("system");
}
return null;
})
.addAction(path("metrics", "uuid"), (path, value) -> {
if ("generateduuid".equals(value.getString())) {
// Manually copied config without Metrics UUID creation?
value.set(UUID.randomUUID());
}
return new Object[]{ "metrics-uuid" };
})
.addAction(path("metrics", "enabled"), (path, value) -> {
// Move to the root, not in the Metrics class.
return new Object[]{ "enable-metrics" };
})
.build())
.build();
static TransformAction renameAndMove(String... newPath) {
return ((path, value) -> Arrays.stream(newPath).toArray());
}
static TransformAction moveTo(String... newPath) {
return (path, value) -> {
Object[] arr = path.array();
if (arr.length == 0) {
throw new ConfigurateException(value, "The root node cannot be renamed!");
} else {
// create a new array with space for newPath segments + the original last segment
Object[] result = new Object[newPath.length + 1];
System.arraycopy(newPath, 0, result, 0, newPath.length);
result[newPath.length] = arr[arr.length - 1];
return result;
}
};
}
}

View File

@@ -25,11 +25,9 @@
package org.geysermc.geyser.configuration;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
import org.checkerframework.checker.nullness.qual.NonNull;
import org.geysermc.geyser.Constants;
import org.geysermc.geyser.GeyserImpl;
import org.geysermc.geyser.api.network.AuthType;
import org.geysermc.geyser.api.network.BedrockListener;
import org.geysermc.geyser.api.network.RemoteServer;
@@ -45,14 +43,33 @@ import org.spongepowered.configurate.interfaces.meta.range.NumericRange;
import org.spongepowered.configurate.objectmapping.ConfigSerializable;
import org.spongepowered.configurate.objectmapping.meta.Comment;
import java.util.Collections;
import java.util.List;
import java.util.UUID;
@ConfigSerializable
public interface GeyserConfig {
@Comment("Settings related to networking for the Bedrock listener.")
@Comment("Network settings for the Bedrock listener")
BedrockConfig bedrock();
@Comment("Settings related to networking for the Java server connection.")
@Comment("Network settings for the Java server connection")
JavaConfig java();
@Comment("MOTD settings")
MotdConfig motd();
@Comment("Gameplay options that affect Bedrock players")
GameplayConfig gameplay();
@Comment("The default locale if we don't have the one the client requested. If set to \"system\", the system's language will be used.")
@DefaultString(GeyserLocale.SYSTEM_LOCALE)
@NonNull
String defaultLocale();
@Comment("Whether player IP addresses will be logged by the server.")
@DefaultBoolean(true)
boolean logPlayerIpAddresses();
@Comment("""
For online mode authentication type only.
Stores a list of Bedrock player usernames that should have their Java Edition account saved after login.
@@ -62,115 +79,16 @@ public interface GeyserConfig {
The file that tokens will be saved in is in the same folder as this config, named "saved-refresh-tokens.json".""")
default List<String> savedUserLogins() {
return List.of("ThisExampleUsernameShouldBeLongEnoughToNeverBeAnXboxUsername",
"ThisOtherExampleUsernameShouldAlsoBeLongEnough");
"ThisOtherExampleUsernameShouldAlsoBeLongEnough");
}
@Comment("""
For online mode authentication type only.
Specify how many seconds to wait while user authorizes Geyser to access their Microsoft account.
User is allowed to disconnect from the server during this period.""")
@DefaultNumeric(128)
@DefaultNumeric(120)
int pendingAuthenticationTimeout();
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
@Comment("""
Bedrock clients can freeze when opening up the command prompt for the first time if given a lot of commands.
Disabling this will prevent command suggestions from being sent and solve freezing for Bedrock clients.""")
@DefaultBoolean(true)
boolean commandSuggestions();
@Comment("Relay the MOTD from the Java server to Bedrock players.")
@DefaultBoolean(true)
boolean passthroughMotd();
@Comment("Relay the player count and max players from the Java server to Bedrock players.")
@DefaultBoolean(true)
boolean passthroughPlayerCounts();
@Comment("""
Use server API methods to determine the Java server's MOTD and ping passthrough.
There is no need to disable this unless your MOTD or player count does not appear properly.""")
@DefaultBoolean(true)
@PluginSpecific
boolean integratedPingPassthrough();
@Comment("How often to ping the Java server to refresh MOTD and player count, in seconds.")
@DefaultNumeric(3)
int pingPassthroughInterval();
@Comment("""
Whether to forward player ping to the server. While enabling this will allow Bedrock players to have more accurate
ping, it may also cause players to time out more easily.""")
boolean forwardPlayerPing();
@Comment("""
Maximum amount of players that can connect.
This is only visual, and is only applied if passthrough-motd is disabled.""")
@DefaultNumeric(100)
int maxPlayers();
@Comment("If debug messages should be sent through console")
boolean debugMode();
@Comment("""
Allow a fake cooldown indicator to be sent. Bedrock players otherwise do not see a cooldown as they still use 1.8 combat.
Please note: if the cooldown is enabled, some users may see a black box during the cooldown sequence, like below:
https://geysermc.org/img/external/cooldown_indicator.png
This can be disabled by going into Bedrock settings under the accessibility tab and setting "Text Background Opacity" to 0
This setting can be set to "title", "actionbar" or "false\"""")
default CooldownUtils.CooldownType showCooldown() {
return CooldownUtils.CooldownType.TITLE;
}
@Comment("Controls if coordinates are shown to players.")
@DefaultBoolean(true)
boolean showCoordinates();
@Comment("Whether Bedrock players are blocked from performing their scaffolding-style bridging.")
boolean disableBedrockScaffolding();
@Comment("The default locale if we don't have the one the client requested. If set to \"system\", the system's language will be used.")
@NonNull
@DefaultString(GeyserLocale.SYSTEM_LOCALE)
String defaultLocale();
@Comment("Allows custom skulls to be displayed. Keeping them enabled may cause a performance decrease on older/weaker devices.")
@DefaultBoolean(true)
boolean allowCustomSkulls();
@Comment("""
Whether to add any items and blocks which normally does not exist in Bedrock Edition.
This should only need to be disabled if using a proxy that does not use the "transfer packet" style of server switching.
If this is disabled, furnace minecart items will be mapped to hopper minecart items.
Geyser's block, item, and skull mappings systems will also be disabled.
This option requires a restart of Geyser in order to change its setting.""")
@DefaultBoolean(true)
boolean enableCustomContent();
@Comment("""
Bedrock prevents building and displaying blocks above Y127 in the Nether.
This config option works around that by changing the Nether dimension ID to the End ID.
The main downside to this is that the entire Nether will have the same red fog rather than having different fog for each biome.""")
boolean netherRoofWorkaround();
@Comment("""
Force clients to load all resource packs if there are any.
If set to false, it allows the user to connect to the server even if they don't
want to download the resource packs.""")
@DefaultBoolean(true)
boolean forceResourcePacks();
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
@Comment("""
Allows Xbox achievements to be unlocked.
If a player types in an unknown command, they will receive a message that states cheats are disabled.
Otherwise, commands work as expected.""")
boolean xboxAchievementsEnabled();
@Comment("Whether player IP addresses will be logged by the server.")
@DefaultBoolean(true)
boolean logPlayerIpAddresses();
@Comment("""
Whether to alert the console and operators that a new Geyser version is available that supports a Bedrock version
that this Geyser version does not support. It's recommended to keep this option enabled, as many Bedrock platforms
@@ -178,6 +96,9 @@ public interface GeyserConfig {
@DefaultBoolean(true)
boolean notifyOnNewBedrockUpdate();
@Comment("Advanced configuration options. These usually do not need modifications.")
AdvancedConfig advanced();
@Comment("""
bStats is a stat tracker that is entirely anonymous and tracks only basic information
about Geyser, such as how many people are online, how many servers are using Geyser,
@@ -187,34 +108,38 @@ public interface GeyserConfig {
@ExcludePlatform(platforms = {"BungeeCord", "Spigot", "Velocity"}) // bStats platform versions used
boolean enableMetrics();
@Comment("The bstats metrics uuid. Do not touch!")
@ExcludePlatform(platforms = {"BungeeCord", "Spigot", "Velocity"}) // bStats platform versions used
default UUID metricsUuid() {
return UUID.randomUUID();
}
@Comment("If debug messages should be sent through console")
boolean debugMode();
@Comment("Do not change!")
@SuppressWarnings("unused")
default int configVersion() {
return Constants.CONFIG_VERSION;
}
@ConfigSerializable
interface BedrockConfig extends BedrockListener {
@Override
@Comment("""
The IP address that Geyser will bind on to listen for connections.
Generally, you should only uncomment and change this if you want to limit what IPs can connect to your server.""")
The IP address that Geyser will bind on to listen for incoming Bedrock connections.
Generally, you should only change this if you want to limit what IPs can connect to your server.""")
@NonNull
@DefaultString("0.0.0.0")
@AsteriskSerializer.Asterisk
String address();
@Override
@Comment("""
The port that will listen for connections.
The port that will Geyser will listen on for incoming Bedrock connections.
Since Minecraft: Bedrock Edition uses UDP, this port must allow UDP traffic.""")
@DefaultNumeric(19132)
@NumericRange(from = 0, to = 65535)
int port();
@Override
@Comment("""
The port to broadcast to Bedrock clients with the MOTD that they should use to connect to the server.
A value of 0 will broadcast the port specified above.
DO NOT change this unless Geyser runs on a different port than the one that is used to connect.""")
@DefaultNumeric(0)
@NumericRange(from = 0, to = 65535)
int broadcastPort();
@Comment("""
Some hosting services change your Java port everytime you start the server and require the same port to be used for Bedrock.
This option makes the Bedrock port the same as the Java port every time you start the server.""")
@@ -223,27 +148,206 @@ public interface GeyserConfig {
boolean cloneRemotePort();
void address(String address);
void port(int port);
void broadcastPort(int broadcastPort);
@Exclude
@Override
default int broadcastPort() {
return GeyserImpl.getInstance().config().advanced().bedrock().broadcastPort();
}
@Exclude
@Override
default String primaryMotd() {
return GeyserImpl.getInstance().config().motd().primaryMotd();
}
@Exclude
@Override
default String secondaryMotd() {
return GeyserImpl.getInstance().config().motd().secondaryMotd();
}
@Exclude
@Override
default String serverName() {
return GeyserImpl.getInstance().config().gameplay().serverName();
}
}
@ConfigSerializable
interface JavaConfig extends RemoteServer {
void address(String address);
void port(int port);
@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;
}
void authType(AuthType authType);
boolean forwardHostname();
@Exclude
default String minecraftVersion() {
return GameProtocol.getJavaMinecraftVersion();
}
@Exclude
default int protocolVersion() {
return GameProtocol.getJavaProtocolVersion();
}
@Exclude
default boolean resolveSrv() {
return false;
}
}
@ConfigSerializable
interface MotdConfig {
@Comment("""
The MOTD that will be broadcasted to Minecraft: Bedrock Edition clients. This is irrelevant if "passthrough-motd" is set to true.
If either of these are empty, the respective string will default to "Geyser\"""")
@DefaultString("Geyser")
String primaryMotd();
@Override
@DefaultString("Another Geyser server.")
String secondaryMotd();
@Override
@Comment("The Server Name that will be sent to Minecraft: Bedrock Edition clients. This is visible in both the pause menu and the settings menu.")
@Comment("Whether Geyser should relay the MOTD from the Java server to Bedrock players.")
@DefaultBoolean(true)
boolean passthroughMotd();
@Comment("""
Maximum amount of players that can connect.
This is only visual, and is only applied if passthrough-motd is disabled.""")
@DefaultNumeric(100)
int maxPlayers();
@Comment("Whether to relay the player count and max players from the Java server to Bedrock players.")
@DefaultBoolean(true)
boolean passthroughPlayerCounts();
@Comment("""
Whether to use server API methods to determine the Java server's MOTD and ping passthrough.
There is no need to disable this unless your MOTD or player count does not appear properly.""")
@DefaultBoolean(true)
@PluginSpecific
boolean integratedPingPassthrough();
@Comment("How often to ping the Java server to refresh MOTD and player count, in seconds.")
@DefaultNumeric(3)
int pingPassthroughInterval();
}
@ConfigSerializable
interface GameplayConfig {
@Comment("The server name that will be sent to Minecraft: Bedrock Edition clients. This is visible in both the pause menu and the settings menu.")
@DefaultString("Geyser")
String serverName();
@Comment("""
Whether to automatically serve the GeyserOptionalPack to all connecting players.
This adds some quality-of-life visual fixes for Bedrock players.
See https://geysermc.org/wiki/other/geyseroptionalpack for all current features.
If enabled, force-resource-packs will be enabled.""")
@DefaultBoolean(true)
boolean enableOptionalPack();
@Comment("""
Allow a fake cooldown indicator to be sent. Bedrock players otherwise do not see a cooldown as they still use 1.8 combat.
Please note: if the cooldown is enabled, some users may see a black box during the cooldown sequence, like below:
https://geysermc.org/img/external/cooldown_indicator.png
This can be disabled by going into Bedrock settings under the accessibility tab and setting "Text Background Opacity" to 0
This setting can be set to "title", "actionbar" or "false\"""")
default CooldownUtils.CooldownType showCooldown() {
return CooldownUtils.CooldownType.TITLE;
}
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
@Comment("""
Bedrock clients can freeze when opening up the command prompt for the first time if given a lot of commands.
Disabling this will prevent command suggestions from being sent and solve freezing for Bedrock clients.""")
@DefaultBoolean(true)
boolean commandSuggestions();
@Comment("Controls if coordinates are shown to players.")
@DefaultBoolean(true)
boolean showCoordinates();
@Comment("Whether Bedrock players are blocked from performing their scaffolding-style bridging.")
boolean disableBedrockScaffolding();
@Comment("""
Bedrock prevents building and displaying blocks above Y127 in the Nether.
This config option works around that by changing the Nether dimension ID to the End ID.
The main downside to this is that the entire Nether will have the same red fog rather than having different fog for each biome.""")
boolean netherRoofWorkaround();
@Comment("""
Which item to use to mark unavailable slots in a Bedrock player inventory. Examples of this are the 2x2 crafting grid while in creative,
or custom inventory menus with sizes different from the usual 3x9. A barrier block is the default item.
This config option can be set to any Bedrock item identifier. If you want to set this to a custom item, make sure that you specify the item in the following format: "geyser_custom:<mapping-name>"
""")
@DefaultString("minecraft:barrier")
String unusableSpaceBlock();
@Comment("""
Whether to add any items and blocks which normally does not exist in Bedrock Edition.
This should only need to be disabled if using a proxy that does not use the "transfer packet" style of server switching.
If this is disabled, furnace minecart items will be mapped to hopper minecart items.
Geyser's block, item, and skull mappings systems will also be disabled.
This option requires a restart of Geyser in order to change its setting.""")
@DefaultBoolean(true)
boolean enableCustomContent();
@Comment("""
Force clients to load all resource packs if there are any.
If set to false, it allows the user to connect to the server even if they don't
want to download the resource packs.""")
@DefaultBoolean(true)
boolean forceResourcePacks();
@Comment("""
Whether to forward player ping to the server. While enabling this will allow Bedrock players to have more accurate
ping, it may also cause players to time out more easily.""")
boolean forwardPlayerPing();
@SuppressWarnings("BooleanMethodIsAlwaysInverted")
@Comment("""
Allows Xbox achievements to be unlocked.
If a player types in an unknown command, they will receive a message that states cheats are disabled.
Otherwise, commands work as expected.""")
boolean xboxAchievementsEnabled();
@Comment("""
The maximum number of custom skulls to be displayed per player. Increasing this may decrease performance on weaker devices.
A value of 0 will disable all custom skulls.
Setting this to -1 will cause all custom skulls to be displayed regardless of distance or number.""")
@DefaultNumeric(128)
int maxVisibleCustomSkulls();
@Comment("The radius in blocks around the player in which custom skulls are displayed.")
@DefaultNumeric(32)
int customSkullRenderDistance();
}
@ConfigSerializable
interface AdvancedBedrockConfig {
@Comment("""
The port to broadcast to Bedrock clients with the MOTD that they should use to connect to the server.
A value of 0 will broadcast the port specified above.
DO NOT change this unless Geyser runs on a different port than the one that is used to connect.""")
@DefaultNumeric(0)
@NumericRange(from = 0, to = 65535)
int broadcastPort();
void broadcastPort(int port);
@Comment("""
How much to compress network traffic to the Bedrock client. The higher the number, the more CPU usage used, but
the smaller the bandwidth used. Does not have any effect below -1 or above 9. Set to -1 to disable.""")
@@ -266,26 +370,26 @@ public interface GeyserConfig {
default List<String> proxyProtocolWhitelistedIps() {
return Collections.emptyList();
}
@Comment("""
The internet supports a maximum MTU of 1492 but could cause issues with packet fragmentation.
1400 is the default.""")
@DefaultNumeric(1400)
int mtu();
@Comment("""
This option disables the auth step Geyser performs for connecting Bedrock players.
It can be used to allow connections from ProxyPass and WaterdogPE. In these cases, make sure that users
cannot directly connect to this Geyser instance. See https://www.spigotmc.org/wiki/firewall-guide/ for
assistance - and use UDP instead of TCP.
Disabling Bedrock authentication for other use-cases is NOT SUPPORTED, as it allows anyone to spoof usernames, and is therefore a security risk.
All Floodgate functionality (including skin uploading and account linking) will also not work when this option is disabled.""")
@DefaultBoolean(true)
boolean validateBedrockLogin();
}
@ConfigSerializable
interface JavaConfig extends RemoteServer {
void address(String address);
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;
}
void authType(AuthType authType);
interface AdvancedJavaConfig {
@Comment("""
Whether to enable HAPROXY protocol when connecting to the Java server.
This is useful only when:
@@ -294,134 +398,60 @@ public interface GeyserConfig {
IF YOU DON'T KNOW WHAT THIS IS, DON'T TOUCH IT!""")
boolean useHaproxyProtocol();
boolean forwardHostname();
@Override
@Exclude
default String minecraftVersion() {
return GameProtocol.getJavaMinecraftVersion();
}
@Override
@Exclude
default int protocolVersion() {
return GameProtocol.getJavaProtocolVersion();
}
@Override
@Exclude
default boolean resolveSrv() {
return false;
}
}
// Cannot be type File yet because we may want to hide it in plugin instances.
@Comment("""
Floodgate uses encryption to ensure use from authorized sources.
This should point to the public key generated by Floodgate (BungeeCord, Spigot or Velocity)
You can ignore this when not using Floodgate.
If you're using a plugin version of Floodgate on the same server, the key will automatically be picked up from Floodgate.""")
@DefaultString("key.pem")
String floodgateKeyFile();
@Comment("""
The maximum number of custom skulls to be displayed per player. Increasing this may decrease performance on weaker devices.
Setting this to -1 will cause all custom skulls to be displayed regardless of distance or number.""")
@DefaultNumeric(128)
int maxVisibleCustomSkulls();
@Comment("The radius in blocks around the player in which custom skulls are displayed.")
@DefaultNumeric(32)
int customSkullRenderDistance();
@Comment("""
Specify how many days player skin images will be cached to disk to save downloading them from the internet.
A value of 0 is disabled. (Default: 0)""")
int cacheImages();
@Comment("""
Which item to use to mark unavailable slots in a Bedrock player inventory. Examples of this are the 2x2 crafting grid while in creative,
or custom inventory menus with sizes different from the usual 3x9. A barrier block is the default item.
This config option can be set to any Bedrock item identifier. If you want to set this to a custom item, make sure that you specify the item in the following format: "geyser_custom:<mapping-name>"
""")
@DefaultString("minecraft:barrier")
String unusableSpaceBlock();
@Comment("""
Geyser updates the Scoreboard after every Scoreboard packet, but when Geyser tries to handle
a lot of scoreboard packets per second, this can cause serious lag.
This option allows you to specify after how many Scoreboard packets per seconds
the Scoreboard updates will be limited to four updates per second.""")
@DefaultNumeric(20)
int scoreboardPacketThreshold();
@Comment("""
Whether Geyser should send team names in command suggestions.
Disable this if you have a lot of teams used that you don't need as suggestions.
""")
@DefaultBoolean(true)
boolean addTeamSuggestions();
@Comment("""
The internet supports a maximum MTU of 1492 but could cause issues with packet fragmentation.
1400 is the default.""")
@DefaultNumeric(1400)
int mtu();
@Comment("""
This option can only be changed if SO_REUSEPORT is available on the system (Linux / macOS only).
When this option is available, it is possible to modify how many times Geyser re-binds to the same port,
thereby improving performance on multi-core systems with a lot of incoming connections.
""")
@DefaultNumeric(1)
int listenCount();
@Comment("""
This option specifies the amount of network threads in the Bedrock network event loop group.
When set to -1, this count will be automatically determined based on the amount of available processors.""")
@DefaultNumeric(-1)
@NumericRange(from = -1, to = 100)
int bedrockNetworkThreadCount();
@Comment("""
@Comment("""
Whether to connect directly into the Java server without creating a TCP connection.
This should only be disabled if a plugin that interfaces with packets or the network does not work correctly with Geyser.
If enabled, the remote address and port sections are ignored.
If disabled, expect performance decrease and latency increase.
""")
@DefaultBoolean(true)
@PluginSpecific
boolean useDirectConnection();
@DefaultBoolean(true)
@PluginSpecific
boolean useDirectConnection();
@Comment("""
@Comment("""
Whether Geyser should attempt to disable packet compression (from the Java Server to Geyser) for Bedrock players.
This should be a benefit as there is no need to compress data when Java packets aren't being handled over the network.
This requires use-direct-connection to be true.
""")
@DefaultBoolean(true)
@PluginSpecific
boolean disableCompression();
@Comment("""
This option disables the auth step Geyser performs for connecting Bedrock players.
It can be used to allow connections from ProxyPass and WaterdogPE. In these cases, make sure that users
cannot directly connect to this Geyser instance. See https://www.spigotmc.org/wiki/firewall-guide/ for
assistance - and use UDP instead of TCP.
Disabling Xbox authentication for other use-cases is NOT SUPPORTED, as it allows anyone to spoof usernames,
and is therefore a security risk. All Floodgate functionality (including skin uploading and account linking) will also not work when Xbox auth is disabled.
""")
// if u have offline mode enabled pls be safe
boolean disableXboxAuth();
@Comment("The bstats metrics uuid. Do not touch!")
@ExcludePlatform(platforms = {"BungeeCord", "Spigot", "Velocity"}) // bStats platform versions used
default UUID metricsUuid() {
return UUID.randomUUID();
@DefaultBoolean(true)
@PluginSpecific
boolean disableCompression();
}
@Comment("Do not change!")
@SuppressWarnings("unused")
default int configVersion() {
return Constants.CONFIG_VERSION;
@ConfigSerializable
interface AdvancedConfig {
@Comment("""
Specify how many days player skin images will be cached to disk to save downloading them from the internet.
A value of 0 is disabled. (Default: 0)""")
int cacheImages();
@Comment("""
Geyser updates the Scoreboard after every Scoreboard packet, but when Geyser tries to handle
a lot of scoreboard packets per second, this can cause serious lag.
This option allows you to specify after how many Scoreboard packets per seconds
the Scoreboard updates will be limited to four updates per second.""")
@DefaultNumeric(20)
int scoreboardPacketThreshold();
@Comment("""
Whether Geyser should send team names in command suggestions.
Disable this if you have a lot of teams used that you don't need as suggestions.""")
@DefaultBoolean(true)
boolean addTeamSuggestions();
// Cannot be type File yet because we may want to hide it in plugin instances.
@Comment("""
Floodgate uses encryption to ensure use from authorized sources.
This should point to the public key generated by Floodgate (BungeeCord, Spigot or Velocity)
You can ignore this when not using Floodgate.
If you're using a plugin version of Floodgate on the same server, the key will automatically be picked up from Floodgate.""")
@DefaultString("key.pem")
String floodgateKeyFile();
@Comment("Advanced networking options for the Geyser to Java server connection")
AdvancedJavaConfig java();
@Comment("Advanced networking options for Geyser's Bedrock listener")
AdvancedBedrockConfig bedrock();
}
}

View File

@@ -35,6 +35,18 @@ public interface GeyserPluginConfig extends GeyserConfig {
@Override
IntegratedJavaConfig java();
@Override
PluginMotdConfig motd();
@ConfigSerializable
interface PluginMotdConfig extends MotdConfig {
@Comment("""
How often to ping the Java server to refresh MOTD and player count, in seconds.
Only relevant if integrated-ping-passthrough is disabled.""")
@Override
int pingPassthroughInterval();
}
@ConfigSerializable
interface IntegratedJavaConfig extends JavaConfig {
@Override
@@ -57,10 +69,4 @@ public interface GeyserPluginConfig extends GeyserConfig {
return true; // No need to worry about suspicious behavior flagging the server.
}
}
@Comment("""
How often to ping the Java server to refresh MOTD and player count, in seconds.
Only relevant if integrated-ping-passthrough is disabled.""")
@Override
int pingPassthroughInterval();
}

View File

@@ -56,7 +56,7 @@ public interface GeyserRemoteConfig extends GeyserConfig {
@Override
@Comment("""
Forward the hostname that the Bedrock client used to connect over to the Java server.
Whether to forward the hostname that the Bedrock client used to connect over to the Java server.
This is designed to be used for forced hosts on proxies.""")
boolean forwardHostname();
}

View File

@@ -103,7 +103,7 @@ public class UpstreamPacketHandler extends LoggingPacketHandler {
super(geyser, session);
ZlibCompression compression = new ZlibCompression(Zlib.RAW);
compression.setLevel(this.geyser.config().bedrock().compressionLevel());
compression.setLevel(this.geyser.config().advanced().bedrock().compressionLevel());
this.compressionStrategy = new SimpleCompressionStrategy(compression);
}
@@ -241,7 +241,8 @@ public class UpstreamPacketHandler extends LoggingPacketHandler {
resourcePacksInfo.getResourcePackInfos().addAll(this.resourcePackLoadEvent.infoPacketEntries());
resourcePacksInfo.setVibrantVisualsForceDisabled(!session.isAllowVibrantVisuals());
resourcePacksInfo.setForcedToAccept(GeyserImpl.getInstance().config().forceResourcePacks());
resourcePacksInfo.setForcedToAccept(GeyserImpl.getInstance().config().gameplay().forceResourcePacks() ||
GeyserImpl.getInstance().config().gameplay().enableOptionalPack());
resourcePacksInfo.setWorldTemplateId(UUID.randomUUID());
resourcePacksInfo.setWorldTemplateVersion("*");
session.sendUpstreamPacket(resourcePacksInfo);

View File

@@ -50,7 +50,7 @@ public abstract class GeyserInjector {
* @param bootstrap the bootstrap of the Geyser instance.
*/
public void initializeLocalChannel(GeyserBootstrap bootstrap) {
if (!bootstrap.config().useDirectConnection()) {
if (!bootstrap.config().advanced().java().useDirectConnection()) {
bootstrap.getGeyserLogger().debug("Disabling direct injection!");
return;
}

View File

@@ -71,7 +71,6 @@ import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import static org.cloudburstmc.netty.channel.raknet.RakConstants.DEFAULT_GLOBAL_PACKET_LIMIT;
import static org.cloudburstmc.netty.channel.raknet.RakConstants.DEFAULT_PACKET_LIMIT;
@@ -123,7 +122,7 @@ public final class GeyserServer {
public GeyserServer(GeyserImpl geyser, int threadCount) {
this.geyser = geyser;
this.listenCount = Bootstraps.isReusePortAvailable() ? Integer.getInteger("Geyser.ListenCount", geyser.config().listenCount()) : 1;
this.listenCount = Bootstraps.isReusePortAvailable() ? Integer.getInteger("Geyser.ListenCount", 1) : 1;
GeyserImpl.getInstance().getLogger().debug("Listen thread count: " + listenCount);
this.group = TRANSPORT.eventLoopGroupFactory().apply(listenCount, new DefaultThreadFactory("GeyserServer", true));
this.childGroup = TRANSPORT.eventLoopGroupFactory().apply(threadCount, new DefaultThreadFactory("GeyserServerChild", true));
@@ -135,7 +134,7 @@ public final class GeyserServer {
this.listenCount = 1;
}
if (this.geyser.config().bedrock().useHaproxyProtocol()) {
if (this.geyser.config().advanced().bedrock().useHaproxyProtocol()) {
this.proxiedAddresses = ExpiringMap.builder()
.expiration(30 + 1, TimeUnit.MINUTES)
.expirationPolicy(ExpirationPolicy.ACCESSED).build();
@@ -143,7 +142,7 @@ public final class GeyserServer {
this.proxiedAddresses = null;
}
this.broadcastPort = geyser.config().bedrock().broadcastPort();
this.broadcastPort = geyser.config().advanced().bedrock().broadcastPort();
}
public CompletableFuture<Void> bind(InetSocketAddress address) {
@@ -165,12 +164,12 @@ public final class GeyserServer {
.addAfter(RakServerOfflineHandler.NAME, RakPingHandler.NAME, new RakPingHandler(this));
// Add proxy handler
boolean isProxyProtocol = this.geyser.config().bedrock().useHaproxyProtocol();
boolean isProxyProtocol = this.geyser.config().advanced().bedrock().useHaproxyProtocol();
if (isProxyProtocol) {
channel.pipeline().addFirst("proxy-protocol-decoder", new ProxyServerHandler());
}
boolean isWhitelistedProxyProtocol = isProxyProtocol && !this.geyser.config().bedrock().proxyProtocolWhitelistedIps().isEmpty();
boolean isWhitelistedProxyProtocol = isProxyProtocol && !this.geyser.config().advanced().bedrock().proxyProtocolWhitelistedIps().isEmpty();
if (Boolean.parseBoolean(System.getProperty("Geyser.RakRateLimitingDisabled", "false")) || isWhitelistedProxyProtocol) {
// We would already block any non-whitelisted IP addresses in onConnectionRequest so we can remove the rate limiter
channel.pipeline().remove(RakServerRateLimiter.NAME);
@@ -220,7 +219,7 @@ public final class GeyserServer {
GeyserServerInitializer serverInitializer = new GeyserServerInitializer(this.geyser);
playerGroup = serverInitializer.getEventLoopGroup();
this.geyser.getLogger().debug("Setting MTU to " + this.geyser.config().mtu());
this.geyser.getLogger().debug("Setting MTU to " + this.geyser.config().advanced().bedrock().mtu());
int rakPacketLimit = positivePropOrDefault("Geyser.RakPacketLimit", DEFAULT_PACKET_LIMIT);
this.geyser.getLogger().debug("Setting RakNet packet limit to " + rakPacketLimit);
@@ -235,7 +234,7 @@ public final class GeyserServer {
.channelFactory(RakChannelFactory.server(TRANSPORT.datagramChannelClass()))
.group(group, childGroup)
.option(RakChannelOption.RAK_HANDLE_PING, true)
.option(RakChannelOption.RAK_MAX_MTU, this.geyser.config().mtu())
.option(RakChannelOption.RAK_MAX_MTU, this.geyser.config().advanced().bedrock().mtu())
.option(RakChannelOption.RAK_PACKET_LIMIT, rakPacketLimit)
.option(RakChannelOption.RAK_GLOBAL_PACKET_LIMIT, rakGlobalPacketLimit)
.option(RakChannelOption.RAK_SEND_COOKIE, rakSendCookie)
@@ -243,8 +242,8 @@ public final class GeyserServer {
}
public boolean onConnectionRequest(InetSocketAddress inetSocketAddress) {
List<String> allowedProxyIPs = geyser.config().bedrock().proxyProtocolWhitelistedIps();
if (geyser.config().bedrock().useHaproxyProtocol() && !allowedProxyIPs.isEmpty()) {
List<String> allowedProxyIPs = geyser.config().advanced().bedrock().proxyProtocolWhitelistedIps();
if (geyser.config().advanced().bedrock().useHaproxyProtocol() && !allowedProxyIPs.isEmpty()) {
boolean isWhitelistedIP = false;
for (CIDRMatcher matcher : getWhitelistedIPsMatchers()) {
if (matcher.matches(inetSocketAddress.getAddress())) {
@@ -261,7 +260,7 @@ public final class GeyserServer {
String ip;
if (geyser.config().logPlayerIpAddresses()) {
if (geyser.config().bedrock().useHaproxyProtocol()) {
if (geyser.config().advanced().bedrock().useHaproxyProtocol()) {
ip = this.proxiedAddresses.getOrDefault(inetSocketAddress, inetSocketAddress).toString();
} else {
ip = inetSocketAddress.toString();
@@ -290,7 +289,7 @@ public final class GeyserServer {
if (geyser.config().debugMode() && PRINT_DEBUG_PINGS) {
String ip;
if (geyser.config().logPlayerIpAddresses()) {
if (geyser.config().bedrock().useHaproxyProtocol()) {
if (geyser.config().advanced().bedrock().useHaproxyProtocol()) {
ip = this.proxiedAddresses.getOrDefault(inetSocketAddress, inetSocketAddress).toString();
} else {
ip = inetSocketAddress.toString();
@@ -304,7 +303,7 @@ public final class GeyserServer {
GeyserConfig config = geyser.config();
GeyserPingInfo pingInfo = null;
if (config.passthroughMotd() || config.passthroughPlayerCounts()) {
if (config.motd().passthroughMotd() || config.motd().passthroughPlayerCounts()) {
IGeyserPingPassthrough pingPassthrough = geyser.getBootstrap().getGeyserPingPassthrough();
if (pingPassthrough != null) {
pingInfo = pingPassthrough.getPingInformation(inetSocketAddress);
@@ -321,25 +320,25 @@ public final class GeyserServer {
.ipv6Port(this.broadcastPort)
.serverId(channel.config().getOption(RakChannelOption.RAK_GUID));
if (config.passthroughMotd() && pingInfo != null && pingInfo.getDescription() != null) {
if (config.motd().passthroughMotd() && pingInfo != null && pingInfo.getDescription() != null) {
String[] motd = MessageTranslator.convertMessageLenient(pingInfo.getDescription()).split("\n");
String mainMotd = (motd.length > 0) ? motd[0] : config.bedrock().primaryMotd(); // First line of the motd.
String subMotd = (motd.length > 1) ? motd[1] : config.bedrock().secondaryMotd(); // Second line of the motd if present, otherwise default.
String mainMotd = (motd.length > 0) ? motd[0] : config.motd().primaryMotd(); // First line of the motd.
String subMotd = (motd.length > 1) ? motd[1] : config.motd().secondaryMotd(); // Second line of the motd if present, otherwise default.
pong.motd(mainMotd.trim());
pong.subMotd(subMotd.trim()); // Trimmed to shift it to the left, prevents the universe from collapsing on us just because we went 2 characters over the text box's limit.
} else {
pong.motd(config.bedrock().primaryMotd());
pong.subMotd(config.bedrock().secondaryMotd());
pong.motd(config.motd().primaryMotd());
pong.subMotd(config.motd().secondaryMotd());
}
// Placed here to prevent overriding values set in the ping event.
if (config.passthroughPlayerCounts() && pingInfo != null) {
if (config.motd().passthroughPlayerCounts() && pingInfo != null) {
pong.playerCount(pingInfo.getPlayers().getOnline());
pong.maximumPlayerCount(pingInfo.getPlayers().getMax());
} else {
pong.playerCount(geyser.getSessionManager().getSessions().size());
pong.maximumPlayerCount(config.maxPlayers());
pong.maximumPlayerCount(config.motd().maxPlayers());
}
this.geyser.eventBus().fire(new GeyserBedrockPingEventImpl(pong, inetSocketAddress));
@@ -393,7 +392,7 @@ public final class GeyserServer {
private List<CIDRMatcher> whitelistedIPsMatchers = null;
/**
* @return Unmodifiable list of {@link CIDRMatcher}s from {@link GeyserConfig.BedrockConfig#proxyProtocolWhitelistedIps()}
* @return Unmodifiable list of {@link CIDRMatcher}s from {@link GeyserConfig.AdvancedBedrockConfig#proxyProtocolWhitelistedIps()}
*/
public List<CIDRMatcher> getWhitelistedIPsMatchers() {
// Effective Java, Third Edition; Item 83: Use lazy initialization judiciously
@@ -402,7 +401,7 @@ public final class GeyserServer {
synchronized (this) {
// Check if proxyProtocolWhitelistedIPs contains URLs we need to fetch and parse by line
List<String> whitelistedCIDRs = new ArrayList<>();
for (String ip: geyser.config().bedrock().proxyProtocolWhitelistedIps()) {
for (String ip: geyser.config().advanced().bedrock().proxyProtocolWhitelistedIps()) {
if (!ip.startsWith("http")) {
whitelistedCIDRs.add(ip);
continue;

View File

@@ -78,7 +78,7 @@ public class SkullResourcePackManager {
Path packPath = cachePath.resolve("player_skulls.mcpack");
File packFile = packPath.toFile();
if (BlockRegistries.CUSTOM_SKULLS.get().isEmpty() || !GeyserImpl.getInstance().config().enableCustomContent()) {
if (BlockRegistries.CUSTOM_SKULLS.get().isEmpty() || !GeyserImpl.getInstance().config().gameplay().enableCustomContent()) {
packFile.delete(); // No need to keep resource pack
return null;
}

View File

@@ -65,10 +65,10 @@ public class GeyserLegacyPingPassthrough implements IGeyserPingPassthrough, Runn
* @return GeyserPingPassthrough, or null if not initialized
*/
public static @Nullable IGeyserPingPassthrough init(GeyserImpl geyser) {
if (geyser.config().passthroughMotd() || geyser.config().passthroughPlayerCounts()) {
if (geyser.config().motd().passthroughMotd() || geyser.config().motd().passthroughPlayerCounts()) {
GeyserLegacyPingPassthrough pingPassthrough = new GeyserLegacyPingPassthrough(geyser);
// Ensure delay is not zero
int interval = (geyser.config().pingPassthroughInterval() == 0) ? 1 : geyser.config().pingPassthroughInterval();
int interval = (geyser.config().motd().pingPassthroughInterval() == 0) ? 1 : geyser.config().motd().pingPassthroughInterval();
geyser.getLogger().debug("Scheduling ping passthrough at an interval of " + interval + " second(s).");
geyser.getScheduledThread().scheduleAtFixedRate(pingPassthrough, 1, interval, TimeUnit.SECONDS);
return pingPassthrough;
@@ -102,7 +102,7 @@ public class GeyserLegacyPingPassthrough implements IGeyserPingPassthrough, Runn
byte[] buffer;
try (DataOutputStream dataOutputStream = new DataOutputStream(socket.getOutputStream())) {
if (geyser.config().java().useHaproxyProtocol()) {
if (geyser.config().advanced().java().useHaproxyProtocol()) {
// HAProxy support
// Based on https://github.com/netty/netty/blob/d8ad931488f6b942dabe28ecd6c399b4438da0a8/codec-haproxy/src/main/java/io/netty/handler/codec/haproxy/HAProxyMessageEncoder.java#L78
dataOutputStream.write(HAPROXY_BINARY_PREFIX);

View File

@@ -104,7 +104,7 @@ public class CustomBlockRegistryPopulator {
* @param stage the stage to populate
*/
public static void populate(Stage stage) {
if (!GeyserImpl.getInstance().config().enableCustomContent()) {
if (!GeyserImpl.getInstance().config().gameplay().enableCustomContent()) {
return;
}

View File

@@ -59,7 +59,7 @@ public class CustomSkullRegistryPopulator {
SkullResourcePackManager.SKULL_SKINS.clear(); // Remove skins after reloading
BlockRegistries.CUSTOM_SKULLS.set(Object2ObjectMaps.emptyMap());
if (!GeyserImpl.getInstance().config().enableCustomContent()) {
if (!GeyserImpl.getInstance().config().gameplay().enableCustomContent()) {
return;
}

View File

@@ -218,7 +218,7 @@ public class ItemRegistryPopulator {
throw new AssertionError("Unable to load Bedrock item components", e);
}
boolean customItemsAllowed = GeyserImpl.getInstance().config().enableCustomContent();
boolean customItemsAllowed = GeyserImpl.getInstance().config().gameplay().enableCustomContent();
// List values here is important compared to HashSet - we need to preserve the order of what's given to us
// (as of 1.19.2 Java) to replicate some edge cases in Java predicate behavior where it checks from the bottom

View File

@@ -81,7 +81,7 @@ import static org.geysermc.geyser.scoreboard.UpdateType.REMOVE;
public final class Scoreboard {
private static final boolean SHOW_SCOREBOARD_LOGS = Boolean.parseBoolean(System.getProperty("Geyser.ShowScoreboardLogs", "true"));
private static final boolean ADD_TEAM_SUGGESTIONS = Boolean.parseBoolean(
System.getProperty("Geyser.AddTeamSuggestions", String.valueOf(GeyserImpl.getInstance().config().addTeamSuggestions()))
System.getProperty("Geyser.AddTeamSuggestions", String.valueOf(GeyserImpl.getInstance().config().advanced().addTeamSuggestions()))
);
private final GeyserSession session;

View File

@@ -47,7 +47,7 @@ public final class ScoreboardUpdater extends Thread {
static {
GeyserConfig config = GeyserImpl.getInstance().config();
FIRST_SCORE_PACKETS_PER_SECOND_THRESHOLD = Math.min(config.scoreboardPacketThreshold(), SECOND_SCORE_PACKETS_PER_SECOND_THRESHOLD);
FIRST_SCORE_PACKETS_PER_SECOND_THRESHOLD = Math.min(config.advanced().scoreboardPacketThreshold(), SECOND_SCORE_PACKETS_PER_SECOND_THRESHOLD);
DEBUG_ENABLED = config.debugMode();
}

View File

@@ -706,7 +706,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
/**
* A cache of IDs from ClientboundKeepAlivePackets that have been sent to the Bedrock client, but haven't been returned to the server.
* Only used if {@link GeyserConfig#forwardPlayerPing()} is enabled.
* Only used if {@link GeyserConfig.GameplayConfig#forwardPlayerPing()} is enabled.
*/
private final Queue<Long> keepAliveCache = new ConcurrentLinkedQueue<>();
@@ -854,7 +854,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
upstream.sendPacket(playStatusPacket);
SetCommandsEnabledPacket setCommandsEnabledPacket = new SetCommandsEnabledPacket();
setCommandsEnabledPacket.setCommandsEnabled(!geyser.config().xboxAchievementsEnabled());
setCommandsEnabledPacket.setCommandsEnabled(!geyser.config().gameplay().xboxAchievementsEnabled());
upstream.sendPacket(setCommandsEnabledPacket);
UpdateAttributesPacket attributesPacket = new UpdateAttributesPacket();
@@ -1072,10 +1072,10 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
// Disable automatic creation of a new TcpClientSession when transferring - we don't use that functionality.
this.downstream.getSession().setFlag(MinecraftConstants.FOLLOW_TRANSFERS, false);
if (geyser.config().java().useHaproxyProtocol()) {
if (geyser.config().advanced().java().useHaproxyProtocol()) {
downstream.setFlag(BuiltinFlags.CLIENT_PROXIED_ADDRESS, upstream.getAddress());
}
if (geyser.config().forwardPlayerPing()) {
if (geyser.config().gameplay().forwardPlayerPing()) {
// Let Geyser handle sending the keep alive
downstream.setFlag(MinecraftConstants.AUTOMATIC_KEEP_ALIVE_MANAGEMENT, false);
}
@@ -1776,7 +1776,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
startGamePacket.setLevelGameType(GameType.SURVIVAL);
startGamePacket.setDifficulty(1);
startGamePacket.setDefaultSpawn(Vector3i.ZERO);
startGamePacket.setAchievementsDisabled(!geyser.config().xboxAchievementsEnabled());
startGamePacket.setAchievementsDisabled(!geyser.config().gameplay().xboxAchievementsEnabled());
startGamePacket.setCurrentTick(-1);
startGamePacket.setEduEditionOffers(0);
startGamePacket.setEduFeaturesEnabled(false);
@@ -1786,7 +1786,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
startGamePacket.setBroadcastingToLan(true);
startGamePacket.setPlatformBroadcastMode(GamePublishSetting.PUBLIC);
startGamePacket.setXblBroadcastMode(GamePublishSetting.PUBLIC);
startGamePacket.setCommandsEnabled(!geyser.config().xboxAchievementsEnabled());
startGamePacket.setCommandsEnabled(!geyser.config().gameplay().xboxAchievementsEnabled());
startGamePacket.setTexturePacksRequired(false);
startGamePacket.setBonusChestEnabled(false);
startGamePacket.setStartingWithMap(false);
@@ -1804,7 +1804,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
startGamePacket.setEducationProductionId("");
startGamePacket.setForceExperimentalGameplay(OptionalBoolean.empty());
String serverName = geyser.config().bedrock().serverName();
String serverName = geyser.config().gameplay().serverName();
startGamePacket.setLevelId(serverName);
startGamePacket.setLevelName(serverName);
@@ -2459,7 +2459,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
private void softEnumPacket(String name, SoftEnumUpdateType type, String enums) {
// There is no need to send command enums if command suggestions are disabled
if (!this.geyser.config().commandSuggestions()) {
if (!this.geyser.config().gameplay().commandSuggestions()) {
return;
}
UpdateSoftEnumPacket packet = new UpdateSoftEnumPacket();

View File

@@ -62,8 +62,8 @@ public class PreferencesCache {
public PreferencesCache(GeyserSession session) {
this.session = session;
prefersCustomSkulls = session.getGeyser().config().allowCustomSkulls();
cooldownPreference = session.getGeyser().config().showCooldown();
prefersCustomSkulls = session.getGeyser().config().gameplay().maxVisibleCustomSkulls() != 0;
cooldownPreference = session.getGeyser().config().gameplay().showCooldown();
}
/**
@@ -72,10 +72,10 @@ public class PreferencesCache {
* If {@link #prefersShowCoordinates} is true, coordinates will be shown, unless either of the following conditions apply: <br>
* <br>
* {@link GeyserSession#isReducedDebugInfo()} is enabled
* {@link GeyserConfig#showCoordinates()} is disabled
* {@link GeyserConfig.GameplayConfig#showCoordinates()} is disabled
*/
public void updateShowCoordinates() {
allowShowCoordinates = !session.isReducedDebugInfo() && session.getGeyser().config().showCoordinates();
allowShowCoordinates = !session.isReducedDebugInfo() && session.getGeyser().config().gameplay().showCoordinates();
session.sendGameRule("showcoordinates", allowShowCoordinates && prefersShowCoordinates);
}
@@ -83,6 +83,6 @@ public class PreferencesCache {
* @return true if the session prefers custom skulls, and the config allows them.
*/
public boolean showCustomSkulls() {
return prefersCustomSkulls && session.getGeyser().config().allowCustomSkulls();
return prefersCustomSkulls && session.getGeyser().config().gameplay().maxVisibleCustomSkulls() != 0;
}
}

View File

@@ -67,11 +67,11 @@ public class SkullCache {
public SkullCache(GeyserSession session) {
this.session = session;
this.maxVisibleSkulls = session.getGeyser().config().maxVisibleCustomSkulls();
this.maxVisibleSkulls = session.getGeyser().config().gameplay().maxVisibleCustomSkulls();
this.cullingEnabled = this.maxVisibleSkulls != -1;
// Normal skulls are not rendered beyond 64 blocks
int distance = Math.min(session.getGeyser().config().customSkullRenderDistance(), 64);
int distance = Math.min(session.getGeyser().config().gameplay().customSkullRenderDistance(), 64);
this.skullRenderDistanceSquared = distance * distance;
}

View File

@@ -25,6 +25,8 @@
package org.geysermc.geyser.skin;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.gson.JsonObject;
import com.google.gson.JsonPrimitive;
import com.google.common.cache.Cache;

View File

@@ -58,7 +58,11 @@ import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.Objects;
import java.util.UUID;
import java.util.concurrent.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.function.Predicate;
public class SkinProvider {
@@ -144,7 +148,7 @@ public class SkinProvider {
public static void registerCacheImageTask(GeyserImpl geyser) {
// Schedule Daily Image Expiry if we are caching them
if (geyser.config().cacheImages() > 0) {
if (geyser.config().advanced().cacheImages() > 0) {
geyser.getScheduledThread().scheduleAtFixedRate(() -> {
File cacheFolder = GeyserImpl.getInstance().getBootstrap().getConfigFolder().resolve("cache").resolve("images").toFile();
if (!cacheFolder.exists()) {
@@ -152,7 +156,7 @@ public class SkinProvider {
}
int count = 0;
final long expireTime = ((long) GeyserImpl.getInstance().config().cacheImages()) * ((long)1000 * 60 * 60 * 24);
final long expireTime = ((long) GeyserImpl.getInstance().config().advanced().cacheImages()) * ((long)1000 * 60 * 60 * 24);
for (File imageFile : Objects.requireNonNull(cacheFolder.listFiles())) {
if (imageFile.lastModified() < System.currentTimeMillis() - expireTime) {
//noinspection ResultOfMethodCallIgnored
@@ -422,7 +426,7 @@ public class SkinProvider {
GeyserImpl.getInstance().getLogger().debug("Downloaded " + imageUrl);
// Write to cache if we are allowed
if (GeyserImpl.getInstance().config().cacheImages() > 0) {
if (GeyserImpl.getInstance().config().advanced().cacheImages() > 0) {
imageFile.getParentFile().mkdirs();
try {
ImageIO.write(image, "png", imageFile);

View File

@@ -173,7 +173,7 @@ public class BedrockInventoryTransactionTranslator extends PacketTranslator<Inve
final Vector3i packetBlockPosition = packet.getBlockPosition();
Vector3i blockPos = BlockUtils.getBlockPosition(packetBlockPosition, Direction.getUntrusted(packet, InventoryTransactionPacket::getBlockFace));
if (session.getGeyser().config().disableBedrockScaffolding()) {
if (session.getGeyser().config().gameplay().disableBedrockScaffolding()) {
float yaw = session.getPlayerEntity().getYaw();
boolean isGodBridging = switch (packet.getBlockFace()) {
case 2 -> yaw <= -135f || yaw > 135f;

View File

@@ -48,7 +48,7 @@ public class BedrockNetworkStackLatencyTranslator extends PacketTranslator<Netwo
public void translate(GeyserSession session, NetworkStackLatencyPacket packet) {
// negative timestamps are used as hack to fix the url image loading bug
if (packet.getTimestamp() >= 0) {
if (session.getGeyser().config().forwardPlayerPing()) {
if (session.getGeyser().config().gameplay().forwardPlayerPing()) {
// use our cached value because
// a) bedrock can be inaccurate with the value returned
// b) playstation replies with a different magnitude than other platforms

View File

@@ -123,7 +123,7 @@ public class JavaCommandsTranslator extends PacketTranslator<ClientboundCommands
@Override
public void translate(GeyserSession session, ClientboundCommandsPacket packet) {
// Don't send command suggestions if they are disabled
if (!session.getGeyser().config().commandSuggestions()) {
if (!session.getGeyser().config().gameplay().commandSuggestions()) {
session.getGeyser().getLogger().debug("Not sending translated command suggestions as they are disabled.");
// Send a mostly empty packet so Bedrock doesn't override /help with its own, built-in help command.

View File

@@ -39,7 +39,7 @@ public class JavaKeepAliveTranslator extends PacketTranslator<ClientboundKeepAli
@Override
public void translate(GeyserSession session, ClientboundKeepAlivePacket packet) {
if (!session.getGeyser().config().forwardPlayerPing()) {
if (!session.getGeyser().config().gameplay().forwardPlayerPing()) {
return;
}
// We use this once the client replies (see BedrockNetworkStackLatencyTranslator)

View File

@@ -44,7 +44,7 @@ public class CooldownUtils {
* @param session GeyserSession
*/
public static void sendCooldown(GeyserSession session) {
if (session.getGeyser().config().showCooldown() == CooldownType.DISABLED) return;
if (session.getGeyser().config().gameplay().showCooldown() == CooldownType.DISABLED) return;
CooldownType sessionPreference = session.getPreferencesCache().getCooldownPreference();
if (sessionPreference == CooldownType.DISABLED) return;

View File

@@ -314,7 +314,7 @@ public class InventoryUtils {
private static ItemDefinition getUnusableSpaceBlockDefinition(int protocolVersion) {
ItemMappings mappings = Registries.ITEMS.forVersion(protocolVersion);
String unusableSpaceBlock = GeyserImpl.getInstance().config().unusableSpaceBlock();
String unusableSpaceBlock = GeyserImpl.getInstance().config().gameplay().unusableSpaceBlock();
ItemDefinition itemDefinition = mappings.getDefinition(unusableSpaceBlock);
if (itemDefinition == null) {

View File

@@ -66,7 +66,7 @@ public class LoginEncryptionUtils {
geyser.getLogger().debug(String.format("Is player data signed? %s", result.signed()));
if (!result.signed() && !session.getGeyser().config().disableXboxAuth()) {
if (!result.signed() && session.getGeyser().config().advanced().bedrock().validateBedrockLogin()) {
session.disconnect(GeyserLocale.getLocaleStringLog("geyser.network.remote.invalid_xbox_account"));
return;
}

View File

@@ -54,8 +54,8 @@ public class SettingsUtils {
// Let's store these to avoid issues
boolean showCoordinates = session.getPreferencesCache().isAllowShowCoordinates();
boolean cooldownShown = session.getGeyser().config().showCooldown() != CooldownUtils.CooldownType.DISABLED;
boolean customSkulls = session.getGeyser().config().allowCustomSkulls();
boolean cooldownShown = session.getGeyser().config().gameplay().showCooldown() != CooldownUtils.CooldownType.DISABLED;
boolean customSkulls = session.getGeyser().config().gameplay().maxVisibleCustomSkulls() != 0;
// Only show the client title if any of the client settings are available
boolean showClientSettings = showCoordinates || cooldownShown || customSkulls;

View File

@@ -25,28 +25,31 @@
package org.geysermc.geyser.configuration;
import lombok.SneakyThrows;
import org.geysermc.geyser.api.util.PlatformType;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import org.spongepowered.configurate.CommentedConfigurationNode;
import org.spongepowered.configurate.util.CheckedConsumer;
import java.io.File;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
import java.util.List;
import java.util.Objects;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class ConfigLoaderTest {
private static final String CONFIG_PREFIX = "configuration";
@TempDir
Path tempDirectory;
// Hack until improving ConfigLoader
CommentedConfigurationNode config1;
CommentedConfigurationNode config2;
@Test
void testCreateNewConfig() throws Exception {
// Test that the result of generating a config, and the result of reading it back after writing it, is the same
@@ -54,12 +57,13 @@ public class ConfigLoaderTest {
File file = tempDirectory.resolve("config.yml").toFile();
forAllConfigs(type -> {
new ConfigLoader(file).transformer(n -> this.config1 = n.copy()).load(type);
CommentedConfigurationNode config1 = new ConfigLoader(file).loadConfigurationNode(type, PlatformType.STANDALONE);
long initialModification = file.lastModified();
assertTrue(file.exists()); // should have been created
List<String> firstContents = Files.readAllLines(file.toPath());
new ConfigLoader(file).transformer(n -> this.config2 = n.copy()).load(type);
CommentedConfigurationNode config2 = new ConfigLoader(file).loadConfigurationNode(type, PlatformType.STANDALONE);
List<String> secondContents = Files.readAllLines(file.toPath());
assertEquals(initialModification, file.lastModified()); // should not have been touched
@@ -72,8 +76,63 @@ public class ConfigLoaderTest {
});
}
@Test
void testDefaultConfigMigration() throws Exception {
testConfiguration("default");
}
@Test
void testAllChangedConfigMigration() throws Exception {
testConfiguration("all-changed");
}
@Test
void testLegacyConfigMigration() throws Exception {
testConfiguration("legacy");
}
// @Test
// TODO test whether the @NumericRanges are properly applied & result in a failed config
// void testInvalidConfig() throws Exception {
// testConfiguration("invalid");
// }
public void testConfiguration(String folder) throws Exception {
forAllConfigs(type -> {
CommentedConfigurationNode oldTransformed = new ConfigLoader(copyResourceToTempFile(folder, "before.yml"))
.loadConfigurationNode(type, getPlatformType(type));
String configName = type == GeyserRemoteConfig.class ? "remote" : "plugin";
CommentedConfigurationNode newTransformed = new ConfigLoader(copyResourceToTempFile(folder, configName + ".yml"))
.loadConfigurationNode(type, getPlatformType(type));
assertEquals(oldTransformed, newTransformed);
});
}
File copyResourceToTempFile(String... path) throws Exception {
File resource = getConfigResource(CONFIG_PREFIX + "/" + String.join("/", path));
return Files.copy(resource.toPath(), tempDirectory.resolve(resource.getName()), StandardCopyOption.REPLACE_EXISTING).toFile();
}
PlatformType getPlatformType(Class<? extends GeyserConfig> configClass) {
if (configClass == GeyserRemoteConfig.class) {
return PlatformType.STANDALONE;
}
if (configClass == GeyserPluginConfig.class) {
return PlatformType.SPIGOT;
}
throw new IllegalArgumentException("Unsupported config class " + configClass);
}
void forAllConfigs(CheckedConsumer<Class<? extends GeyserConfig>, Exception> consumer) throws Exception {
consumer.accept(GeyserRemoteConfig.class);
consumer.accept(GeyserPluginConfig.class);
consumer.accept(GeyserRemoteConfig.class);
}
@SneakyThrows
private File getConfigResource(String name) {
URL url = Objects.requireNonNull(getClass().getClassLoader().getResource(name), "No resource for name: " + name);
return Path.of(url.toURI()).toFile();
}
}

View File

@@ -50,10 +50,10 @@ public class GeyserMockContext {
var geyserImpl = context.mock(GeyserImpl.class);
var config = context.mock(GeyserConfig.class);
when(config.scoreboardPacketThreshold()).thenReturn(1_000);
when(geyserImpl.config()).thenReturn(config);
var advancedConfig = context.mock(GeyserConfig.AdvancedConfig.class);
when(config.advanced()).thenReturn(advancedConfig);
when(advancedConfig.scoreboardPacketThreshold()).thenReturn(1_000);
var logger = context.storeObject(new EmptyGeyserLogger());
when(geyserImpl.getLogger()).thenReturn(logger);

View File

@@ -0,0 +1,219 @@
# --------------------------------
# Geyser Configuration File
#
# A bridge between Minecraft: Bedrock Edition and Minecraft: Java Edition.
#
# GitHub: https://github.com/GeyserMC/Geyser
# Discord: https://discord.gg/geysermc
# Wiki: https://wiki.geysermc.org/
#
# NOTICE: See https://wiki.geysermc.org/geyser/setup/ for the setup guide. Many video tutorials are outdated.
# In most cases, especially with server hosting providers, further hosting-specific configuration is required.
# --------------------------------
bedrock:
# The IP address that will listen for connections.
# Generally, you should only uncomment and change this if you want to limit what IPs can connect to your server.
address: 127.0.0.1
# The port that will listen for connections
port: 19122
# Some hosting services change your Java port everytime you start the server and require the same port to be used for Bedrock.
# This option makes the Bedrock port the same as the Java port every time you start the server.
# This option is for the plugin version only.
clone-remote-port: true
# The MOTD that will be broadcasted to Minecraft: Bedrock Edition clients. This is irrelevant if "passthrough-motd" is set to true
# If either of these are empty, the respective string will default to "Geyser"
motd1: "Gayser"
motd2: "Another Gayser server."
# The Server Name that will be sent to Minecraft: Bedrock Edition clients. This is visible in both the pause menu and the settings menu.
server-name: "Gayser"
# How much to compress network traffic to the Bedrock client. The higher the number, the more CPU usage used, but
# the smaller the bandwidth used. Does not have any effect below -1 or above 9. Set to -1 to disable.
compression-level: 5
# The port to broadcast to Bedrock clients with the MOTD that they should use to connect to the server.
# DO NOT uncomment and change this unless Geyser runs on a different internal port than the one that is used to connect.
broadcast-port: 19133
# Whether to enable PROXY protocol or not for clients. You DO NOT WANT this feature unless you run UDP reverse proxy
# in front of your Geyser instance.
enable-proxy-protocol: true
# A list of allowed PROXY protocol speaking proxy IP addresses/subnets. Only effective when "enable-proxy-protocol" is enabled, and
# should really only be used when you are not able to use a proper firewall (usually true with shared hosting providers etc.).
# Keeping this list empty means there is no IP address whitelist.
# IP addresses, subnets, and links to plain text files are supported.
proxy-protocol-whitelisted-ips: [ "127.0.0.1", "172.18.0.0/13" ]
remote:
# The IP address of the remote (Java Edition) server
# If it is "auto", for standalone version the remote address will be set to 127.0.0.1,
# for plugin versions, it is recommended to keep this as "auto" so Geyser will automatically configure address, port, and auth-type.
# Leave as "auto" if floodgate is installed.
address: test.geysermc.org
# The port of the remote (Java Edition) server
# For plugin versions, if address has been set to "auto", the port will also follow the server's listening port.
port: 25564
# Authentication type. Can be offline, online, or floodgate (see https://github.com/GeyserMC/Geyser/wiki/Floodgate).
# For plugin versions, it's recommended to keep the `address` field to "auto" so Floodgate support is automatically configured.
# If Floodgate is installed and `address:` is set to "auto", then "auth-type: floodgate" will automatically be used.
auth-type: floodgate
# Whether to enable PROXY protocol or not while connecting to the server.
# This is useful only when:
# 1) Your server supports PROXY protocol (it probably doesn't)
# 2) You run Velocity or BungeeCord with the option enabled in the proxy's main config.
# IF YOU DON'T KNOW WHAT THIS IS, DON'T TOUCH IT!
use-proxy-protocol: true
# Forward the hostname that the Bedrock client used to connect over to the Java server
# This is designed to be used for forced hosts on proxies
forward-hostname: true
# Floodgate uses encryption to ensure use from authorised sources.
# This should point to the public key generated by Floodgate (BungeeCord, Spigot or Velocity)
# You can ignore this when not using Floodgate.
# If you're using a plugin version of Floodgate on the same server, the key will automatically be picked up from Floodgate.
floodgate-key-file: keyyy.pem
# For online mode authentication type only.
# Stores a list of Bedrock players that should have their Java Edition account saved after login.
# This saves a token that can be reused to authenticate the player later. This does not save emails or passwords,
# but you should still be cautious when adding to this list and giving others access to this Geyser instance's files.
# Removing a name from this list will delete its cached login information on the next Geyser startup.
# The file that tokens will be saved in is in the same folder as this config, named "saved-refresh-tokens.json".
saved-user-logins:
- ThisExampleUsername
- ThisOther
# Specify how many seconds to wait while user authorizes Geyser to access their Microsoft account.
# User is allowed to disconnect from the server during this period.
pending-authentication-timeout: 111
# Bedrock clients can freeze when opening up the command prompt for the first time if given a lot of commands.
# Disabling this will prevent command suggestions from being sent and solve freezing for Bedrock clients.
command-suggestions: false
# The following three options enable "ping passthrough" - the MOTD, player count and/or protocol name gets retrieved from the Java server.
# Relay the MOTD from the remote server to Bedrock players.
passthrough-motd: false
# Relay the player count and max players from the remote server to Bedrock players.
passthrough-player-counts: false
# Enable LEGACY ping passthrough. There is no need to enable this unless your MOTD or player count does not appear properly.
# This option does nothing on standalone.
legacy-ping-passthrough: true
# How often to ping the remote server, in seconds. Only relevant for standalone or legacy ping passthrough.
# Increase if you are getting BrokenPipe errors.
ping-passthrough-interval: 2
# Whether to forward player ping to the server. While enabling this will allow Bedrock players to have more accurate
# ping, it may also cause players to time out more easily.
forward-player-ping: true
# Maximum amount of players that can connect. This is only visual at this time and does not actually limit player count.
max-players: 99
# If debug messages should be sent through console
debug-mode: true
# Allow a fake cooldown indicator to be sent. Bedrock players otherwise do not see a cooldown as they still use 1.8 combat.
# Please note: if the cooldown is enabled, some users may see a black box during the cooldown sequence, like below:
# https://cdn.discordapp.com/attachments/613170125696270357/957075682230419466/Screenshot_from_2022-03-25_20-35-08.png
# This can be disabled by going into Bedrock settings under the accessibility tab and setting "Text Background Opacity" to 0
# This setting can be set to "title", "actionbar" or "false"
show-cooldown: actionbar
# Controls if coordinates are shown to players.
show-coordinates: false
# Whether Bedrock players are blocked from performing their scaffolding-style bridging.
disable-bedrock-scaffolding: true
# If set, when a Bedrock player performs any emote, it will swap the offhand and mainhand items, just like the Java Edition keybind
# There are three options this can be set to:
# disabled - the default/fallback, which doesn't apply this workaround
# no-emotes - emotes will NOT be sent to other Bedrock clients and offhand will be swapped. This effectively disables all emotes from being seen.
# emotes-and-offhand - emotes will be sent to Bedrock clients and offhand will be swapped
emote-offhand-workaround: "no-emotes"
# The default locale if we dont have the one the client requested. Uncomment to not use the default system language.
default-locale: en_uk
# Specify how many days images will be cached to disk to save downloading them from the internet.
# A value of 0 is disabled. (Default: 0)
cache-images: 10
# Allows custom skulls to be displayed. Keeping them enabled may cause a performance decrease on older/weaker devices.
allow-custom-skulls: false
# The maximum number of custom skulls to be displayed per player. Increasing this may decrease performance on weaker devices.
# Setting this to -1 will cause all custom skulls to be displayed regardless of distance or number.
max-visible-custom-skulls: 111
# The radius in blocks around the player in which custom skulls are displayed.
custom-skull-render-distance: 19
# Whether to add any items and blocks which normally does not exist in Bedrock Edition.
# This should only need to be disabled if using a proxy that does not use the "transfer packet" style of server switching.
# If this is disabled, furnace minecart items will be mapped to hopper minecart items.
# Geyser's block, item, and skull mappings systems will also be disabled.
# This option requires a restart of Geyser in order to change its setting.
add-non-bedrock-items: false
# Bedrock prevents building and displaying blocks above Y127 in the Nether.
# This config option works around that by changing the Nether dimension ID to the End ID.
# The main downside to this is that the entire Nether will have the same red fog rather than having different fog for each biome.
above-bedrock-nether-building: true
# Force clients to load all resource packs if there are any.
# If set to false, it allows the user to connect to the server even if they don't
# want to download the resource packs.
force-resource-packs: false
# Allows Xbox achievements to be unlocked.
xbox-achievements-enabled: true
# Whether player IP addresses will be logged by the server.
log-player-ip-addresses: false
# Whether to alert the console and operators that a new Geyser version is available that supports a Bedrock version
# that this Geyser version does not support. It's recommended to keep this option enabled, as many Bedrock platforms
# auto-update.
notify-on-new-bedrock-update: false
# Which item to use to mark unavailable slots in a Bedrock player inventory. Examples of this are the 2x2 crafting grid while in creative,
# or custom inventory menus with sizes different from the usual 3x9. A barrier block is the default item.
unusable-space-block: minecraft:apple
# bStats is a stat tracker that is entirely anonymous and tracks only basic information
# about Geyser, such as how many people are online, how many servers are using Geyser,
# what OS is being used, etc. You can learn more about bStats here: https://bstats.org/.
# https://bstats.org/plugin/server-implementation/GeyserMC
metrics:
# If metrics should be enabled
enabled: false
# UUID of server, don't change!
uuid: 00000000-0000-0000-0000-000000000000
# ADVANCED OPTIONS - DO NOT TOUCH UNLESS YOU KNOW WHAT YOU ARE DOING!
# Geyser updates the Scoreboard after every Scoreboard packet, but when Geyser tries to handle
# a lot of scoreboard packets per second can cause serious lag.
# This option allows you to specify after how many Scoreboard packets per seconds
# the Scoreboard updates will be limited to four updates per second.
scoreboard-packet-threshold: 10
# Allow connections from ProxyPass and Waterdog.
# See https://www.spigotmc.org/wiki/firewall-guide/ for assistance - use UDP instead of TCP.
enable-proxy-connections: true
# The internet supports a maximum MTU of 1492 but could cause issues with packet fragmentation.
# 1400 is the default.
mtu: 1399
# Whether to connect directly into the Java server without creating a TCP connection.
# This should only be disabled if a plugin that interfaces with packets or the network does not work correctly with Geyser.
# If enabled on plugin versions, the remote address and port sections are ignored
# If disabled on plugin versions, expect performance decrease and latency increase
use-direct-connection: false
# Whether Geyser should attempt to disable compression for Bedrock players. This should be a benefit as there is no need to compress data
# when Java packets aren't being handled over the network.
# This requires use-direct-connection to be true.
disable-compression: false
config-version: 4

View File

@@ -0,0 +1,234 @@
# --------------------------------
# Geyser Configuration File
#
# A bridge between Minecraft: Bedrock Edition and Minecraft: Java Edition.
#
# GitHub: https://github.com/GeyserMC/Geyser
# Discord: https://discord.gg/geysermc
# Wiki: https://geysermc.org/wiki
#
# NOTICE: See https://geysermc.org/wiki/geyser/setup/ for the setup guide. Many video tutorials are outdated.
# In most cases, especially with server hosting providers, further hosting-specific configuration is required.
# --------------------------------
# Network settings for the Bedrock listener
bedrock:
# The IP address that Geyser will bind on to listen for incoming Bedrock connections.
# Generally, you should only change this if you want to limit what IPs can connect to your server.
address: 127.0.0.1
# The port that will Geyser will listen on for incoming Bedrock connections.
# Since Minecraft: Bedrock Edition uses UDP, this port must allow UDP traffic.
port: 19122
# Some hosting services change your Java port everytime you start the server and require the same port to be used for Bedrock.
# This option makes the Bedrock port the same as the Java port every time you start the server.
clone-remote-port: true
# Network settings for the Java server connection
java:
# 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".
auth-type: floodgate
# MOTD settings
motd:
# The MOTD that will be broadcasted to Minecraft: Bedrock Edition clients. This is irrelevant if "passthrough-motd" is set to true.
# If either of these are empty, the respective string will default to "Geyser"
primary-motd: Gayser
secondary-motd: Another Gayser server.
# Whether Geyser should relay the MOTD from the Java server to Bedrock players.
passthrough-motd: false
# Maximum amount of players that can connect.
# This is only visual, and is only applied if passthrough-motd is disabled.
max-players: 99
# Whether to relay the player count and max players from the Java server to Bedrock players.
passthrough-player-counts: false
# Whether to use server API methods to determine the Java server's MOTD and ping passthrough.
# There is no need to disable this unless your MOTD or player count does not appear properly.
integrated-ping-passthrough: false
# How often to ping the Java server to refresh MOTD and player count, in seconds.
# Only relevant if integrated-ping-passthrough is disabled.
ping-passthrough-interval: 2
# Gameplay options that affect Bedrock players
gameplay:
# The server name that will be sent to Minecraft: Bedrock Edition clients. This is visible in both the pause menu and the settings menu.
server-name: Gayser
# Whether to automatically serve the GeyserOptionalPack to all connecting players.
# This adds some quality-of-life visual fixes for Bedrock players.
# See https://geysermc.org/wiki/other/geyseroptionalpack for all current features.
# If enabled, force-resource-packs will be enabled.
enable-optional-pack: true
# Allow a fake cooldown indicator to be sent. Bedrock players otherwise do not see a cooldown as they still use 1.8 combat.
# Please note: if the cooldown is enabled, some users may see a black box during the cooldown sequence, like below:
# https://geysermc.org/img/external/cooldown_indicator.png
# This can be disabled by going into Bedrock settings under the accessibility tab and setting "Text Background Opacity" to 0
# This setting can be set to "title", "actionbar" or "false"
show-cooldown: actionbar
# Bedrock clients can freeze when opening up the command prompt for the first time if given a lot of commands.
# Disabling this will prevent command suggestions from being sent and solve freezing for Bedrock clients.
command-suggestions: false
# Controls if coordinates are shown to players.
show-coordinates: false
# Whether Bedrock players are blocked from performing their scaffolding-style bridging.
disable-bedrock-scaffolding: true
# Bedrock prevents building and displaying blocks above Y127 in the Nether.
# This config option works around that by changing the Nether dimension ID to the End ID.
# The main downside to this is that the entire Nether will have the same red fog rather than having different fog for each biome.
nether-roof-workaround: true
# Which item to use to mark unavailable slots in a Bedrock player inventory. Examples of this are the 2x2 crafting grid while in creative,
# or custom inventory menus with sizes different from the usual 3x9. A barrier block is the default item.
# This config option can be set to any Bedrock item identifier. If you want to set this to a custom item, make sure that you specify the item in the following format: "geyser_custom:<mapping-name>"
unusable-space-block: minecraft:apple
# Whether to add any items and blocks which normally does not exist in Bedrock Edition.
# This should only need to be disabled if using a proxy that does not use the "transfer packet" style of server switching.
# If this is disabled, furnace minecart items will be mapped to hopper minecart items.
# Geyser's block, item, and skull mappings systems will also be disabled.
# This option requires a restart of Geyser in order to change its setting.
enable-custom-content: false
# Force clients to load all resource packs if there are any.
# If set to false, it allows the user to connect to the server even if they don't
# want to download the resource packs.
force-resource-packs: false
# Whether to forward player ping to the server. While enabling this will allow Bedrock players to have more accurate
# ping, it may also cause players to time out more easily.
forward-player-ping: true
# Allows Xbox achievements to be unlocked.
# If a player types in an unknown command, they will receive a message that states cheats are disabled.
# Otherwise, commands work as expected.
xbox-achievements-enabled: true
# The maximum number of custom skulls to be displayed per player. Increasing this may decrease performance on weaker devices.
# A value of 0 will disable all custom skulls.
# Setting this to -1 will cause all custom skulls to be displayed regardless of distance or number.
max-visible-custom-skulls: 111
# The radius in blocks around the player in which custom skulls are displayed.
custom-skull-render-distance: 19
# The default locale if we don't have the one the client requested. If set to "system", the system's language will be used.
default-locale: en_uk
# Whether player IP addresses will be logged by the server.
log-player-ip-addresses: false
# For online mode authentication type only.
# Stores a list of Bedrock player usernames that should have their Java Edition account saved after login.
# This saves a token that can be reused to authenticate the player later. This does not save emails or passwords,
# but you should still be cautious when adding to this list and giving others access to this Geyser instance's files.
# Removing a name from this list will delete its cached login information on the next Geyser startup.
# The file that tokens will be saved in is in the same folder as this config, named "saved-refresh-tokens.json".
saved-user-logins:
- ThisExampleUsername
- ThisOther
# For online mode authentication type only.
# Specify how many seconds to wait while user authorizes Geyser to access their Microsoft account.
# User is allowed to disconnect from the server during this period.
pending-authentication-timeout: 111
# Whether to alert the console and operators that a new Geyser version is available that supports a Bedrock version
# that this Geyser version does not support. It's recommended to keep this option enabled, as many Bedrock platforms
# auto-update.
notify-on-new-bedrock-update: false
# Advanced configuration options. These usually do not need modifications.
advanced:
# Specify how many days player skin images will be cached to disk to save downloading them from the internet.
# A value of 0 is disabled. (Default: 0)
cache-images: 10
# Geyser updates the Scoreboard after every Scoreboard packet, but when Geyser tries to handle
# a lot of scoreboard packets per second, this can cause serious lag.
# This option allows you to specify after how many Scoreboard packets per seconds
# the Scoreboard updates will be limited to four updates per second.
scoreboard-packet-threshold: 10
# Whether Geyser should send team names in command suggestions.
# Disable this if you have a lot of teams used that you don't need as suggestions.
add-team-suggestions: true
# Floodgate uses encryption to ensure use from authorized sources.
# This should point to the public key generated by Floodgate (BungeeCord, Spigot or Velocity)
# You can ignore this when not using Floodgate.
# If you're using a plugin version of Floodgate on the same server, the key will automatically be picked up from Floodgate.
floodgate-key-file: keyyy.pem
# Advanced networking options for the Geyser to Java server connection
java:
# Whether to enable HAPROXY protocol when connecting to the Java server.
# This is useful only when:
# 1) Your Java server supports HAPROXY protocol (it probably doesn't)
# 2) You run Velocity or BungeeCord with the option enabled in the proxy's main config.
# IF YOU DON'T KNOW WHAT THIS IS, DON'T TOUCH IT!
use-haproxy-protocol: true
# Whether to connect directly into the Java server without creating a TCP connection.
# This should only be disabled if a plugin that interfaces with packets or the network does not work correctly with Geyser.
# If enabled, the remote address and port sections are ignored.
# If disabled, expect performance decrease and latency increase.
use-direct-connection: false
# Whether Geyser should attempt to disable packet compression (from the Java Server to Geyser) for Bedrock players.
# This should be a benefit as there is no need to compress data when Java packets aren't being handled over the network.
# This requires use-direct-connection to be true.
disable-compression: false
# Advanced networking options for Geyser's Bedrock listener
bedrock:
# The port to broadcast to Bedrock clients with the MOTD that they should use to connect to the server.
# A value of 0 will broadcast the port specified above.
# DO NOT change this unless Geyser runs on a different port than the one that is used to connect.
broadcast-port: 19133
# How much to compress network traffic to the Bedrock client. The higher the number, the more CPU usage used, but
# the smaller the bandwidth used. Does not have any effect below -1 or above 9. Set to -1 to disable.
compression-level: 5
# Whether to expect HAPROXY protocol for connecting Bedrock clients.
# This is useful only when you are running a UDP reverse proxy in front of your Geyser instance.
# IF YOU DON'T KNOW WHAT THIS IS, DON'T TOUCH IT!
use-haproxy-protocol: true
# A list of allowed HAPROXY protocol speaking proxy IP addresses/subnets. Only effective when "use-proxy-protocol" is enabled, and
# should really only be used when you are not able to use a proper firewall (usually true with shared hosting providers etc.).
# Keeping this list empty means there is no IP address whitelist.
# IP addresses, subnets, and links to plain text files are supported.
proxy-protocol-whitelisted-ips:
- 127.0.0.1
- 172.18.0.0/13
# The internet supports a maximum MTU of 1492 but could cause issues with packet fragmentation.
# 1400 is the default.
mtu: 1399
# This option disables the auth step Geyser performs for connecting Bedrock players.
# It can be used to allow connections from ProxyPass and WaterdogPE. In these cases, make sure that users
# cannot directly connect to this Geyser instance. See https://www.spigotmc.org/wiki/firewall-guide/ for
# assistance - and use UDP instead of TCP.
# Disabling Bedrock authentication for other use-cases is NOT SUPPORTED, as it allows anyone to spoof usernames, and is therefore a security risk.
# All Floodgate functionality (including skin uploading and account linking) will also not work when this option is disabled.
validate-bedrock-login: true
# If debug messages should be sent through console
debug-mode: true
# Do not change!
config-version: 5

View File

@@ -0,0 +1,233 @@
# --------------------------------
# Geyser Configuration File
#
# A bridge between Minecraft: Bedrock Edition and Minecraft: Java Edition.
#
# GitHub: https://github.com/GeyserMC/Geyser
# Discord: https://discord.gg/geysermc
# Wiki: https://geysermc.org/wiki
#
# NOTICE: See https://geysermc.org/wiki/geyser/setup/ for the setup guide. Many video tutorials are outdated.
# In most cases, especially with server hosting providers, further hosting-specific configuration is required.
# --------------------------------
# Network settings for the Bedrock listener
bedrock:
# The IP address that Geyser will bind on to listen for incoming Bedrock connections.
# Generally, you should only change this if you want to limit what IPs can connect to your server.
address: 127.0.0.1
# The port that will Geyser will listen on for incoming Bedrock connections.
# Since Minecraft: Bedrock Edition uses UDP, this port must allow UDP traffic.
port: 19122
# Network settings for the Java server connection
java:
# The IP address of the Java Edition server.
address: test.geysermc.org
# The port of the Java Edition server.
port: 25564
# 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".
auth-type: floodgate
# Whether to forward the hostname that the Bedrock client used to connect over to the Java server.
# This is designed to be used for forced hosts on proxies.
forward-hostname: true
# MOTD settings
motd:
# The MOTD that will be broadcasted to Minecraft: Bedrock Edition clients. This is irrelevant if "passthrough-motd" is set to true.
# If either of these are empty, the respective string will default to "Geyser"
primary-motd: Gayser
secondary-motd: Another Gayser server.
# Whether Geyser should relay the MOTD from the Java server to Bedrock players.
passthrough-motd: false
# Maximum amount of players that can connect.
# This is only visual, and is only applied if passthrough-motd is disabled.
max-players: 99
# Whether to relay the player count and max players from the Java server to Bedrock players.
passthrough-player-counts: false
# How often to ping the Java server to refresh MOTD and player count, in seconds.
ping-passthrough-interval: 2
# Gameplay options that affect Bedrock players
gameplay:
# The server name that will be sent to Minecraft: Bedrock Edition clients. This is visible in both the pause menu and the settings menu.
server-name: Gayser
# Whether to automatically serve the GeyserOptionalPack to all connecting players.
# This adds some quality-of-life visual fixes for Bedrock players.
# See https://geysermc.org/wiki/other/geyseroptionalpack for all current features.
# If enabled, force-resource-packs will be enabled.
enable-optional-pack: true
# Allow a fake cooldown indicator to be sent. Bedrock players otherwise do not see a cooldown as they still use 1.8 combat.
# Please note: if the cooldown is enabled, some users may see a black box during the cooldown sequence, like below:
# https://geysermc.org/img/external/cooldown_indicator.png
# This can be disabled by going into Bedrock settings under the accessibility tab and setting "Text Background Opacity" to 0
# This setting can be set to "title", "actionbar" or "false"
show-cooldown: actionbar
# Bedrock clients can freeze when opening up the command prompt for the first time if given a lot of commands.
# Disabling this will prevent command suggestions from being sent and solve freezing for Bedrock clients.
command-suggestions: false
# Controls if coordinates are shown to players.
show-coordinates: false
# Whether Bedrock players are blocked from performing their scaffolding-style bridging.
disable-bedrock-scaffolding: true
# Bedrock prevents building and displaying blocks above Y127 in the Nether.
# This config option works around that by changing the Nether dimension ID to the End ID.
# The main downside to this is that the entire Nether will have the same red fog rather than having different fog for each biome.
nether-roof-workaround: true
# Which item to use to mark unavailable slots in a Bedrock player inventory. Examples of this are the 2x2 crafting grid while in creative,
# or custom inventory menus with sizes different from the usual 3x9. A barrier block is the default item.
# This config option can be set to any Bedrock item identifier. If you want to set this to a custom item, make sure that you specify the item in the following format: "geyser_custom:<mapping-name>"
unusable-space-block: minecraft:apple
# Whether to add any items and blocks which normally does not exist in Bedrock Edition.
# This should only need to be disabled if using a proxy that does not use the "transfer packet" style of server switching.
# If this is disabled, furnace minecart items will be mapped to hopper minecart items.
# Geyser's block, item, and skull mappings systems will also be disabled.
# This option requires a restart of Geyser in order to change its setting.
enable-custom-content: false
# Force clients to load all resource packs if there are any.
# If set to false, it allows the user to connect to the server even if they don't
# want to download the resource packs.
force-resource-packs: false
# Whether to forward player ping to the server. While enabling this will allow Bedrock players to have more accurate
# ping, it may also cause players to time out more easily.
forward-player-ping: true
# Allows Xbox achievements to be unlocked.
# If a player types in an unknown command, they will receive a message that states cheats are disabled.
# Otherwise, commands work as expected.
xbox-achievements-enabled: true
# The maximum number of custom skulls to be displayed per player. Increasing this may decrease performance on weaker devices.
# A value of 0 will disable all custom skulls.
# Setting this to -1 will cause all custom skulls to be displayed regardless of distance or number.
max-visible-custom-skulls: 111
# The radius in blocks around the player in which custom skulls are displayed.
custom-skull-render-distance: 19
# The default locale if we don't have the one the client requested. If set to "system", the system's language will be used.
default-locale: en_uk
# Whether player IP addresses will be logged by the server.
log-player-ip-addresses: false
# For online mode authentication type only.
# Stores a list of Bedrock player usernames that should have their Java Edition account saved after login.
# This saves a token that can be reused to authenticate the player later. This does not save emails or passwords,
# but you should still be cautious when adding to this list and giving others access to this Geyser instance's files.
# Removing a name from this list will delete its cached login information on the next Geyser startup.
# The file that tokens will be saved in is in the same folder as this config, named "saved-refresh-tokens.json".
saved-user-logins:
- ThisExampleUsername
- ThisOther
# For online mode authentication type only.
# Specify how many seconds to wait while user authorizes Geyser to access their Microsoft account.
# User is allowed to disconnect from the server during this period.
pending-authentication-timeout: 111
# Whether to alert the console and operators that a new Geyser version is available that supports a Bedrock version
# that this Geyser version does not support. It's recommended to keep this option enabled, as many Bedrock platforms
# auto-update.
notify-on-new-bedrock-update: false
# Advanced configuration options. These usually do not need modifications.
advanced:
# Specify how many days player skin images will be cached to disk to save downloading them from the internet.
# A value of 0 is disabled. (Default: 0)
cache-images: 10
# Geyser updates the Scoreboard after every Scoreboard packet, but when Geyser tries to handle
# a lot of scoreboard packets per second, this can cause serious lag.
# This option allows you to specify after how many Scoreboard packets per seconds
# the Scoreboard updates will be limited to four updates per second.
scoreboard-packet-threshold: 10
# Whether Geyser should send team names in command suggestions.
# Disable this if you have a lot of teams used that you don't need as suggestions.
add-team-suggestions: true
# Floodgate uses encryption to ensure use from authorized sources.
# This should point to the public key generated by Floodgate (BungeeCord, Spigot or Velocity)
# You can ignore this when not using Floodgate.
# If you're using a plugin version of Floodgate on the same server, the key will automatically be picked up from Floodgate.
floodgate-key-file: keyyy.pem
# Advanced networking options for the Geyser to Java server connection
java:
# Whether to enable HAPROXY protocol when connecting to the Java server.
# This is useful only when:
# 1) Your Java server supports HAPROXY protocol (it probably doesn't)
# 2) You run Velocity or BungeeCord with the option enabled in the proxy's main config.
# IF YOU DON'T KNOW WHAT THIS IS, DON'T TOUCH IT!
use-haproxy-protocol: true
# Advanced networking options for Geyser's Bedrock listener
bedrock:
# The port to broadcast to Bedrock clients with the MOTD that they should use to connect to the server.
# A value of 0 will broadcast the port specified above.
# DO NOT change this unless Geyser runs on a different port than the one that is used to connect.
broadcast-port: 19133
# How much to compress network traffic to the Bedrock client. The higher the number, the more CPU usage used, but
# the smaller the bandwidth used. Does not have any effect below -1 or above 9. Set to -1 to disable.
compression-level: 5
# Whether to expect HAPROXY protocol for connecting Bedrock clients.
# This is useful only when you are running a UDP reverse proxy in front of your Geyser instance.
# IF YOU DON'T KNOW WHAT THIS IS, DON'T TOUCH IT!
use-haproxy-protocol: true
# A list of allowed HAPROXY protocol speaking proxy IP addresses/subnets. Only effective when "use-proxy-protocol" is enabled, and
# should really only be used when you are not able to use a proper firewall (usually true with shared hosting providers etc.).
# Keeping this list empty means there is no IP address whitelist.
# IP addresses, subnets, and links to plain text files are supported.
proxy-protocol-whitelisted-ips:
- 127.0.0.1
- 172.18.0.0/13
# The internet supports a maximum MTU of 1492 but could cause issues with packet fragmentation.
# 1400 is the default.
mtu: 1399
# This option disables the auth step Geyser performs for connecting Bedrock players.
# It can be used to allow connections from ProxyPass and WaterdogPE. In these cases, make sure that users
# cannot directly connect to this Geyser instance. See https://www.spigotmc.org/wiki/firewall-guide/ for
# assistance - and use UDP instead of TCP.
# Disabling Bedrock authentication for other use-cases is NOT SUPPORTED, as it allows anyone to spoof usernames, and is therefore a security risk.
# All Floodgate functionality (including skin uploading and account linking) will also not work when this option is disabled.
validate-bedrock-login: true
# bStats is a stat tracker that is entirely anonymous and tracks only basic information
# about Geyser, such as how many people are online, how many servers are using Geyser,
# what OS is being used, etc. You can learn more about bStats here: https://bstats.org/.
# https://bstats.org/plugin/server-implementation/GeyserMC
enable-metrics: false
# The bstats metrics uuid. Do not touch!
metrics-uuid: 00000000-0000-0000-0000-000000000000
# If debug messages should be sent through console
debug-mode: true
# Do not change!
config-version: 5

View File

@@ -0,0 +1,219 @@
# --------------------------------
# Geyser Configuration File
#
# A bridge between Minecraft: Bedrock Edition and Minecraft: Java Edition.
#
# GitHub: https://github.com/GeyserMC/Geyser
# Discord: https://discord.gg/geysermc
# Wiki: https://wiki.geysermc.org/
#
# NOTICE: See https://wiki.geysermc.org/geyser/setup/ for the setup guide. Many video tutorials are outdated.
# In most cases, especially with server hosting providers, further hosting-specific configuration is required.
# --------------------------------
bedrock:
# The IP address that will listen for connections.
# Generally, you should only uncomment and change this if you want to limit what IPs can connect to your server.
#address: 0.0.0.0
# The port that will listen for connections
port: 19132
# Some hosting services change your Java port everytime you start the server and require the same port to be used for Bedrock.
# This option makes the Bedrock port the same as the Java port every time you start the server.
# This option is for the plugin version only.
clone-remote-port: false
# The MOTD that will be broadcasted to Minecraft: Bedrock Edition clients. This is irrelevant if "passthrough-motd" is set to true
# If either of these are empty, the respective string will default to "Geyser"
motd1: "Geyser"
motd2: "Another Geyser server."
# The Server Name that will be sent to Minecraft: Bedrock Edition clients. This is visible in both the pause menu and the settings menu.
server-name: "Geyser"
# How much to compress network traffic to the Bedrock client. The higher the number, the more CPU usage used, but
# the smaller the bandwidth used. Does not have any effect below -1 or above 9. Set to -1 to disable.
compression-level: 6
# The port to broadcast to Bedrock clients with the MOTD that they should use to connect to the server.
# DO NOT uncomment and change this unless Geyser runs on a different internal port than the one that is used to connect.
# broadcast-port: 19132
# Whether to enable PROXY protocol or not for clients. You DO NOT WANT this feature unless you run UDP reverse proxy
# in front of your Geyser instance.
enable-proxy-protocol: false
# A list of allowed PROXY protocol speaking proxy IP addresses/subnets. Only effective when "enable-proxy-protocol" is enabled, and
# should really only be used when you are not able to use a proper firewall (usually true with shared hosting providers etc.).
# Keeping this list empty means there is no IP address whitelist.
# IP addresses, subnets, and links to plain text files are supported.
#proxy-protocol-whitelisted-ips: [ "127.0.0.1", "172.18.0.0/16", "https://example.com/whitelist.txt" ]
remote:
# The IP address of the remote (Java Edition) server
# If it is "auto", for standalone version the remote address will be set to 127.0.0.1,
# for plugin versions, it is recommended to keep this as "auto" so Geyser will automatically configure address, port, and auth-type.
# Leave as "auto" if floodgate is installed.
address: auto
# The port of the remote (Java Edition) server
# For plugin versions, if address has been set to "auto", the port will also follow the server's listening port.
port: 25565
# Authentication type. Can be offline, online, or floodgate (see https://github.com/GeyserMC/Geyser/wiki/Floodgate).
# For plugin versions, it's recommended to keep the `address` field to "auto" so Floodgate support is automatically configured.
# If Floodgate is installed and `address:` is set to "auto", then "auth-type: floodgate" will automatically be used.
auth-type: online
# Whether to enable PROXY protocol or not while connecting to the server.
# This is useful only when:
# 1) Your server supports PROXY protocol (it probably doesn't)
# 2) You run Velocity or BungeeCord with the option enabled in the proxy's main config.
# IF YOU DON'T KNOW WHAT THIS IS, DON'T TOUCH IT!
use-proxy-protocol: false
# Forward the hostname that the Bedrock client used to connect over to the Java server
# This is designed to be used for forced hosts on proxies
forward-hostname: false
# Floodgate uses encryption to ensure use from authorised sources.
# This should point to the public key generated by Floodgate (BungeeCord, Spigot or Velocity)
# You can ignore this when not using Floodgate.
# If you're using a plugin version of Floodgate on the same server, the key will automatically be picked up from Floodgate.
floodgate-key-file: key.pem
# For online mode authentication type only.
# Stores a list of Bedrock players that should have their Java Edition account saved after login.
# This saves a token that can be reused to authenticate the player later. This does not save emails or passwords,
# but you should still be cautious when adding to this list and giving others access to this Geyser instance's files.
# Removing a name from this list will delete its cached login information on the next Geyser startup.
# The file that tokens will be saved in is in the same folder as this config, named "saved-refresh-tokens.json".
saved-user-logins:
- ThisExampleUsernameShouldBeLongEnoughToNeverBeAnXboxUsername
- ThisOtherExampleUsernameShouldAlsoBeLongEnough
# Specify how many seconds to wait while user authorizes Geyser to access their Microsoft account.
# User is allowed to disconnect from the server during this period.
pending-authentication-timeout: 120
# Bedrock clients can freeze when opening up the command prompt for the first time if given a lot of commands.
# Disabling this will prevent command suggestions from being sent and solve freezing for Bedrock clients.
command-suggestions: true
# The following three options enable "ping passthrough" - the MOTD, player count and/or protocol name gets retrieved from the Java server.
# Relay the MOTD from the remote server to Bedrock players.
passthrough-motd: true
# Relay the player count and max players from the remote server to Bedrock players.
passthrough-player-counts: true
# Enable LEGACY ping passthrough. There is no need to enable this unless your MOTD or player count does not appear properly.
# This option does nothing on standalone.
legacy-ping-passthrough: false
# How often to ping the remote server, in seconds. Only relevant for standalone or legacy ping passthrough.
# Increase if you are getting BrokenPipe errors.
ping-passthrough-interval: 3
# Whether to forward player ping to the server. While enabling this will allow Bedrock players to have more accurate
# ping, it may also cause players to time out more easily.
forward-player-ping: false
# Maximum amount of players that can connect. This is only visual at this time and does not actually limit player count.
max-players: 100
# If debug messages should be sent through console
debug-mode: false
# Allow a fake cooldown indicator to be sent. Bedrock players otherwise do not see a cooldown as they still use 1.8 combat.
# Please note: if the cooldown is enabled, some users may see a black box during the cooldown sequence, like below:
# https://cdn.discordapp.com/attachments/613170125696270357/957075682230419466/Screenshot_from_2022-03-25_20-35-08.png
# This can be disabled by going into Bedrock settings under the accessibility tab and setting "Text Background Opacity" to 0
# This setting can be set to "title", "actionbar" or "false"
show-cooldown: title
# Controls if coordinates are shown to players.
show-coordinates: true
# Whether Bedrock players are blocked from performing their scaffolding-style bridging.
disable-bedrock-scaffolding: false
# If set, when a Bedrock player performs any emote, it will swap the offhand and mainhand items, just like the Java Edition keybind
# There are three options this can be set to:
# disabled - the default/fallback, which doesn't apply this workaround
# no-emotes - emotes will NOT be sent to other Bedrock clients and offhand will be swapped. This effectively disables all emotes from being seen.
# emotes-and-offhand - emotes will be sent to Bedrock clients and offhand will be swapped
emote-offhand-workaround: "disabled"
# The default locale if we dont have the one the client requested. Uncomment to not use the default system language.
# default-locale: en_us
# Specify how many days images will be cached to disk to save downloading them from the internet.
# A value of 0 is disabled. (Default: 0)
cache-images: 0
# Allows custom skulls to be displayed. Keeping them enabled may cause a performance decrease on older/weaker devices.
allow-custom-skulls: true
# The maximum number of custom skulls to be displayed per player. Increasing this may decrease performance on weaker devices.
# Setting this to -1 will cause all custom skulls to be displayed regardless of distance or number.
max-visible-custom-skulls: 128
# The radius in blocks around the player in which custom skulls are displayed.
custom-skull-render-distance: 32
# Whether to add any items and blocks which normally does not exist in Bedrock Edition.
# This should only need to be disabled if using a proxy that does not use the "transfer packet" style of server switching.
# If this is disabled, furnace minecart items will be mapped to hopper minecart items.
# Geyser's block, item, and skull mappings systems will also be disabled.
# This option requires a restart of Geyser in order to change its setting.
add-non-bedrock-items: true
# Bedrock prevents building and displaying blocks above Y127 in the Nether.
# This config option works around that by changing the Nether dimension ID to the End ID.
# The main downside to this is that the entire Nether will have the same red fog rather than having different fog for each biome.
above-bedrock-nether-building: false
# Force clients to load all resource packs if there are any.
# If set to false, it allows the user to connect to the server even if they don't
# want to download the resource packs.
force-resource-packs: true
# Allows Xbox achievements to be unlocked.
xbox-achievements-enabled: false
# Whether player IP addresses will be logged by the server.
log-player-ip-addresses: true
# Whether to alert the console and operators that a new Geyser version is available that supports a Bedrock version
# that this Geyser version does not support. It's recommended to keep this option enabled, as many Bedrock platforms
# auto-update.
notify-on-new-bedrock-update: true
# Which item to use to mark unavailable slots in a Bedrock player inventory. Examples of this are the 2x2 crafting grid while in creative,
# or custom inventory menus with sizes different from the usual 3x9. A barrier block is the default item.
unusable-space-block: minecraft:barrier
# bStats is a stat tracker that is entirely anonymous and tracks only basic information
# about Geyser, such as how many people are online, how many servers are using Geyser,
# what OS is being used, etc. You can learn more about bStats here: https://bstats.org/.
# https://bstats.org/plugin/server-implementation/GeyserMC
metrics:
# If metrics should be enabled
enabled: true
# UUID of server, don't change!
uuid: 00000000-0000-0000-0000-000000000000
# ADVANCED OPTIONS - DO NOT TOUCH UNLESS YOU KNOW WHAT YOU ARE DOING!
# Geyser updates the Scoreboard after every Scoreboard packet, but when Geyser tries to handle
# a lot of scoreboard packets per second can cause serious lag.
# This option allows you to specify after how many Scoreboard packets per seconds
# the Scoreboard updates will be limited to four updates per second.
scoreboard-packet-threshold: 20
# Allow connections from ProxyPass and Waterdog.
# See https://www.spigotmc.org/wiki/firewall-guide/ for assistance - use UDP instead of TCP.
enable-proxy-connections: false
# The internet supports a maximum MTU of 1492 but could cause issues with packet fragmentation.
# 1400 is the default.
mtu: 1400
# Whether to connect directly into the Java server without creating a TCP connection.
# This should only be disabled if a plugin that interfaces with packets or the network does not work correctly with Geyser.
# If enabled on plugin versions, the remote address and port sections are ignored
# If disabled on plugin versions, expect performance decrease and latency increase
use-direct-connection: true
# Whether Geyser should attempt to disable compression for Bedrock players. This should be a benefit as there is no need to compress data
# when Java packets aren't being handled over the network.
# This requires use-direct-connection to be true.
disable-compression: true
config-version: 4

View File

@@ -0,0 +1,232 @@
# --------------------------------
# Geyser Configuration File
#
# A bridge between Minecraft: Bedrock Edition and Minecraft: Java Edition.
#
# GitHub: https://github.com/GeyserMC/Geyser
# Discord: https://discord.gg/geysermc
# Wiki: https://geysermc.org/wiki
#
# NOTICE: See https://geysermc.org/wiki/geyser/setup/ for the setup guide. Many video tutorials are outdated.
# In most cases, especially with server hosting providers, further hosting-specific configuration is required.
# --------------------------------
# Network settings for the Bedrock listener
bedrock:
# The IP address that Geyser will bind on to listen for incoming Bedrock connections.
# Generally, you should only change this if you want to limit what IPs can connect to your server.
address: 0.0.0.0
# The port that will Geyser will listen on for incoming Bedrock connections.
# Since Minecraft: Bedrock Edition uses UDP, this port must allow UDP traffic.
port: 19132
# Some hosting services change your Java port everytime you start the server and require the same port to be used for Bedrock.
# This option makes the Bedrock port the same as the Java port every time you start the server.
clone-remote-port: false
# Network settings for the Java server connection
java:
# 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".
auth-type: online
# MOTD settings
motd:
# The MOTD that will be broadcasted to Minecraft: Bedrock Edition clients. This is irrelevant if "passthrough-motd" is set to true.
# If either of these are empty, the respective string will default to "Geyser"
primary-motd: Geyser
secondary-motd: Another Geyser server.
# Whether Geyser should relay the MOTD from the Java server to Bedrock players.
passthrough-motd: true
# Maximum amount of players that can connect.
# This is only visual, and is only applied if passthrough-motd is disabled.
max-players: 100
# Whether to relay the player count and max players from the Java server to Bedrock players.
passthrough-player-counts: true
# Whether to use server API methods to determine the Java server's MOTD and ping passthrough.
# There is no need to disable this unless your MOTD or player count does not appear properly.
integrated-ping-passthrough: true
# How often to ping the Java server to refresh MOTD and player count, in seconds.
# Only relevant if integrated-ping-passthrough is disabled.
ping-passthrough-interval: 3
# Gameplay options that affect Bedrock players
gameplay:
# The server name that will be sent to Minecraft: Bedrock Edition clients. This is visible in both the pause menu and the settings menu.
server-name: Geyser
# Whether to automatically serve the GeyserOptionalPack to all connecting players.
# This adds some quality-of-life visual fixes for Bedrock players.
# See https://geysermc.org/wiki/other/geyseroptionalpack for all current features.
# If enabled, force-resource-packs will be enabled.
enable-optional-pack: true
# Allow a fake cooldown indicator to be sent. Bedrock players otherwise do not see a cooldown as they still use 1.8 combat.
# Please note: if the cooldown is enabled, some users may see a black box during the cooldown sequence, like below:
# https://geysermc.org/img/external/cooldown_indicator.png
# This can be disabled by going into Bedrock settings under the accessibility tab and setting "Text Background Opacity" to 0
# This setting can be set to "title", "actionbar" or "false"
show-cooldown: title
# Bedrock clients can freeze when opening up the command prompt for the first time if given a lot of commands.
# Disabling this will prevent command suggestions from being sent and solve freezing for Bedrock clients.
command-suggestions: true
# Controls if coordinates are shown to players.
show-coordinates: true
# Whether Bedrock players are blocked from performing their scaffolding-style bridging.
disable-bedrock-scaffolding: false
# Bedrock prevents building and displaying blocks above Y127 in the Nether.
# This config option works around that by changing the Nether dimension ID to the End ID.
# The main downside to this is that the entire Nether will have the same red fog rather than having different fog for each biome.
nether-roof-workaround: false
# Which item to use to mark unavailable slots in a Bedrock player inventory. Examples of this are the 2x2 crafting grid while in creative,
# or custom inventory menus with sizes different from the usual 3x9. A barrier block is the default item.
# This config option can be set to any Bedrock item identifier. If you want to set this to a custom item, make sure that you specify the item in the following format: "geyser_custom:<mapping-name>"
unusable-space-block: minecraft:barrier
# Whether to add any items and blocks which normally does not exist in Bedrock Edition.
# This should only need to be disabled if using a proxy that does not use the "transfer packet" style of server switching.
# If this is disabled, furnace minecart items will be mapped to hopper minecart items.
# Geyser's block, item, and skull mappings systems will also be disabled.
# This option requires a restart of Geyser in order to change its setting.
enable-custom-content: true
# Force clients to load all resource packs if there are any.
# If set to false, it allows the user to connect to the server even if they don't
# want to download the resource packs.
force-resource-packs: true
# Whether to forward player ping to the server. While enabling this will allow Bedrock players to have more accurate
# ping, it may also cause players to time out more easily.
forward-player-ping: false
# Allows Xbox achievements to be unlocked.
# If a player types in an unknown command, they will receive a message that states cheats are disabled.
# Otherwise, commands work as expected.
xbox-achievements-enabled: false
# The maximum number of custom skulls to be displayed per player. Increasing this may decrease performance on weaker devices.
# A value of 0 will disable all custom skulls.
# Setting this to -1 will cause all custom skulls to be displayed regardless of distance or number.
max-visible-custom-skulls: 128
# The radius in blocks around the player in which custom skulls are displayed.
custom-skull-render-distance: 32
# The default locale if we don't have the one the client requested. If set to "system", the system's language will be used.
default-locale: system
# Whether player IP addresses will be logged by the server.
log-player-ip-addresses: true
# For online mode authentication type only.
# Stores a list of Bedrock player usernames that should have their Java Edition account saved after login.
# This saves a token that can be reused to authenticate the player later. This does not save emails or passwords,
# but you should still be cautious when adding to this list and giving others access to this Geyser instance's files.
# Removing a name from this list will delete its cached login information on the next Geyser startup.
# The file that tokens will be saved in is in the same folder as this config, named "saved-refresh-tokens.json".
saved-user-logins:
- ThisExampleUsernameShouldBeLongEnoughToNeverBeAnXboxUsername
- ThisOtherExampleUsernameShouldAlsoBeLongEnough
# For online mode authentication type only.
# Specify how many seconds to wait while user authorizes Geyser to access their Microsoft account.
# User is allowed to disconnect from the server during this period.
pending-authentication-timeout: 120
# Whether to alert the console and operators that a new Geyser version is available that supports a Bedrock version
# that this Geyser version does not support. It's recommended to keep this option enabled, as many Bedrock platforms
# auto-update.
notify-on-new-bedrock-update: true
# Advanced configuration options. These usually do not need modifications.
advanced:
# Specify how many days player skin images will be cached to disk to save downloading them from the internet.
# A value of 0 is disabled. (Default: 0)
cache-images: 0
# Geyser updates the Scoreboard after every Scoreboard packet, but when Geyser tries to handle
# a lot of scoreboard packets per second, this can cause serious lag.
# This option allows you to specify after how many Scoreboard packets per seconds
# the Scoreboard updates will be limited to four updates per second.
scoreboard-packet-threshold: 20
# Whether Geyser should send team names in command suggestions.
# Disable this if you have a lot of teams used that you don't need as suggestions.
add-team-suggestions: true
# Floodgate uses encryption to ensure use from authorized sources.
# This should point to the public key generated by Floodgate (BungeeCord, Spigot or Velocity)
# You can ignore this when not using Floodgate.
# If you're using a plugin version of Floodgate on the same server, the key will automatically be picked up from Floodgate.
floodgate-key-file: key.pem
# Advanced networking options for the Geyser to Java server connection
java:
# Whether to enable HAPROXY protocol when connecting to the Java server.
# This is useful only when:
# 1) Your Java server supports HAPROXY protocol (it probably doesn't)
# 2) You run Velocity or BungeeCord with the option enabled in the proxy's main config.
# IF YOU DON'T KNOW WHAT THIS IS, DON'T TOUCH IT!
use-haproxy-protocol: false
# Whether to connect directly into the Java server without creating a TCP connection.
# This should only be disabled if a plugin that interfaces with packets or the network does not work correctly with Geyser.
# If enabled, the remote address and port sections are ignored.
# If disabled, expect performance decrease and latency increase.
use-direct-connection: true
# Whether Geyser should attempt to disable packet compression (from the Java Server to Geyser) for Bedrock players.
# This should be a benefit as there is no need to compress data when Java packets aren't being handled over the network.
# This requires use-direct-connection to be true.
disable-compression: true
# Advanced networking options for Geyser's Bedrock listener
bedrock:
# The port to broadcast to Bedrock clients with the MOTD that they should use to connect to the server.
# A value of 0 will broadcast the port specified above.
# DO NOT change this unless Geyser runs on a different port than the one that is used to connect.
broadcast-port: 0
# How much to compress network traffic to the Bedrock client. The higher the number, the more CPU usage used, but
# the smaller the bandwidth used. Does not have any effect below -1 or above 9. Set to -1 to disable.
compression-level: 6
# Whether to expect HAPROXY protocol for connecting Bedrock clients.
# This is useful only when you are running a UDP reverse proxy in front of your Geyser instance.
# IF YOU DON'T KNOW WHAT THIS IS, DON'T TOUCH IT!
use-haproxy-protocol: false
# A list of allowed HAPROXY protocol speaking proxy IP addresses/subnets. Only effective when "use-proxy-protocol" is enabled, and
# should really only be used when you are not able to use a proper firewall (usually true with shared hosting providers etc.).
# Keeping this list empty means there is no IP address whitelist.
# IP addresses, subnets, and links to plain text files are supported.
proxy-protocol-whitelisted-ips: []
# The internet supports a maximum MTU of 1492 but could cause issues with packet fragmentation.
# 1400 is the default.
mtu: 1400
# This option disables the auth step Geyser performs for connecting Bedrock players.
# It can be used to allow connections from ProxyPass and WaterdogPE. In these cases, make sure that users
# cannot directly connect to this Geyser instance. See https://www.spigotmc.org/wiki/firewall-guide/ for
# assistance - and use UDP instead of TCP.
# Disabling Bedrock authentication for other use-cases is NOT SUPPORTED, as it allows anyone to spoof usernames, and is therefore a security risk.
# All Floodgate functionality (including skin uploading and account linking) will also not work when this option is disabled.
validate-bedrock-login: true
# If debug messages should be sent through console
debug-mode: false
# Do not change!
config-version: 5

View File

@@ -0,0 +1,231 @@
# --------------------------------
# Geyser Configuration File
#
# A bridge between Minecraft: Bedrock Edition and Minecraft: Java Edition.
#
# GitHub: https://github.com/GeyserMC/Geyser
# Discord: https://discord.gg/geysermc
# Wiki: https://geysermc.org/wiki
#
# NOTICE: See https://geysermc.org/wiki/geyser/setup/ for the setup guide. Many video tutorials are outdated.
# In most cases, especially with server hosting providers, further hosting-specific configuration is required.
# --------------------------------
# Network settings for the Bedrock listener
bedrock:
# The IP address that Geyser will bind on to listen for incoming Bedrock connections.
# Generally, you should only change this if you want to limit what IPs can connect to your server.
address: 0.0.0.0
# The port that will Geyser will listen on for incoming Bedrock connections.
# Since Minecraft: Bedrock Edition uses UDP, this port must allow UDP traffic.
port: 19132
# Network settings for the Java server connection
java:
# The IP address of the Java Edition server.
address: 127.0.0.1
# The port of the Java Edition server.
port: 25565
# 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".
auth-type: online
# Whether to forward the hostname that the Bedrock client used to connect over to the Java server.
# This is designed to be used for forced hosts on proxies.
forward-hostname: false
# MOTD settings
motd:
# The MOTD that will be broadcasted to Minecraft: Bedrock Edition clients. This is irrelevant if "passthrough-motd" is set to true.
# If either of these are empty, the respective string will default to "Geyser"
primary-motd: Geyser
secondary-motd: Another Geyser server.
# Whether Geyser should relay the MOTD from the Java server to Bedrock players.
passthrough-motd: true
# Maximum amount of players that can connect.
# This is only visual, and is only applied if passthrough-motd is disabled.
max-players: 100
# Whether to relay the player count and max players from the Java server to Bedrock players.
passthrough-player-counts: true
# How often to ping the Java server to refresh MOTD and player count, in seconds.
ping-passthrough-interval: 3
# Gameplay options that affect Bedrock players
gameplay:
# The server name that will be sent to Minecraft: Bedrock Edition clients. This is visible in both the pause menu and the settings menu.
server-name: Geyser
# Whether to automatically serve the GeyserOptionalPack to all connecting players.
# This adds some quality-of-life visual fixes for Bedrock players.
# See https://geysermc.org/wiki/other/geyseroptionalpack for all current features.
# If enabled, force-resource-packs will be enabled.
enable-optional-pack: true
# Allow a fake cooldown indicator to be sent. Bedrock players otherwise do not see a cooldown as they still use 1.8 combat.
# Please note: if the cooldown is enabled, some users may see a black box during the cooldown sequence, like below:
# https://geysermc.org/img/external/cooldown_indicator.png
# This can be disabled by going into Bedrock settings under the accessibility tab and setting "Text Background Opacity" to 0
# This setting can be set to "title", "actionbar" or "false"
show-cooldown: title
# Bedrock clients can freeze when opening up the command prompt for the first time if given a lot of commands.
# Disabling this will prevent command suggestions from being sent and solve freezing for Bedrock clients.
command-suggestions: true
# Controls if coordinates are shown to players.
show-coordinates: true
# Whether Bedrock players are blocked from performing their scaffolding-style bridging.
disable-bedrock-scaffolding: false
# Bedrock prevents building and displaying blocks above Y127 in the Nether.
# This config option works around that by changing the Nether dimension ID to the End ID.
# The main downside to this is that the entire Nether will have the same red fog rather than having different fog for each biome.
nether-roof-workaround: false
# Which item to use to mark unavailable slots in a Bedrock player inventory. Examples of this are the 2x2 crafting grid while in creative,
# or custom inventory menus with sizes different from the usual 3x9. A barrier block is the default item.
# This config option can be set to any Bedrock item identifier. If you want to set this to a custom item, make sure that you specify the item in the following format: "geyser_custom:<mapping-name>"
unusable-space-block: minecraft:barrier
# Whether to add any items and blocks which normally does not exist in Bedrock Edition.
# This should only need to be disabled if using a proxy that does not use the "transfer packet" style of server switching.
# If this is disabled, furnace minecart items will be mapped to hopper minecart items.
# Geyser's block, item, and skull mappings systems will also be disabled.
# This option requires a restart of Geyser in order to change its setting.
enable-custom-content: true
# Force clients to load all resource packs if there are any.
# If set to false, it allows the user to connect to the server even if they don't
# want to download the resource packs.
force-resource-packs: true
# Whether to forward player ping to the server. While enabling this will allow Bedrock players to have more accurate
# ping, it may also cause players to time out more easily.
forward-player-ping: false
# Allows Xbox achievements to be unlocked.
# If a player types in an unknown command, they will receive a message that states cheats are disabled.
# Otherwise, commands work as expected.
xbox-achievements-enabled: false
# The maximum number of custom skulls to be displayed per player. Increasing this may decrease performance on weaker devices.
# A value of 0 will disable all custom skulls.
# Setting this to -1 will cause all custom skulls to be displayed regardless of distance or number.
max-visible-custom-skulls: 128
# The radius in blocks around the player in which custom skulls are displayed.
custom-skull-render-distance: 32
# The default locale if we don't have the one the client requested. If set to "system", the system's language will be used.
default-locale: system
# Whether player IP addresses will be logged by the server.
log-player-ip-addresses: true
# For online mode authentication type only.
# Stores a list of Bedrock player usernames that should have their Java Edition account saved after login.
# This saves a token that can be reused to authenticate the player later. This does not save emails or passwords,
# but you should still be cautious when adding to this list and giving others access to this Geyser instance's files.
# Removing a name from this list will delete its cached login information on the next Geyser startup.
# The file that tokens will be saved in is in the same folder as this config, named "saved-refresh-tokens.json".
saved-user-logins:
- ThisExampleUsernameShouldBeLongEnoughToNeverBeAnXboxUsername
- ThisOtherExampleUsernameShouldAlsoBeLongEnough
# For online mode authentication type only.
# Specify how many seconds to wait while user authorizes Geyser to access their Microsoft account.
# User is allowed to disconnect from the server during this period.
pending-authentication-timeout: 120
# Whether to alert the console and operators that a new Geyser version is available that supports a Bedrock version
# that this Geyser version does not support. It's recommended to keep this option enabled, as many Bedrock platforms
# auto-update.
notify-on-new-bedrock-update: true
# Advanced configuration options. These usually do not need modifications.
advanced:
# Specify how many days player skin images will be cached to disk to save downloading them from the internet.
# A value of 0 is disabled. (Default: 0)
cache-images: 0
# Geyser updates the Scoreboard after every Scoreboard packet, but when Geyser tries to handle
# a lot of scoreboard packets per second, this can cause serious lag.
# This option allows you to specify after how many Scoreboard packets per seconds
# the Scoreboard updates will be limited to four updates per second.
scoreboard-packet-threshold: 20
# Whether Geyser should send team names in command suggestions.
# Disable this if you have a lot of teams used that you don't need as suggestions.
add-team-suggestions: true
# Floodgate uses encryption to ensure use from authorized sources.
# This should point to the public key generated by Floodgate (BungeeCord, Spigot or Velocity)
# You can ignore this when not using Floodgate.
# If you're using a plugin version of Floodgate on the same server, the key will automatically be picked up from Floodgate.
floodgate-key-file: key.pem
# Advanced networking options for the Geyser to Java server connection
java:
# Whether to enable HAPROXY protocol when connecting to the Java server.
# This is useful only when:
# 1) Your Java server supports HAPROXY protocol (it probably doesn't)
# 2) You run Velocity or BungeeCord with the option enabled in the proxy's main config.
# IF YOU DON'T KNOW WHAT THIS IS, DON'T TOUCH IT!
use-haproxy-protocol: false
# Advanced networking options for Geyser's Bedrock listener
bedrock:
# The port to broadcast to Bedrock clients with the MOTD that they should use to connect to the server.
# A value of 0 will broadcast the port specified above.
# DO NOT change this unless Geyser runs on a different port than the one that is used to connect.
broadcast-port: 0
# How much to compress network traffic to the Bedrock client. The higher the number, the more CPU usage used, but
# the smaller the bandwidth used. Does not have any effect below -1 or above 9. Set to -1 to disable.
compression-level: 6
# Whether to expect HAPROXY protocol for connecting Bedrock clients.
# This is useful only when you are running a UDP reverse proxy in front of your Geyser instance.
# IF YOU DON'T KNOW WHAT THIS IS, DON'T TOUCH IT!
use-haproxy-protocol: false
# A list of allowed HAPROXY protocol speaking proxy IP addresses/subnets. Only effective when "use-proxy-protocol" is enabled, and
# should really only be used when you are not able to use a proper firewall (usually true with shared hosting providers etc.).
# Keeping this list empty means there is no IP address whitelist.
# IP addresses, subnets, and links to plain text files are supported.
proxy-protocol-whitelisted-ips: []
# The internet supports a maximum MTU of 1492 but could cause issues with packet fragmentation.
# 1400 is the default.
mtu: 1400
# This option disables the auth step Geyser performs for connecting Bedrock players.
# It can be used to allow connections from ProxyPass and WaterdogPE. In these cases, make sure that users
# cannot directly connect to this Geyser instance. See https://www.spigotmc.org/wiki/firewall-guide/ for
# assistance - and use UDP instead of TCP.
# Disabling Bedrock authentication for other use-cases is NOT SUPPORTED, as it allows anyone to spoof usernames, and is therefore a security risk.
# All Floodgate functionality (including skin uploading and account linking) will also not work when this option is disabled.
validate-bedrock-login: true
# bStats is a stat tracker that is entirely anonymous and tracks only basic information
# about Geyser, such as how many people are online, how many servers are using Geyser,
# what OS is being used, etc. You can learn more about bStats here: https://bstats.org/.
# https://bstats.org/plugin/server-implementation/GeyserMC
enable-metrics: true
# The bstats metrics uuid. Do not touch!
metrics-uuid: 00000000-0000-0000-0000-000000000000
# If debug messages should be sent through console
debug-mode: false
# Do not change!
config-version: 5

View File

@@ -0,0 +1,219 @@
# --------------------------------
# Geyser Configuration File
#
# A bridge between Minecraft: Bedrock Edition and Minecraft: Java Edition.
#
# GitHub: https://github.com/GeyserMC/Geyser
# Discord: https://discord.gg/geysermc
# Wiki: https://wiki.geysermc.org/
#
# NOTICE: See https://wiki.geysermc.org/geyser/setup/ for the setup guide. Many video tutorials are outdated.
# In most cases, especially with server hosting providers, further hosting-specific configuration is required.
# --------------------------------
bedrock:
# The IP address that will listen for connections.
# Generally, you should only uncomment and change this if you want to limit what IPs can connect to your server.
#address: 0.0.0.0
# The port that will listen for connections
port: 99999
# Some hosting services change your Java port everytime you start the server and require the same port to be used for Bedrock.
# This option makes the Bedrock port the same as the Java port every time you start the server.
# This option is for the plugin version only.
clone-remote-port: false
# The MOTD that will be broadcasted to Minecraft: Bedrock Edition clients. This is irrelevant if "passthrough-motd" is set to true
# If either of these are empty, the respective string will default to "Geyser"
motd1: "Geyser"
motd2: "Another Geyser server."
# The Server Name that will be sent to Minecraft: Bedrock Edition clients. This is visible in both the pause menu and the settings menu.
server-name: "Geyser"
# How much to compress network traffic to the Bedrock client. The higher the number, the more CPU usage used, but
# the smaller the bandwidth used. Does not have any effect below -1 or above 9. Set to -1 to disable.
compression-level: 6
# The port to broadcast to Bedrock clients with the MOTD that they should use to connect to the server.
# DO NOT uncomment and change this unless Geyser runs on a different internal port than the one that is used to connect.
# broadcast-port: 19132
# Whether to enable PROXY protocol or not for clients. You DO NOT WANT this feature unless you run UDP reverse proxy
# in front of your Geyser instance.
enable-proxy-protocol: false
# A list of allowed PROXY protocol speaking proxy IP addresses/subnets. Only effective when "enable-proxy-protocol" is enabled, and
# should really only be used when you are not able to use a proper firewall (usually true with shared hosting providers etc.).
# Keeping this list empty means there is no IP address whitelist.
# IP addresses, subnets, and links to plain text files are supported.
#proxy-protocol-whitelisted-ips: [ "127.0.0.1", "172.18.0.0/16", "https://example.com/whitelist.txt" ]
remote:auto
# The IP address of the remote (Java Edition) server
# If it is "auto", for standalone version the remote address will be set to 127.0.0.1,
# for plugin versions, it is recommended to keep this as "auto" so Geyser will automatically configure address, port, and auth-type.
# Leave as "auto" if floodgate is installed.
address: auto
# The port of the remote (Java Edition) server
# For plugin versions, if address has been set to "auto", the port will also follow the server's listening port.
port: 25565
# Authentication type. Can be offline, online, or floodgate (see https://github.com/GeyserMC/Geyser/wiki/Floodgate).
# For plugin versions, it's recommended to keep the `address` field to "auto" so Floodgate support is automatically configured.
# If Floodgate is installed and `address:` is set to "auto", then "auth-type: floodgate" will automatically be used.
auth-type: online
# Whether to enable PROXY protocol or not while connecting to the server.
# This is useful only when:
# 1) Your server supports PROXY protocol (it probably doesn't)
# 2) You run Velocity or BungeeCord with the option enabled in the proxy's main config.
# IF YOU DON'T KNOW WHAT THIS IS, DON'T TOUCH IT!
use-proxy-protocol: false
# Forward the hostname that the Bedrock client used to connect over to the Java server
# This is designed to be used for forced hosts on proxies
forward-hostname: false
# Floodgate uses encryption to ensure use from authorised sources.
# This should point to the public key generated by Floodgate (BungeeCord, Spigot or Velocity)
# You can ignore this when not using Floodgate.
# If you're using a plugin version of Floodgate on the same server, the key will automatically be picked up from Floodgate.
floodgate-key-file: key.pem
# For online mode authentication type only.
# Stores a list of Bedrock players that should have their Java Edition account saved after login.
# This saves a token that can be reused to authenticate the player later. This does not save emails or passwords,
# but you should still be cautious when adding to this list and giving others access to this Geyser instance's files.
# Removing a name from this list will delete its cached login information on the next Geyser startup.
# The file that tokens will be saved in is in the same folder as this config, named "saved-refresh-tokens.json".
saved-user-logins:
- ThisExampleUsernameShouldBeLongEnoughToNeverBeAnXboxUsername
- ThisOtherExampleUsernameShouldAlsoBeLongEnough
# Specify how many seconds to wait while user authorizes Geyser to access their Microsoft account.
# User is allowed to disconnect from the server during this period.
pending-authentication-timeout: 120
# Bedrock clients can freeze when opening up the command prompt for the first time if given a lot of commands.
# Disabling this will prevent command suggestions from being sent and solve freezing for Bedrock clients.
command-suggestions: true
# The following three options enable "ping passthrough" - the MOTD, player count and/or protocol name gets retrieved from the Java server.
# Relay the MOTD from the remote server to Bedrock players.
passthrough-motd: true
# Relay the player count and max players from the remote server to Bedrock players.
passthrough-player-counts: true
# Enable LEGACY ping passthrough. There is no need to enable this unless your MOTD or player count does not appear properly.
# This option does nothing on standalone.
legacy-ping-passthrough: false
# How often to ping the remote server, in seconds. Only relevant for standalone or legacy ping passthrough.
# Increase if you are getting BrokenPipe errors.
ping-passthrough-interval: 3
# Whether to forward player ping to the server. While enabling this will allow Bedrock players to have more accurate
# ping, it may also cause players to time out more easily.
forward-player-ping: false
# Maximum amount of players that can connect. This is only visual at this time and does not actually limit player count.
max-players: 100
# If debug messages should be sent through console
debug-mode: false
# Allow a fake cooldown indicator to be sent. Bedrock players otherwise do not see a cooldown as they still use 1.8 combat.
# Please note: if the cooldown is enabled, some users may see a black box during the cooldown sequence, like below:
# https://cdn.discordapp.com/attachments/613170125696270357/957075682230419466/Screenshot_from_2022-03-25_20-35-08.png
# This can be disabled by going into Bedrock settings under the accessibility tab and setting "Text Background Opacity" to 0
# This setting can be set to "title", "actionbar" or "false"
show-cooldown: title
# Controls if coordinates are shown to players.
show-coordinates: true
# Whether Bedrock players are blocked from performing their scaffolding-style bridging.
disable-bedrock-scaffolding: false
# If set, when a Bedrock player performs any emote, it will swap the offhand and mainhand items, just like the Java Edition keybind
# There are three options this can be set to:
# disabled - the default/fallback, which doesn't apply this workaround
# no-emotes - emotes will NOT be sent to other Bedrock clients and offhand will be swapped. This effectively disables all emotes from being seen.
# emotes-and-offhand - emotes will be sent to Bedrock clients and offhand will be swapped
emote-offhand-workaround: "disabled"
# The default locale if we dont have the one the client requested. Uncomment to not use the default system language.
# default-locale: en_us
# Specify how many days images will be cached to disk to save downloading them from the internet.
# A value of 0 is disabled. (Default: 0)
cache-images: 0
# Allows custom skulls to be displayed. Keeping them enabled may cause a performance decrease on older/weaker devices.
allow-custom-skulls: true
# The maximum number of custom skulls to be displayed per player. Increasing this may decrease performance on weaker devices.
# Setting this to -1 will cause all custom skulls to be displayed regardless of distance or number.
max-visible-custom-skulls: 128
# The radius in blocks around the player in which custom skulls are displayed.
custom-skull-render-distance: 32
# Whether to add any items and blocks which normally does not exist in Bedrock Edition.
# This should only need to be disabled if using a proxy that does not use the "transfer packet" style of server switching.
# If this is disabled, furnace minecart items will be mapped to hopper minecart items.
# Geyser's block, item, and skull mappings systems will also be disabled.
# This option requires a restart of Geyser in order to change its setting.
add-non-bedrock-items: true
# Bedrock prevents building and displaying blocks above Y127 in the Nether.
# This config option works around that by changing the Nether dimension ID to the End ID.
# The main downside to this is that the entire Nether will have the same red fog rather than having different fog for each biome.
above-bedrock-nether-building: false
# Force clients to load all resource packs if there are any.
# If set to false, it allows the user to connect to the server even if they don't
# want to download the resource packs.
force-resource-packs: true
# Allows Xbox achievements to be unlocked.
xbox-achievements-enabled: false
# Whether player IP addresses will be logged by the server.
log-player-ip-addresses: true
# Whether to alert the console and operators that a new Geyser version is available that supports a Bedrock version
# that this Geyser version does not support. It's recommended to keep this option enabled, as many Bedrock platforms
# auto-update.
notify-on-new-bedrock-update: true
# Which item to use to mark unavailable slots in a Bedrock player inventory. Examples of this are the 2x2 crafting grid while in creative,
# or custom inventory menus with sizes different from the usual 3x9. A barrier block is the default item.
unusable-space-block: minecraft:barrier
# bStats is a stat tracker that is entirely anonymous and tracks only basic information
# about Geyser, such as how many people are online, how many servers are using Geyser,
# what OS is being used, etc. You can learn more about bStats here: https://bstats.org/.
# https://bstats.org/plugin/server-implementation/GeyserMC
metrics:
# If metrics should be enabled
enabled: true
# UUID of server, don't change!
uuid: 00000000-0000-0000-0000-000000000000
# ADVANCED OPTIONS - DO NOT TOUCH UNLESS YOU KNOW WHAT YOU ARE DOING!
# Geyser updates the Scoreboard after every Scoreboard packet, but when Geyser tries to handle
# a lot of scoreboard packets per second can cause serious lag.
# This option allows you to specify after how many Scoreboard packets per seconds
# the Scoreboard updates will be limited to four updates per second.
scoreboard-packet-threshold: 20
# Allow connections from ProxyPass and Waterdog.
# See https://www.spigotmc.org/wiki/firewall-guide/ for assistance - use UDP instead of TCP.
enable-proxy-connections: false
# The internet supports a maximum MTU of 1492 but could cause issues with packet fragmentation.
# 1400 is the default.
mtu: 1400
# Whether to connect directly into the Java server without creating a TCP connection.
# This should only be disabled if a plugin that interfaces with packets or the network does not work correctly with Geyser.
# If enabled on plugin versions, the remote address and port sections are ignored
# If disabled on plugin versions, expect performance decrease and latency increase
use-direct-connection: true
# Whether Geyser should attempt to disable compression for Bedrock players. This should be a benefit as there is no need to compress data
# when Java packets aren't being handled over the network.
# This requires use-direct-connection to be true.
disable-compression: true
config-version: 4

View File

@@ -0,0 +1,219 @@
# --------------------------------
# Geyser Configuration File
#
# A bridge between Minecraft: Bedrock Edition and Minecraft: Java Edition.
#
# GitHub: https://github.com/GeyserMC/Geyser
# Discord: https://discord.gg/geysermc
# Wiki: https://wiki.geysermc.org/
#
# NOTICE: See https://wiki.geysermc.org/geyser/setup/ for the setup guide. Many video tutorials are outdated.
# In most cases, especially with server hosting providers, further hosting-specific configuration is required.
# --------------------------------
bedrock:
# The IP address that will listen for connections.
# Generally, you should only uncomment and change this if you want to limit what IPs can connect to your server.
#address: 0.0.0.0
# The port that will listen for connections
port: 19132
# Some hosting services change your Java port everytime you start the server and require the same port to be used for Bedrock.
# This option makes the Bedrock port the same as the Java port every time you start the server.
# This option is for the plugin version only.
clone-remote-port: false
# The MOTD that will be broadcasted to Minecraft: Bedrock Edition clients. This is irrelevant if "passthrough-motd" is set to true
# If either of these are empty, the respective string will default to "Geyser"
motd1: "Geyser"
motd2: "Another Geyser server."
# The Server Name that will be sent to Minecraft: Bedrock Edition clients. This is visible in both the pause menu and the settings menu.
server-name: "Geyser"
# How much to compress network traffic to the Bedrock client. The higher the number, the more CPU usage used, but
# the smaller the bandwidth used. Does not have any effect below -1 or above 9. Set to -1 to disable.
compression-level: 6
# The port to broadcast to Bedrock clients with the MOTD that they should use to connect to the server.
# DO NOT uncomment and change this unless Geyser runs on a different internal port than the one that is used to connect.
# broadcast-port: 19132
# Whether to enable PROXY protocol or not for clients. You DO NOT WANT this feature unless you run UDP reverse proxy
# in front of your Geyser instance.
enable-proxy-protocol: false
# A list of allowed PROXY protocol speaking proxy IP addresses/subnets. Only effective when "enable-proxy-protocol" is enabled, and
# should really only be used when you are not able to use a proper firewall (usually true with shared hosting providers etc.).
# Keeping this list empty means there is no IP address whitelist.
# IP addresses, subnets, and links to plain text files are supported.
#proxy-protocol-whitelisted-ips: [ "127.0.0.1", "172.18.0.0/16", "https://example.com/whitelist.txt" ]
remote:
# The IP address of the remote (Java Edition) server
# If it is "auto", for standalone version the remote address will be set to 127.0.0.1,
# for plugin versions, it is recommended to keep this as "auto" so Geyser will automatically configure address, port, and auth-type.
# Leave as "auto" if floodgate is installed.
address: auto
# The port of the remote (Java Edition) server
# For plugin versions, if address has been set to "auto", the port will also follow the server's listening port.
port: 25565
# Authentication type. Can be offline, online, or floodgate (see https://github.com/GeyserMC/Geyser/wiki/Floodgate).
# For plugin versions, it's recommended to keep the `address` field to "auto" so Floodgate support is automatically configured.
# If Floodgate is installed and `address:` is set to "auto", then "auth-type: floodgate" will automatically be used.
auth-type: online
# Whether to enable PROXY protocol or not while connecting to the server.
# This is useful only when:
# 1) Your server supports PROXY protocol (it probably doesn't)
# 2) You run Velocity or BungeeCord with the option enabled in the proxy's main config.
# IF YOU DON'T KNOW WHAT THIS IS, DON'T TOUCH IT!
use-proxy-protocol: false
# Forward the hostname that the Bedrock client used to connect over to the Java server
# This is designed to be used for forced hosts on proxies
forward-hostname: false
# Floodgate uses encryption to ensure use from authorised sources.
# This should point to the public key generated by Floodgate (BungeeCord, Spigot or Velocity)
# You can ignore this when not using Floodgate.
# If you're using a plugin version of Floodgate on the same server, the key will automatically be picked up from Floodgate.
floodgate-key-file: public-key.pem
# For online mode authentication type only.
# Stores a list of Bedrock players that should have their Java Edition account saved after login.
# This saves a token that can be reused to authenticate the player later. This does not save emails or passwords,
# but you should still be cautious when adding to this list and giving others access to this Geyser instance's files.
# Removing a name from this list will delete its cached login information on the next Geyser startup.
# The file that tokens will be saved in is in the same folder as this config, named "saved-refresh-tokens.json".
saved-user-logins:
- ThisExampleUsernameShouldBeLongEnoughToNeverBeAnXboxUsername
- ThisOtherExampleUsernameShouldAlsoBeLongEnough
# Specify how many seconds to wait while user authorizes Geyser to access their Microsoft account.
# User is allowed to disconnect from the server during this period.
pending-authentication-timeout: 120
# Bedrock clients can freeze when opening up the command prompt for the first time if given a lot of commands.
# Disabling this will prevent command suggestions from being sent and solve freezing for Bedrock clients.
command-suggestions: true
# The following three options enable "ping passthrough" - the MOTD, player count and/or protocol name gets retrieved from the Java server.
# Relay the MOTD from the remote server to Bedrock players.
passthrough-motd: true
# Relay the player count and max players from the remote server to Bedrock players.
passthrough-player-counts: true
# Enable LEGACY ping passthrough. There is no need to enable this unless your MOTD or player count does not appear properly.
# This option does nothing on standalone.
legacy-ping-passthrough: false
# How often to ping the remote server, in seconds. Only relevant for standalone or legacy ping passthrough.
# Increase if you are getting BrokenPipe errors.
ping-passthrough-interval: 3
# Whether to forward player ping to the server. While enabling this will allow Bedrock players to have more accurate
# ping, it may also cause players to time out more easily.
forward-player-ping: false
# Maximum amount of players that can connect. This is only visual at this time and does not actually limit player count.
max-players: 100
# If debug messages should be sent through console
debug-mode: false
# Allow a fake cooldown indicator to be sent. Bedrock players otherwise do not see a cooldown as they still use 1.8 combat.
# Please note: if the cooldown is enabled, some users may see a black box during the cooldown sequence, like below:
# https://cdn.discordapp.com/attachments/613170125696270357/957075682230419466/Screenshot_from_2022-03-25_20-35-08.png
# This can be disabled by going into Bedrock settings under the accessibility tab and setting "Text Background Opacity" to 0
# This setting can be set to "title", "actionbar" or "false"
show-cooldown: true
# Controls if coordinates are shown to players.
show-coordinates: true
# Whether Bedrock players are blocked from performing their scaffolding-style bridging.
disable-bedrock-scaffolding: false
# If set, when a Bedrock player performs any emote, it will swap the offhand and mainhand items, just like the Java Edition keybind
# There are three options this can be set to:
# disabled - the default/fallback, which doesn't apply this workaround
# no-emotes - emotes will NOT be sent to other Bedrock clients and offhand will be swapped. This effectively disables all emotes from being seen.
# emotes-and-offhand - emotes will be sent to Bedrock clients and offhand will be swapped
emote-offhand-workaround: "disabled"
# The default locale if we dont have the one the client requested. Uncomment to not use the default system language.
# default-locale: en_us
# Specify how many days images will be cached to disk to save downloading them from the internet.
# A value of 0 is disabled. (Default: 0)
cache-images: 0
# Allows custom skulls to be displayed. Keeping them enabled may cause a performance decrease on older/weaker devices.
allow-custom-skulls: true
# The maximum number of custom skulls to be displayed per player. Increasing this may decrease performance on weaker devices.
# Setting this to -1 will cause all custom skulls to be displayed regardless of distance or number.
max-visible-custom-skulls: 128
# The radius in blocks around the player in which custom skulls are displayed.
custom-skull-render-distance: 32
# Whether to add any items and blocks which normally does not exist in Bedrock Edition.
# This should only need to be disabled if using a proxy that does not use the "transfer packet" style of server switching.
# If this is disabled, furnace minecart items will be mapped to hopper minecart items.
# Geyser's block, item, and skull mappings systems will also be disabled.
# This option requires a restart of Geyser in order to change its setting.
add-non-bedrock-items: true
# Bedrock prevents building and displaying blocks above Y127 in the Nether.
# This config option works around that by changing the Nether dimension ID to the End ID.
# The main downside to this is that the entire Nether will have the same red fog rather than having different fog for each biome.
above-bedrock-nether-building: false
# Force clients to load all resource packs if there are any.
# If set to false, it allows the user to connect to the server even if they don't
# want to download the resource packs.
force-resource-packs: true
# Allows Xbox achievements to be unlocked.
xbox-achievements-enabled: false
# Whether player IP addresses will be logged by the server.
log-player-ip-addresses: true
# Whether to alert the console and operators that a new Geyser version is available that supports a Bedrock version
# that this Geyser version does not support. It's recommended to keep this option enabled, as many Bedrock platforms
# auto-update.
notify-on-new-bedrock-update: true
# Which item to use to mark unavailable slots in a Bedrock player inventory. Examples of this are the 2x2 crafting grid while in creative,
# or custom inventory menus with sizes different from the usual 3x9. A barrier block is the default item.
unusable-space-block: minecraft:barrier
# bStats is a stat tracker that is entirely anonymous and tracks only basic information
# about Geyser, such as how many people are online, how many servers are using Geyser,
# what OS is being used, etc. You can learn more about bStats here: https://bstats.org/.
# https://bstats.org/plugin/server-implementation/GeyserMC
metrics:
# If metrics should be enabled
enabled: true
# UUID of server, don't change!
uuid: 00000000-0000-0000-0000-000000000000
# ADVANCED OPTIONS - DO NOT TOUCH UNLESS YOU KNOW WHAT YOU ARE DOING!
# Geyser updates the Scoreboard after every Scoreboard packet, but when Geyser tries to handle
# a lot of scoreboard packets per second can cause serious lag.
# This option allows you to specify after how many Scoreboard packets per seconds
# the Scoreboard updates will be limited to four updates per second.
scoreboard-packet-threshold: 20
# Allow connections from ProxyPass and Waterdog.
# See https://www.spigotmc.org/wiki/firewall-guide/ for assistance - use UDP instead of TCP.
enable-proxy-connections: true
# The internet supports a maximum MTU of 1492 but could cause issues with packet fragmentation.
# 1400 is the default.
mtu: 1400
# Whether to connect directly into the Java server without creating a TCP connection.
# This should only be disabled if a plugin that interfaces with packets or the network does not work correctly with Geyser.
# If enabled on plugin versions, the remote address and port sections are ignored
# If disabled on plugin versions, expect performance decrease and latency increase
use-direct-connection: true
# Whether Geyser should attempt to disable compression for Bedrock players. This should be a benefit as there is no need to compress data
# when Java packets aren't being handled over the network.
# This requires use-direct-connection to be true.
disable-compression: true
config-version: 4

View File

@@ -0,0 +1,232 @@
# --------------------------------
# Geyser Configuration File
#
# A bridge between Minecraft: Bedrock Edition and Minecraft: Java Edition.
#
# GitHub: https://github.com/GeyserMC/Geyser
# Discord: https://discord.gg/geysermc
# Wiki: https://geysermc.org/wiki
#
# NOTICE: See https://geysermc.org/wiki/geyser/setup/ for the setup guide. Many video tutorials are outdated.
# In most cases, especially with server hosting providers, further hosting-specific configuration is required.
# --------------------------------
# Network settings for the Bedrock listener
bedrock:
# The IP address that Geyser will bind on to listen for incoming Bedrock connections.
# Generally, you should only change this if you want to limit what IPs can connect to your server.
address: 0.0.0.0
# The port that will Geyser will listen on for incoming Bedrock connections.
# Since Minecraft: Bedrock Edition uses UDP, this port must allow UDP traffic.
port: 19132
# Some hosting services change your Java port everytime you start the server and require the same port to be used for Bedrock.
# This option makes the Bedrock port the same as the Java port every time you start the server.
clone-remote-port: false
# Network settings for the Java server connection
java:
# 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".
auth-type: online
# MOTD settings
motd:
# The MOTD that will be broadcasted to Minecraft: Bedrock Edition clients. This is irrelevant if "passthrough-motd" is set to true.
# If either of these are empty, the respective string will default to "Geyser"
primary-motd: Geyser
secondary-motd: Another Geyser server.
# Whether Geyser should relay the MOTD from the Java server to Bedrock players.
passthrough-motd: true
# Maximum amount of players that can connect.
# This is only visual, and is only applied if passthrough-motd is disabled.
max-players: 100
# Whether to relay the player count and max players from the Java server to Bedrock players.
passthrough-player-counts: true
# Whether to use server API methods to determine the Java server's MOTD and ping passthrough.
# There is no need to disable this unless your MOTD or player count does not appear properly.
integrated-ping-passthrough: true
# How often to ping the Java server to refresh MOTD and player count, in seconds.
# Only relevant if integrated-ping-passthrough is disabled.
ping-passthrough-interval: 3
# Gameplay options that affect Bedrock players
gameplay:
# The server name that will be sent to Minecraft: Bedrock Edition clients. This is visible in both the pause menu and the settings menu.
server-name: Geyser
# Whether to automatically serve the GeyserOptionalPack to all connecting players.
# This adds some quality-of-life visual fixes for Bedrock players.
# See https://geysermc.org/wiki/other/geyseroptionalpack for all current features.
# If enabled, force-resource-packs will be enabled.
enable-optional-pack: true
# Allow a fake cooldown indicator to be sent. Bedrock players otherwise do not see a cooldown as they still use 1.8 combat.
# Please note: if the cooldown is enabled, some users may see a black box during the cooldown sequence, like below:
# https://geysermc.org/img/external/cooldown_indicator.png
# This can be disabled by going into Bedrock settings under the accessibility tab and setting "Text Background Opacity" to 0
# This setting can be set to "title", "actionbar" or "false"
show-cooldown: title
# Bedrock clients can freeze when opening up the command prompt for the first time if given a lot of commands.
# Disabling this will prevent command suggestions from being sent and solve freezing for Bedrock clients.
command-suggestions: true
# Controls if coordinates are shown to players.
show-coordinates: true
# Whether Bedrock players are blocked from performing their scaffolding-style bridging.
disable-bedrock-scaffolding: false
# Bedrock prevents building and displaying blocks above Y127 in the Nether.
# This config option works around that by changing the Nether dimension ID to the End ID.
# The main downside to this is that the entire Nether will have the same red fog rather than having different fog for each biome.
nether-roof-workaround: false
# Which item to use to mark unavailable slots in a Bedrock player inventory. Examples of this are the 2x2 crafting grid while in creative,
# or custom inventory menus with sizes different from the usual 3x9. A barrier block is the default item.
# This config option can be set to any Bedrock item identifier. If you want to set this to a custom item, make sure that you specify the item in the following format: "geyser_custom:<mapping-name>"
unusable-space-block: minecraft:barrier
# Whether to add any items and blocks which normally does not exist in Bedrock Edition.
# This should only need to be disabled if using a proxy that does not use the "transfer packet" style of server switching.
# If this is disabled, furnace minecart items will be mapped to hopper minecart items.
# Geyser's block, item, and skull mappings systems will also be disabled.
# This option requires a restart of Geyser in order to change its setting.
enable-custom-content: true
# Force clients to load all resource packs if there are any.
# If set to false, it allows the user to connect to the server even if they don't
# want to download the resource packs.
force-resource-packs: true
# Whether to forward player ping to the server. While enabling this will allow Bedrock players to have more accurate
# ping, it may also cause players to time out more easily.
forward-player-ping: false
# Allows Xbox achievements to be unlocked.
# If a player types in an unknown command, they will receive a message that states cheats are disabled.
# Otherwise, commands work as expected.
xbox-achievements-enabled: false
# The maximum number of custom skulls to be displayed per player. Increasing this may decrease performance on weaker devices.
# A value of 0 will disable all custom skulls.
# Setting this to -1 will cause all custom skulls to be displayed regardless of distance or number.
max-visible-custom-skulls: 128
# The radius in blocks around the player in which custom skulls are displayed.
custom-skull-render-distance: 32
# The default locale if we don't have the one the client requested. If set to "system", the system's language will be used.
default-locale: system
# Whether player IP addresses will be logged by the server.
log-player-ip-addresses: true
# For online mode authentication type only.
# Stores a list of Bedrock player usernames that should have their Java Edition account saved after login.
# This saves a token that can be reused to authenticate the player later. This does not save emails or passwords,
# but you should still be cautious when adding to this list and giving others access to this Geyser instance's files.
# Removing a name from this list will delete its cached login information on the next Geyser startup.
# The file that tokens will be saved in is in the same folder as this config, named "saved-refresh-tokens.json".
saved-user-logins:
- ThisExampleUsernameShouldBeLongEnoughToNeverBeAnXboxUsername
- ThisOtherExampleUsernameShouldAlsoBeLongEnough
# For online mode authentication type only.
# Specify how many seconds to wait while user authorizes Geyser to access their Microsoft account.
# User is allowed to disconnect from the server during this period.
pending-authentication-timeout: 120
# Whether to alert the console and operators that a new Geyser version is available that supports a Bedrock version
# that this Geyser version does not support. It's recommended to keep this option enabled, as many Bedrock platforms
# auto-update.
notify-on-new-bedrock-update: true
# Advanced configuration options. These usually do not need modifications.
advanced:
# Specify how many days player skin images will be cached to disk to save downloading them from the internet.
# A value of 0 is disabled. (Default: 0)
cache-images: 0
# Geyser updates the Scoreboard after every Scoreboard packet, but when Geyser tries to handle
# a lot of scoreboard packets per second, this can cause serious lag.
# This option allows you to specify after how many Scoreboard packets per seconds
# the Scoreboard updates will be limited to four updates per second.
scoreboard-packet-threshold: 20
# Whether Geyser should send team names in command suggestions.
# Disable this if you have a lot of teams used that you don't need as suggestions.
add-team-suggestions: true
# Floodgate uses encryption to ensure use from authorized sources.
# This should point to the public key generated by Floodgate (BungeeCord, Spigot or Velocity)
# You can ignore this when not using Floodgate.
# If you're using a plugin version of Floodgate on the same server, the key will automatically be picked up from Floodgate.
floodgate-key-file: key.pem
# Advanced networking options for the Geyser to Java server connection
java:
# Whether to enable HAPROXY protocol when connecting to the Java server.
# This is useful only when:
# 1) Your Java server supports HAPROXY protocol (it probably doesn't)
# 2) You run Velocity or BungeeCord with the option enabled in the proxy's main config.
# IF YOU DON'T KNOW WHAT THIS IS, DON'T TOUCH IT!
use-haproxy-protocol: false
# Whether to connect directly into the Java server without creating a TCP connection.
# This should only be disabled if a plugin that interfaces with packets or the network does not work correctly with Geyser.
# If enabled, the remote address and port sections are ignored.
# If disabled, expect performance decrease and latency increase.
use-direct-connection: true
# Whether Geyser should attempt to disable packet compression (from the Java Server to Geyser) for Bedrock players.
# This should be a benefit as there is no need to compress data when Java packets aren't being handled over the network.
# This requires use-direct-connection to be true.
disable-compression: true
# Advanced networking options for Geyser's Bedrock listener
bedrock:
# The port to broadcast to Bedrock clients with the MOTD that they should use to connect to the server.
# A value of 0 will broadcast the port specified above.
# DO NOT change this unless Geyser runs on a different port than the one that is used to connect.
broadcast-port: 0
# How much to compress network traffic to the Bedrock client. The higher the number, the more CPU usage used, but
# the smaller the bandwidth used. Does not have any effect below -1 or above 9. Set to -1 to disable.
compression-level: 6
# Whether to expect HAPROXY protocol for connecting Bedrock clients.
# This is useful only when you are running a UDP reverse proxy in front of your Geyser instance.
# IF YOU DON'T KNOW WHAT THIS IS, DON'T TOUCH IT!
use-haproxy-protocol: false
# A list of allowed HAPROXY protocol speaking proxy IP addresses/subnets. Only effective when "use-proxy-protocol" is enabled, and
# should really only be used when you are not able to use a proper firewall (usually true with shared hosting providers etc.).
# Keeping this list empty means there is no IP address whitelist.
# IP addresses, subnets, and links to plain text files are supported.
proxy-protocol-whitelisted-ips: []
# The internet supports a maximum MTU of 1492 but could cause issues with packet fragmentation.
# 1400 is the default.
mtu: 1400
# This option disables the auth step Geyser performs for connecting Bedrock players.
# It can be used to allow connections from ProxyPass and WaterdogPE. In these cases, make sure that users
# cannot directly connect to this Geyser instance. See https://www.spigotmc.org/wiki/firewall-guide/ for
# assistance - and use UDP instead of TCP.
# Disabling Bedrock authentication for other use-cases is NOT SUPPORTED, as it allows anyone to spoof usernames, and is therefore a security risk.
# All Floodgate functionality (including skin uploading and account linking) will also not work when this option is disabled.
validate-bedrock-login: true
# If debug messages should be sent through console
debug-mode: false
# Do not change!
config-version: 5

View File

@@ -0,0 +1,231 @@
# --------------------------------
# Geyser Configuration File
#
# A bridge between Minecraft: Bedrock Edition and Minecraft: Java Edition.
#
# GitHub: https://github.com/GeyserMC/Geyser
# Discord: https://discord.gg/geysermc
# Wiki: https://geysermc.org/wiki
#
# NOTICE: See https://geysermc.org/wiki/geyser/setup/ for the setup guide. Many video tutorials are outdated.
# In most cases, especially with server hosting providers, further hosting-specific configuration is required.
# --------------------------------
# Network settings for the Bedrock listener
bedrock:
# The IP address that Geyser will bind on to listen for incoming Bedrock connections.
# Generally, you should only change this if you want to limit what IPs can connect to your server.
address: 0.0.0.0
# The port that will Geyser will listen on for incoming Bedrock connections.
# Since Minecraft: Bedrock Edition uses UDP, this port must allow UDP traffic.
port: 19132
# Network settings for the Java server connection
java:
# The IP address of the Java Edition server.
address: 127.0.0.1
# The port of the Java Edition server.
port: 25565
# 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".
auth-type: online
# Whether to forward the hostname that the Bedrock client used to connect over to the Java server.
# This is designed to be used for forced hosts on proxies.
forward-hostname: false
# MOTD settings
motd:
# The MOTD that will be broadcasted to Minecraft: Bedrock Edition clients. This is irrelevant if "passthrough-motd" is set to true.
# If either of these are empty, the respective string will default to "Geyser"
primary-motd: Geyser
secondary-motd: Another Geyser server.
# Whether Geyser should relay the MOTD from the Java server to Bedrock players.
passthrough-motd: true
# Maximum amount of players that can connect.
# This is only visual, and is only applied if passthrough-motd is disabled.
max-players: 100
# Whether to relay the player count and max players from the Java server to Bedrock players.
passthrough-player-counts: true
# How often to ping the Java server to refresh MOTD and player count, in seconds.
ping-passthrough-interval: 3
# Gameplay options that affect Bedrock players
gameplay:
# The server name that will be sent to Minecraft: Bedrock Edition clients. This is visible in both the pause menu and the settings menu.
server-name: Geyser
# Whether to automatically serve the GeyserOptionalPack to all connecting players.
# This adds some quality-of-life visual fixes for Bedrock players.
# See https://geysermc.org/wiki/other/geyseroptionalpack for all current features.
# If enabled, force-resource-packs will be enabled.
enable-optional-pack: true
# Allow a fake cooldown indicator to be sent. Bedrock players otherwise do not see a cooldown as they still use 1.8 combat.
# Please note: if the cooldown is enabled, some users may see a black box during the cooldown sequence, like below:
# https://geysermc.org/img/external/cooldown_indicator.png
# This can be disabled by going into Bedrock settings under the accessibility tab and setting "Text Background Opacity" to 0
# This setting can be set to "title", "actionbar" or "false"
show-cooldown: title
# Bedrock clients can freeze when opening up the command prompt for the first time if given a lot of commands.
# Disabling this will prevent command suggestions from being sent and solve freezing for Bedrock clients.
command-suggestions: true
# Controls if coordinates are shown to players.
show-coordinates: true
# Whether Bedrock players are blocked from performing their scaffolding-style bridging.
disable-bedrock-scaffolding: false
# Bedrock prevents building and displaying blocks above Y127 in the Nether.
# This config option works around that by changing the Nether dimension ID to the End ID.
# The main downside to this is that the entire Nether will have the same red fog rather than having different fog for each biome.
nether-roof-workaround: false
# Which item to use to mark unavailable slots in a Bedrock player inventory. Examples of this are the 2x2 crafting grid while in creative,
# or custom inventory menus with sizes different from the usual 3x9. A barrier block is the default item.
# This config option can be set to any Bedrock item identifier. If you want to set this to a custom item, make sure that you specify the item in the following format: "geyser_custom:<mapping-name>"
unusable-space-block: minecraft:barrier
# Whether to add any items and blocks which normally does not exist in Bedrock Edition.
# This should only need to be disabled if using a proxy that does not use the "transfer packet" style of server switching.
# If this is disabled, furnace minecart items will be mapped to hopper minecart items.
# Geyser's block, item, and skull mappings systems will also be disabled.
# This option requires a restart of Geyser in order to change its setting.
enable-custom-content: true
# Force clients to load all resource packs if there are any.
# If set to false, it allows the user to connect to the server even if they don't
# want to download the resource packs.
force-resource-packs: true
# Whether to forward player ping to the server. While enabling this will allow Bedrock players to have more accurate
# ping, it may also cause players to time out more easily.
forward-player-ping: false
# Allows Xbox achievements to be unlocked.
# If a player types in an unknown command, they will receive a message that states cheats are disabled.
# Otherwise, commands work as expected.
xbox-achievements-enabled: false
# The maximum number of custom skulls to be displayed per player. Increasing this may decrease performance on weaker devices.
# A value of 0 will disable all custom skulls.
# Setting this to -1 will cause all custom skulls to be displayed regardless of distance or number.
max-visible-custom-skulls: 128
# The radius in blocks around the player in which custom skulls are displayed.
custom-skull-render-distance: 32
# The default locale if we don't have the one the client requested. If set to "system", the system's language will be used.
default-locale: system
# Whether player IP addresses will be logged by the server.
log-player-ip-addresses: true
# For online mode authentication type only.
# Stores a list of Bedrock player usernames that should have their Java Edition account saved after login.
# This saves a token that can be reused to authenticate the player later. This does not save emails or passwords,
# but you should still be cautious when adding to this list and giving others access to this Geyser instance's files.
# Removing a name from this list will delete its cached login information on the next Geyser startup.
# The file that tokens will be saved in is in the same folder as this config, named "saved-refresh-tokens.json".
saved-user-logins:
- ThisExampleUsernameShouldBeLongEnoughToNeverBeAnXboxUsername
- ThisOtherExampleUsernameShouldAlsoBeLongEnough
# For online mode authentication type only.
# Specify how many seconds to wait while user authorizes Geyser to access their Microsoft account.
# User is allowed to disconnect from the server during this period.
pending-authentication-timeout: 120
# Whether to alert the console and operators that a new Geyser version is available that supports a Bedrock version
# that this Geyser version does not support. It's recommended to keep this option enabled, as many Bedrock platforms
# auto-update.
notify-on-new-bedrock-update: true
# Advanced configuration options. These usually do not need modifications.
advanced:
# Specify how many days player skin images will be cached to disk to save downloading them from the internet.
# A value of 0 is disabled. (Default: 0)
cache-images: 0
# Geyser updates the Scoreboard after every Scoreboard packet, but when Geyser tries to handle
# a lot of scoreboard packets per second, this can cause serious lag.
# This option allows you to specify after how many Scoreboard packets per seconds
# the Scoreboard updates will be limited to four updates per second.
scoreboard-packet-threshold: 20
# Whether Geyser should send team names in command suggestions.
# Disable this if you have a lot of teams used that you don't need as suggestions.
add-team-suggestions: true
# Floodgate uses encryption to ensure use from authorized sources.
# This should point to the public key generated by Floodgate (BungeeCord, Spigot or Velocity)
# You can ignore this when not using Floodgate.
# If you're using a plugin version of Floodgate on the same server, the key will automatically be picked up from Floodgate.
floodgate-key-file: key.pem
# Advanced networking options for the Geyser to Java server connection
java:
# Whether to enable HAPROXY protocol when connecting to the Java server.
# This is useful only when:
# 1) Your Java server supports HAPROXY protocol (it probably doesn't)
# 2) You run Velocity or BungeeCord with the option enabled in the proxy's main config.
# IF YOU DON'T KNOW WHAT THIS IS, DON'T TOUCH IT!
use-haproxy-protocol: false
# Advanced networking options for Geyser's Bedrock listener
bedrock:
# The port to broadcast to Bedrock clients with the MOTD that they should use to connect to the server.
# A value of 0 will broadcast the port specified above.
# DO NOT change this unless Geyser runs on a different port than the one that is used to connect.
broadcast-port: 0
# How much to compress network traffic to the Bedrock client. The higher the number, the more CPU usage used, but
# the smaller the bandwidth used. Does not have any effect below -1 or above 9. Set to -1 to disable.
compression-level: 6
# Whether to expect HAPROXY protocol for connecting Bedrock clients.
# This is useful only when you are running a UDP reverse proxy in front of your Geyser instance.
# IF YOU DON'T KNOW WHAT THIS IS, DON'T TOUCH IT!
use-haproxy-protocol: false
# A list of allowed HAPROXY protocol speaking proxy IP addresses/subnets. Only effective when "use-proxy-protocol" is enabled, and
# should really only be used when you are not able to use a proper firewall (usually true with shared hosting providers etc.).
# Keeping this list empty means there is no IP address whitelist.
# IP addresses, subnets, and links to plain text files are supported.
proxy-protocol-whitelisted-ips: []
# The internet supports a maximum MTU of 1492 but could cause issues with packet fragmentation.
# 1400 is the default.
mtu: 1400
# This option disables the auth step Geyser performs for connecting Bedrock players.
# It can be used to allow connections from ProxyPass and WaterdogPE. In these cases, make sure that users
# cannot directly connect to this Geyser instance. See https://www.spigotmc.org/wiki/firewall-guide/ for
# assistance - and use UDP instead of TCP.
# Disabling Bedrock authentication for other use-cases is NOT SUPPORTED, as it allows anyone to spoof usernames, and is therefore a security risk.
# All Floodgate functionality (including skin uploading and account linking) will also not work when this option is disabled.
validate-bedrock-login: true
# bStats is a stat tracker that is entirely anonymous and tracks only basic information
# about Geyser, such as how many people are online, how many servers are using Geyser,
# what OS is being used, etc. You can learn more about bStats here: https://bstats.org/.
# https://bstats.org/plugin/server-implementation/GeyserMC
enable-metrics: true
# The bstats metrics uuid. Do not touch!
metrics-uuid: 00000000-0000-0000-0000-000000000000
# If debug messages should be sent through console
debug-mode: false
# Do not change!
config-version: 5