1
0
mirror of https://github.com/GeyserMC/Geyser.git synced 2025-12-19 14:59:27 +00:00

Only enable the locator bar when we're certain the Java server wants us to

This commit is contained in:
onebeastchris
2025-06-26 00:34:46 +02:00
parent 473cd0bb97
commit 868fed172e
3 changed files with 12 additions and 0 deletions

View File

@@ -867,6 +867,10 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource {
gamerulePacket.getGameRules().add(new GameRuleData<>("spawnradius", 0));
// Recipe unlocking
gamerulePacket.getGameRules().add(new GameRuleData<>("recipesunlock", true));
// We disable the locator bar until we are certain that the server wants us to enable it
// See WaypointCache for details
gamerulePacket.getGameRules().add(new GameRuleData<>("locatorBar", false));
upstream.sendPacket(gamerulePacket);
}

View File

@@ -175,4 +175,9 @@ public final class WaypointCache {
addPacket.getEntries().add(entry);
session.sendUpstreamPacket(addPacket);
}
public void clear() {
waypoints.clear();
session.sendGameRule("locatorBar", false);
}
}

View File

@@ -83,6 +83,9 @@ public class JavaLoginTranslator extends PacketTranslator<ClientboundLoginPacket
session.setInventoryHolder(null);
session.setPendingOrCurrentBedrockInventoryId(-1);
session.setClosingInventory(false);
// Clear waypoints
session.getWaypointCache().clear();
}
session.setDimensionType(newDimension);