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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -175,4 +175,9 @@ public final class WaypointCache {
|
||||
addPacket.getEntries().add(entry);
|
||||
session.sendUpstreamPacket(addPacket);
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
waypoints.clear();
|
||||
session.sendGameRule("locatorBar", false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user