Skip to content

Commit 069d35c

Browse files
committed
Likely fix for #2573
Tested working on Paper 1.21
1 parent 54c43f2 commit 069d35c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaCommandsTranslator.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,21 @@ public class JavaCommandsTranslator extends PacketTranslator<ClientboundCommands
7676
@Override
7777
public int hashCode(BedrockCommandInfo o) {
7878
int paramHash = Arrays.deepHashCode(o.paramData());
79+
if ("help".equals(o.name())) {
80+
paramHash = 31 * paramHash + 1;
81+
}
7982
return 31 * paramHash + o.description().hashCode();
8083
}
8184

8285
@Override
8386
public boolean equals(BedrockCommandInfo a, BedrockCommandInfo b) {
8487
if (a == b) return true;
8588
if (a == null || b == null) return false;
89+
if ("help".equals(a.name()) && !"help".equals(b.name())) {
90+
// Merging this causes Bedrock to fallback to its own help command
91+
// https://github.com/GeyserMC/Geyser/issues/2573
92+
return false;
93+
}
8694
if (!a.description().equals(b.description())) return false;
8795
if (a.paramData().length != b.paramData().length) return false;
8896
for (int i = 0; i < a.paramData().length; i++) {

0 commit comments

Comments
 (0)