mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
Force-disable query if it would interfere with Geyser's startup.
Fixes #3312
This commit is contained in:
parent
04883a166a
commit
97ec5fec33
1 changed files with 18 additions and 0 deletions
|
@ -137,6 +137,24 @@ public class GeyserBungeePlugin extends Plugin implements GeyserBootstrap {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Force-disable query if enabled, or else Geyser won't enable
|
||||||
|
for (ListenerInfo info : getProxy().getConfig().getListeners()) {
|
||||||
|
if (info.isQueryEnabled() && info.getQueryPort() == geyserConfig.getBedrock().port()) {
|
||||||
|
try {
|
||||||
|
Field queryField = ListenerInfo.class.getDeclaredField("queryEnabled");
|
||||||
|
queryField.setAccessible(true);
|
||||||
|
queryField.setBoolean(info, false);
|
||||||
|
geyserLogger.warning("We force-disabled query on port " + info.getQueryPort() + " in order for Geyser to boot up successfully. " +
|
||||||
|
"To remove this message, disable query in your proxy's config.");
|
||||||
|
} catch (NoSuchFieldException | IllegalAccessException e) {
|
||||||
|
geyserLogger.warning("Could not force-disable query. Geyser may not start correctly!");
|
||||||
|
if (geyserLogger.isDebug()) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (geyserConfig.getRemote().authType() == AuthType.FLOODGATE && getProxy().getPluginManager().getPlugin("floodgate") == null) {
|
if (geyserConfig.getRemote().authType() == AuthType.FLOODGATE && getProxy().getPluginManager().getPlugin("floodgate") == null) {
|
||||||
geyserLogger.severe(GeyserLocale.getLocaleStringLog("geyser.bootstrap.floodgate.not_installed") + " " + GeyserLocale.getLocaleStringLog("geyser.bootstrap.floodgate.disabling"));
|
geyserLogger.severe(GeyserLocale.getLocaleStringLog("geyser.bootstrap.floodgate.not_installed") + " " + GeyserLocale.getLocaleStringLog("geyser.bootstrap.floodgate.disabling"));
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue