Merge branch 'master' into feature/1.21.20

This commit is contained in:
Kas-tle 2024-08-07 17:36:23 -07:00 committed by GitHub
commit 630a8424c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 7 deletions

4
.gitignore vendored
View file

@ -249,6 +249,8 @@ locales/
/packs/ /packs/
/dump.json /dump.json
/saved-refresh-tokens.json /saved-refresh-tokens.json
/saved-auth-chains.json
/custom_mappings/ /custom_mappings/
/languages/ /languages/
/custom-skulls.yml /custom-skulls.yml
/permissions.yml

View file

@ -432,13 +432,18 @@ public class GeyserImpl implements GeyserApi, EventRegistrar {
this.geyserServer = new GeyserServer(this, bedrockThreadCount); this.geyserServer = new GeyserServer(this, bedrockThreadCount);
this.geyserServer.bind(new InetSocketAddress(config.getBedrock().address(), config.getBedrock().port())) this.geyserServer.bind(new InetSocketAddress(config.getBedrock().address(), config.getBedrock().port()))
.whenComplete((avoid, throwable) -> { .whenComplete((avoid, throwable) -> {
String address = config.getBedrock().address();
String port = String.valueOf(config.getBedrock().port()); // otherwise we get commas
if (throwable == null) { if (throwable == null) {
logger.info(GeyserLocale.getLocaleStringLog("geyser.core.start", config.getBedrock().address(), if ("0.0.0.0".equals(address)) {
String.valueOf(config.getBedrock().port()))); // basically just hide it in the log because some people get confused and try to change it
logger.info(GeyserLocale.getLocaleStringLog("geyser.core.start.ip_suppressed", port));
} else {
logger.info(GeyserLocale.getLocaleStringLog("geyser.core.start", address, port));
}
} else { } else {
String address = config.getBedrock().address(); logger.severe(GeyserLocale.getLocaleStringLog("geyser.core.fail", address, port));
int port = config.getBedrock().port();
logger.severe(GeyserLocale.getLocaleStringLog("geyser.core.fail", address, String.valueOf(port)));
if (!"0.0.0.0".equals(address)) { if (!"0.0.0.0".equals(address)) {
logger.info(Component.text("Suggestion: try setting `address` under `bedrock` in the Geyser config back to 0.0.0.0", NamedTextColor.GREEN)); logger.info(Component.text("Suggestion: try setting `address` under `bedrock` in the Geyser config back to 0.0.0.0", NamedTextColor.GREEN));
logger.info(Component.text("Then, restart this server.", NamedTextColor.GREEN)); logger.info(Component.text("Then, restart this server.", NamedTextColor.GREEN));

View file

@ -76,6 +76,9 @@ public class JavaCommandsTranslator extends PacketTranslator<ClientboundCommands
@Override @Override
public int hashCode(BedrockCommandInfo o) { public int hashCode(BedrockCommandInfo o) {
int paramHash = Arrays.deepHashCode(o.paramData()); int paramHash = Arrays.deepHashCode(o.paramData());
if ("help".equals(o.name())) {
paramHash = 31 * paramHash + 1;
}
return 31 * paramHash + o.description().hashCode(); return 31 * paramHash + o.description().hashCode();
} }
@ -83,6 +86,11 @@ public class JavaCommandsTranslator extends PacketTranslator<ClientboundCommands
public boolean equals(BedrockCommandInfo a, BedrockCommandInfo b) { public boolean equals(BedrockCommandInfo a, BedrockCommandInfo b) {
if (a == b) return true; if (a == b) return true;
if (a == null || b == null) return false; if (a == null || b == null) return false;
if ("help".equals(a.name()) && !"help".equals(b.name())) {
// Merging this causes Bedrock to fallback to its own help command
// https://github.com/GeyserMC/Geyser/issues/2573
return false;
}
if (!a.description().equals(b.description())) return false; if (!a.description().equals(b.description())) return false;
if (a.paramData().length != b.paramData().length) return false; if (a.paramData().length != b.paramData().length) return false;
for (int i = 0; i < a.paramData().length; i++) { for (int i = 0; i < a.paramData().length; i++) {

@ -1 +1 @@
Subproject commit 60b20023a92f084aba895ab0336e70fa7fb311fb Subproject commit a943a1bb910f58caa61f14bafacbc622bd48a694