mirror of
https://github.com/GeyserMC/Geyser.git
synced 2025-12-19 23:09:29 +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));
|
gamerulePacket.getGameRules().add(new GameRuleData<>("spawnradius", 0));
|
||||||
// Recipe unlocking
|
// Recipe unlocking
|
||||||
gamerulePacket.getGameRules().add(new GameRuleData<>("recipesunlock", true));
|
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);
|
upstream.sendPacket(gamerulePacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -175,4 +175,9 @@ public final class WaypointCache {
|
|||||||
addPacket.getEntries().add(entry);
|
addPacket.getEntries().add(entry);
|
||||||
session.sendUpstreamPacket(addPacket);
|
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.setInventoryHolder(null);
|
||||||
session.setPendingOrCurrentBedrockInventoryId(-1);
|
session.setPendingOrCurrentBedrockInventoryId(-1);
|
||||||
session.setClosingInventory(false);
|
session.setClosingInventory(false);
|
||||||
|
|
||||||
|
// Clear waypoints
|
||||||
|
session.getWaypointCache().clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
session.setDimensionType(newDimension);
|
session.setDimensionType(newDimension);
|
||||||
|
|||||||
Reference in New Issue
Block a user