Skip to content

Commit

Permalink
Fix #5395, fix #5398
Browse files Browse the repository at this point in the history
  • Loading branch information
onebeastchris committed Mar 5, 2025
1 parent 679bc41 commit cc94d5a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,12 @@ public void hideElement(GuiElement... elements) {
elementSet.add(HUD_ELEMENT_VALUES[element.id()]);
}

session.sendUpstreamPacket(packet);
if (session.isSentSpawnPacket()) {
session.sendUpstreamPacket(packet);
} else {
// Ensures hidden GUI elements properly hide when we spawn in the spectator gamemode
session.getUpstream().queuePostStartGamePacket(packet);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public RakGeyserRateLimiter(Channel channel) {

@Override
protected int getAddressMaxPacketCount(InetAddress address) {
// The default packet limit is already padded, so we reduce it by 20%
return (int) (super.getAddressMaxPacketCount(address) * sessionManager.getAddressMultiplier(address) * 0.8);
return super.getAddressMaxPacketCount(address) * sessionManager.getAddressMultiplier(address);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public void translate(GeyserSession session, ClientboundLoginPacket packet) {
session.setDimensionType(newDimension);
session.setWorldName(spawnInfo.getWorldName());
session.setLevels(Arrays.stream(packet.getWorldNames()).map(Key::asString).toArray(String[]::new));
session.setGameMode(spawnInfo.getGameMode());

boolean needsSpawnPacket = !session.isSentSpawnPacket();
if (needsSpawnPacket) {
Expand All @@ -97,7 +98,6 @@ public void translate(GeyserSession session, ClientboundLoginPacket packet) {
session.sendUpstreamPacket(playerGameTypePacket);
}

session.setGameMode(spawnInfo.getGameMode());
entity.setLastDeathPosition(spawnInfo.getLastDeathPos());

entity.updateBedrockMetadata();
Expand Down

0 comments on commit cc94d5a

Please sign in to comment.