From faf663d3cd235d129dadf86bdab2e18ec2acedb2 Mon Sep 17 00:00:00 2001 From: Tim203 Date: Thu, 31 Oct 2024 09:30:01 +0100 Subject: [PATCH 1/3] Check if objective is null and made scoreboard errors player-specific --- .../org/geysermc/geyser/scoreboard/Scoreboard.java | 2 +- .../java/scoreboard/JavaResetScorePacket.java | 14 ++++++++++++++ .../java/scoreboard/JavaSetScoreTranslator.java | 11 ++++------- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/scoreboard/Scoreboard.java b/core/src/main/java/org/geysermc/geyser/scoreboard/Scoreboard.java index 6e0867ddc..3d3bfb48d 100644 --- a/core/src/main/java/org/geysermc/geyser/scoreboard/Scoreboard.java +++ b/core/src/main/java/org/geysermc/geyser/scoreboard/Scoreboard.java @@ -178,7 +178,7 @@ public final class Scoreboard { Team team = teams.get(teamName); if (team != null) { if (SHOW_SCOREBOARD_LOGS) { - logger.info(GeyserLocale.getLocaleStringLog("geyser.network.translator.team.failed_overrides", teamName)); + logger.info("Ignoring team %s for %s. It overrides without removing old team.".formatted(teamName, session.javaUsername())); } return; } diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/scoreboard/JavaResetScorePacket.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/scoreboard/JavaResetScorePacket.java index cf688bbfd..72dcd4062 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/scoreboard/JavaResetScorePacket.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/scoreboard/JavaResetScorePacket.java @@ -25,6 +25,8 @@ package org.geysermc.geyser.translator.protocol.java.scoreboard; +import org.geysermc.geyser.GeyserImpl; +import org.geysermc.geyser.GeyserLogger; import org.geysermc.geyser.scoreboard.Objective; import org.geysermc.geyser.scoreboard.Scoreboard; import org.geysermc.geyser.scoreboard.ScoreboardUpdater; @@ -36,6 +38,10 @@ import org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound.scoreboard. @Translator(packet = ClientboundResetScorePacket.class) public class JavaResetScorePacket extends PacketTranslator { + private static final boolean SHOW_SCOREBOARD_LOGS = Boolean.parseBoolean(System.getProperty("Geyser.ShowScoreboardLogs", "true")); + + private final GeyserLogger logger = GeyserImpl.getInstance().getLogger(); + @Override public void translate(GeyserSession session, ClientboundResetScorePacket packet) { WorldCache worldCache = session.getWorldCache(); @@ -47,6 +53,14 @@ public class JavaResetScorePacket extends PacketTranslator { private static final boolean SHOW_SCOREBOARD_LOGS = Boolean.parseBoolean(System.getProperty("Geyser.ShowScoreboardLogs", "true")); - private final GeyserLogger logger; - - public JavaSetScoreTranslator() { - logger = GeyserImpl.getInstance().getLogger(); - } + private final GeyserLogger logger = GeyserImpl.getInstance().getLogger(); @Override public void translate(GeyserSession session, ClientboundSetScorePacket packet) { @@ -56,7 +51,9 @@ public class JavaSetScoreTranslator extends PacketTranslator Date: Fri, 1 Nov 2024 14:48:07 -0400 Subject: [PATCH 2/3] Indicate support for Bedrock 1.21.44 Bedrock are u ok --- README.md | 2 +- .../main/java/org/geysermc/geyser/network/GameProtocol.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fedb5bb96..329a9045e 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ The ultimate goal of this project is to allow Minecraft: Bedrock Edition users t Special thanks to the DragonProxy project for being a trailblazer in protocol translation and for all the team members who have joined us here! ## Supported Versions -Geyser is currently supporting Minecraft Bedrock 1.20.80 - 1.21.43 and Minecraft Java 1.21/1.21.1. For more information, please see [here](https://geysermc.org/wiki/geyser/supported-versions/). +Geyser is currently supporting Minecraft Bedrock 1.20.80 - 1.21.44 and Minecraft Java 1.21/1.21.1. For more information, please see [here](https://geysermc.org/wiki/geyser/supported-versions/). ## Setting Up Take a look [here](https://geysermc.org/wiki/geyser/setup/) for how to set up Geyser. diff --git a/core/src/main/java/org/geysermc/geyser/network/GameProtocol.java b/core/src/main/java/org/geysermc/geyser/network/GameProtocol.java index 464edd487..873fa413a 100644 --- a/core/src/main/java/org/geysermc/geyser/network/GameProtocol.java +++ b/core/src/main/java/org/geysermc/geyser/network/GameProtocol.java @@ -52,7 +52,7 @@ public final class GameProtocol { * release of the game that Geyser supports. */ public static final BedrockCodec DEFAULT_BEDROCK_CODEC = CodecProcessor.processCodec(Bedrock_v748.CODEC.toBuilder() - .minecraftVersion("1.21.43") + .minecraftVersion("1.21.44") .build()); /** @@ -83,7 +83,7 @@ public final class GameProtocol { .minecraftVersion("1.21.30/1.21.31") .build())); SUPPORTED_BEDROCK_CODECS.add(DEFAULT_BEDROCK_CODEC.toBuilder() - .minecraftVersion("1.21.40/1.21.41/1.21.43") + .minecraftVersion("1.21.40 - 1.21.44") .build()); } From d61ad7baeffb1f3d35d05783a8e89ce9c6e35e30 Mon Sep 17 00:00:00 2001 From: Tim203 Date: Sat, 2 Nov 2024 11:48:58 +0100 Subject: [PATCH 3/3] Reset the scoreboard in the configuration stage --- .../java/org/geysermc/geyser/session/cache/WorldCache.java | 2 +- .../java/JavaFinishConfigurationPacketTranslator.java | 6 ++++++ .../translator/protocol/java/JavaLoginTranslator.java | 2 -- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/session/cache/WorldCache.java b/core/src/main/java/org/geysermc/geyser/session/cache/WorldCache.java index 5927963c0..f2198c7dc 100644 --- a/core/src/main/java/org/geysermc/geyser/session/cache/WorldCache.java +++ b/core/src/main/java/org/geysermc/geyser/session/cache/WorldCache.java @@ -81,7 +81,7 @@ public final class WorldCache { resetTitleTimes(false); } - public void removeScoreboard() { + public void resetScoreboard() { scoreboard.removeScoreboard(); scoreboard = new Scoreboard(session); } diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaFinishConfigurationPacketTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaFinishConfigurationPacketTranslator.java index 8ade4a1f0..f6ed79fd5 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaFinishConfigurationPacketTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaFinishConfigurationPacketTranslator.java @@ -45,5 +45,11 @@ public class JavaFinishConfigurationPacketTranslator extends PacketTranslator