1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2025-12-26 02:09:17 +00:00

Only enable locator bar experiment for 1.21.80 clients

This commit is contained in:
Eclipse
2025-06-14 10:46:08 +00:00
parent 6a06a72246
commit b6fdf02a57
3 changed files with 13 additions and 4 deletions

View File

@@ -107,6 +107,10 @@ public final class GameProtocol {
return session.protocolVersion() >= Bedrock_v800.CODEC.getProtocolVersion();
}
public static boolean is1_21_80(GeyserSession session) {
return session.protocolVersion() == Bedrock_v800.CODEC.getProtocolVersion();
}
/**
* Gets the {@link PacketCodec} for Minecraft: Java Edition.
*

View File

@@ -244,8 +244,11 @@ public class UpstreamPacketHandler extends LoggingPacketHandler {
stackPacket.getExperiments().add(new ExperimentData("experimental_graphics", true));
// Enables 2025 Content Drop 2 features
stackPacket.getExperiments().add(new ExperimentData("y_2025_drop_2", true));
// Enables the locator bar for clients below 1.21.90
stackPacket.getExperiments().add(new ExperimentData("locator_bar", true));
if (GameProtocol.is1_21_80(session)) {
// Enables the locator bar for 1.21.80 clients
stackPacket.getExperiments().add(new ExperimentData("locator_bar", true));
}
session.sendUpstreamPacket(stackPacket);
}

View File

@@ -1696,8 +1696,10 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
startGamePacket.getExperiments().add(new ExperimentData("experimental_graphics", true));
// Enables 2025 Content Drop 2 features
startGamePacket.getExperiments().add(new ExperimentData("y_2025_drop_2", true));
// Enables the locator bar for clients below 1.21.90
startGamePacket.getExperiments().add(new ExperimentData("locator_bar", true));
if (GameProtocol.is1_21_80(this)) {
// Enables the locator bar for 1.21.80 clients
startGamePacket.getExperiments().add(new ExperimentData("locator_bar", true));
}
startGamePacket.setVanillaVersion("*");
startGamePacket.setInventoriesServerAuthoritative(true);