From 6a6a601efc3a73281210842e7f9a39fc8ef21db2 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Wed, 15 Feb 2023 00:01:33 -0500 Subject: [PATCH 1/6] Notify on disconnect when a new Geyser update is available --- .../geyser/network/UpstreamPacketHandler.java | 12 +++++++++++- .../org/geysermc/geyser/util/VersionCheckUtils.java | 9 +++++++++ core/src/main/resources/languages | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/network/UpstreamPacketHandler.java b/core/src/main/java/org/geysermc/geyser/network/UpstreamPacketHandler.java index 227f0ed5a..a72d8ab9e 100644 --- a/core/src/main/java/org/geysermc/geyser/network/UpstreamPacketHandler.java +++ b/core/src/main/java/org/geysermc/geyser/network/UpstreamPacketHandler.java @@ -31,6 +31,7 @@ import com.nukkitx.protocol.bedrock.data.ExperimentData; import com.nukkitx.protocol.bedrock.data.PacketCompressionAlgorithm; import com.nukkitx.protocol.bedrock.data.ResourcePackType; import com.nukkitx.protocol.bedrock.packet.*; +import org.geysermc.geyser.Constants; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.api.network.AuthType; import org.geysermc.geyser.configuration.GeyserConfiguration; @@ -43,11 +44,13 @@ import org.geysermc.geyser.session.PendingMicrosoftAuthentication; import org.geysermc.geyser.text.GeyserLocale; import org.geysermc.geyser.util.LoginEncryptionUtils; import org.geysermc.geyser.util.MathUtils; +import org.geysermc.geyser.util.VersionCheckUtils; import java.io.FileInputStream; import java.io.InputStream; import java.util.ArrayDeque; import java.util.Deque; +import java.util.OptionalInt; public class UpstreamPacketHandler extends LoggingPacketHandler { @@ -74,7 +77,14 @@ public class UpstreamPacketHandler extends LoggingPacketHandler { String supportedVersions = GameProtocol.getAllSupportedBedrockVersions(); if (protocolVersion > GameProtocol.DEFAULT_BEDROCK_CODEC.getProtocolVersion()) { // Too early to determine session locale - session.disconnect(GeyserLocale.getLocaleStringLog("geyser.network.outdated.server", supportedVersions)); + String disconnectMessage = GeyserLocale.getLocaleStringLog("geyser.network.outdated.server", supportedVersions); + // If the latest release matches this version, then let the user know. + OptionalInt latestRelease = VersionCheckUtils.getLatestBedrockRelease(); + if (latestRelease.isPresent() && latestRelease.getAsInt() == protocolVersion) { + // Random note: don't make the disconnect message too long or Bedrock will cut it off on smaller screens + disconnectMessage += "\n" + GeyserLocale.getLocaleStringLog("geyser.version.new.on_disconnect", Constants.GEYSER_DOWNLOAD_LOCATION); + } + session.disconnect(disconnectMessage); return false; } else if (protocolVersion < GameProtocol.DEFAULT_BEDROCK_CODEC.getProtocolVersion()) { session.disconnect(GeyserLocale.getLocaleStringLog("geyser.network.outdated.client", supportedVersions)); diff --git a/core/src/main/java/org/geysermc/geyser/util/VersionCheckUtils.java b/core/src/main/java/org/geysermc/geyser/util/VersionCheckUtils.java index 049d78619..dc0edd37a 100644 --- a/core/src/main/java/org/geysermc/geyser/util/VersionCheckUtils.java +++ b/core/src/main/java/org/geysermc/geyser/util/VersionCheckUtils.java @@ -38,10 +38,13 @@ import org.geysermc.geyser.command.GeyserCommandSource; import org.geysermc.geyser.network.GameProtocol; import org.geysermc.geyser.text.GeyserLocale; +import javax.annotation.Nonnull; +import java.util.OptionalInt; import java.util.concurrent.CompletableFuture; import java.util.function.Supplier; public final class VersionCheckUtils { + private static @Nonnull OptionalInt LATEST_BEDROCK_RELEASE = OptionalInt.empty(); public static void checkForOutdatedFloodgate(GeyserLogger logger) { try { @@ -61,10 +64,12 @@ public final class VersionCheckUtils { JsonNode bedrock = json.get("bedrock").get("protocol"); int protocolVersion = bedrock.get("id").asInt(); if (GameProtocol.getBedrockCodec(protocolVersion) != null) { + LATEST_BEDROCK_RELEASE = OptionalInt.empty(); // We support the latest version! No need to print a message. return; } + LATEST_BEDROCK_RELEASE = OptionalInt.of(protocolVersion); final String newBedrockVersion = bedrock.get("name").asText(); // Delayed for two reasons: save unnecessary processing, and wait to load locale if this is on join. @@ -89,6 +94,10 @@ public final class VersionCheckUtils { }); } + public static @Nonnull OptionalInt getLatestBedrockRelease() { + return LATEST_BEDROCK_RELEASE; + } + private VersionCheckUtils() { } } diff --git a/core/src/main/resources/languages b/core/src/main/resources/languages index f6685c4cc..24be9ef7f 160000 --- a/core/src/main/resources/languages +++ b/core/src/main/resources/languages @@ -1 +1 @@ -Subproject commit f6685c4ccc6e77b07402d45cb41213559004b7d6 +Subproject commit 24be9ef7f850f7d180650a65792c266c709cadf5 From ee754c529ba1072d07cb684336204b5251661ff1 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Wed, 15 Feb 2023 00:17:14 -0500 Subject: [PATCH 2/6] Add implementation for ClientEmoteEvent Also, a few random changes I've stored since forever. --- ...rockEmoteEvent.java => ClientEmoteEvent.java} | 4 ++-- .../geyser/command/defaults/OffhandCommand.java | 8 +------- .../geyser/item/components/ToolTier.java | 2 +- .../geyser/level/GeyserWorldManager.java | 8 +------- .../geyser/level/physics/PistonBehavior.java | 2 +- .../geyser/registry/type/ParticleMapping.java | 3 ++- .../geysermc/geyser/session/GeyserSession.java | 8 +++++++- .../geyser/session/cache/LodestoneCache.java | 3 +-- .../inventory/EnchantingInventoryTranslator.java | 3 ++- .../entity/player/BedrockEmoteTranslator.java | 16 +++++++++------- 10 files changed, 27 insertions(+), 30 deletions(-) rename api/src/main/java/org/geysermc/geyser/api/event/bedrock/{BedrockEmoteEvent.java => ClientEmoteEvent.java} (92%) diff --git a/api/src/main/java/org/geysermc/geyser/api/event/bedrock/BedrockEmoteEvent.java b/api/src/main/java/org/geysermc/geyser/api/event/bedrock/ClientEmoteEvent.java similarity index 92% rename from api/src/main/java/org/geysermc/geyser/api/event/bedrock/BedrockEmoteEvent.java rename to api/src/main/java/org/geysermc/geyser/api/event/bedrock/ClientEmoteEvent.java index efe3f12d6..35b6a9e73 100644 --- a/api/src/main/java/org/geysermc/geyser/api/event/bedrock/BedrockEmoteEvent.java +++ b/api/src/main/java/org/geysermc/geyser/api/event/bedrock/ClientEmoteEvent.java @@ -33,11 +33,11 @@ import org.geysermc.geyser.api.event.connection.ConnectionEvent; /** * Called whenever a Bedrock player performs an emote on their end, before it is broadcasted to the rest of the server. */ -public final class BedrockEmoteEvent extends ConnectionEvent implements Cancellable { +public final class ClientEmoteEvent extends ConnectionEvent implements Cancellable { private final String emoteId; private boolean cancelled; - public BedrockEmoteEvent(@NonNull GeyserConnection connection, @NonNull String emoteId) { + public ClientEmoteEvent(@NonNull GeyserConnection connection, @NonNull String emoteId) { super(connection); this.emoteId = emoteId; } diff --git a/core/src/main/java/org/geysermc/geyser/command/defaults/OffhandCommand.java b/core/src/main/java/org/geysermc/geyser/command/defaults/OffhandCommand.java index 0015149be..6188e6924 100644 --- a/core/src/main/java/org/geysermc/geyser/command/defaults/OffhandCommand.java +++ b/core/src/main/java/org/geysermc/geyser/command/defaults/OffhandCommand.java @@ -25,10 +25,6 @@ package org.geysermc.geyser.command.defaults; -import com.github.steveice10.mc.protocol.data.game.entity.object.Direction; -import com.github.steveice10.mc.protocol.data.game.entity.player.PlayerAction; -import com.github.steveice10.mc.protocol.packet.ingame.serverbound.player.ServerboundPlayerActionPacket; -import com.nukkitx.math.vector.Vector3i; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.command.GeyserCommand; import org.geysermc.geyser.command.GeyserCommandSource; @@ -46,9 +42,7 @@ public class OffhandCommand extends GeyserCommand { return; } - ServerboundPlayerActionPacket releaseItemPacket = new ServerboundPlayerActionPacket(PlayerAction.SWAP_HANDS, Vector3i.ZERO, - Direction.DOWN, 0); - session.sendDownstreamPacket(releaseItemPacket); + session.requestOffhandSwap(); } @Override diff --git a/core/src/main/java/org/geysermc/geyser/item/components/ToolTier.java b/core/src/main/java/org/geysermc/geyser/item/components/ToolTier.java index 37e581682..724b197fb 100644 --- a/core/src/main/java/org/geysermc/geyser/item/components/ToolTier.java +++ b/core/src/main/java/org/geysermc/geyser/item/components/ToolTier.java @@ -37,7 +37,7 @@ public enum ToolTier { DIAMOND(8), NETHERITE(9); - public static final ToolTier[] VALUES = values(); + private static final ToolTier[] VALUES = values(); private final int speed; diff --git a/core/src/main/java/org/geysermc/geyser/level/GeyserWorldManager.java b/core/src/main/java/org/geysermc/geyser/level/GeyserWorldManager.java index f19060c65..5df97e8d7 100644 --- a/core/src/main/java/org/geysermc/geyser/level/GeyserWorldManager.java +++ b/core/src/main/java/org/geysermc/geyser/level/GeyserWorldManager.java @@ -29,9 +29,7 @@ import com.nukkitx.nbt.NbtMap; import com.nukkitx.nbt.NbtMapBuilder; import it.unimi.dsi.fastutil.objects.Object2ObjectMap; import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap; -import org.geysermc.geyser.level.block.BlockStateValues; import org.geysermc.geyser.session.GeyserSession; -import org.geysermc.geyser.session.cache.ChunkCache; import org.geysermc.geyser.translator.inventory.LecternInventoryTranslator; public class GeyserWorldManager extends WorldManager { @@ -39,11 +37,7 @@ public class GeyserWorldManager extends WorldManager { @Override public int getBlockAt(GeyserSession session, int x, int y, int z) { - ChunkCache chunkCache = session.getChunkCache(); - if (chunkCache != null) { // Chunk cache can be null if the session is closed asynchronously - return chunkCache.getBlockAt(x, y, z); - } - return BlockStateValues.JAVA_AIR_ID; + return session.getChunkCache().getBlockAt(x, y, z); } @Override diff --git a/core/src/main/java/org/geysermc/geyser/level/physics/PistonBehavior.java b/core/src/main/java/org/geysermc/geyser/level/physics/PistonBehavior.java index bf943134b..a6b25d01e 100644 --- a/core/src/main/java/org/geysermc/geyser/level/physics/PistonBehavior.java +++ b/core/src/main/java/org/geysermc/geyser/level/physics/PistonBehavior.java @@ -33,7 +33,7 @@ public enum PistonBehavior { DESTROY, PUSH_ONLY; - public static final PistonBehavior[] VALUES = values(); + private static final PistonBehavior[] VALUES = values(); public static PistonBehavior getByName(String name) { String upperCase = name.toUpperCase(Locale.ROOT); diff --git a/core/src/main/java/org/geysermc/geyser/registry/type/ParticleMapping.java b/core/src/main/java/org/geysermc/geyser/registry/type/ParticleMapping.java index 71feee3de..dcafcd0bf 100644 --- a/core/src/main/java/org/geysermc/geyser/registry/type/ParticleMapping.java +++ b/core/src/main/java/org/geysermc/geyser/registry/type/ParticleMapping.java @@ -28,12 +28,13 @@ package org.geysermc.geyser.registry.type; import com.nukkitx.protocol.bedrock.data.LevelEventType; import org.geysermc.geyser.session.GeyserSession; +import javax.annotation.Nonnull; import javax.annotation.ParametersAreNullableByDefault; @ParametersAreNullableByDefault public record ParticleMapping(LevelEventType levelEventType, String identifier) { - public int getParticleId(GeyserSession session) { + public int getParticleId(@Nonnull GeyserSession session) { if (this.levelEventType == null) { return -1; } diff --git a/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java b/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java index 33655beda..bc49e8945 100644 --- a/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java +++ b/core/src/main/java/org/geysermc/geyser/session/GeyserSession.java @@ -180,7 +180,7 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource { private final AdvancementsCache advancementsCache; private final BookEditCache bookEditCache; - private final ChunkCache chunkCache; + private @org.checkerframework.checker.nullness.qual.NonNull final ChunkCache chunkCache; private final EntityCache entityCache; private final EntityEffectCache effectCache; private final FormCache formCache; @@ -1354,6 +1354,12 @@ public class GeyserSession implements GeyserConnection, GeyserCommandSource { return false; } + public void requestOffhandSwap() { + ServerboundPlayerActionPacket swapHandsPacket = new ServerboundPlayerActionPacket(PlayerAction.SWAP_HANDS, Vector3i.ZERO, + Direction.DOWN, 0); + sendDownstreamPacket(swapHandsPacket); + } + /** * Will be overwritten for GeyserConnect. */ diff --git a/core/src/main/java/org/geysermc/geyser/session/cache/LodestoneCache.java b/core/src/main/java/org/geysermc/geyser/session/cache/LodestoneCache.java index 05c2628df..41f73863e 100644 --- a/core/src/main/java/org/geysermc/geyser/session/cache/LodestoneCache.java +++ b/core/src/main/java/org/geysermc/geyser/session/cache/LodestoneCache.java @@ -73,8 +73,7 @@ public final class LodestoneCache { } } - for (Int2ObjectMap.Entry entry : this.lodestones.int2ObjectEntrySet()) { - LodestonePos pos = entry.getValue(); + for (LodestonePos pos : this.lodestones.values()) { if (pos.equals(x, y, z, dim)) { // Use this existing position instead this.activeLodestones.put(itemStack, pos); diff --git a/core/src/main/java/org/geysermc/geyser/translator/inventory/EnchantingInventoryTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/inventory/EnchantingInventoryTranslator.java index 97946b59c..8ae88c9bb 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/inventory/EnchantingInventoryTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/inventory/EnchantingInventoryTranslator.java @@ -43,6 +43,7 @@ import org.geysermc.geyser.inventory.updater.UIInventoryUpdater; import org.geysermc.geyser.session.GeyserSession; import java.util.Arrays; +import java.util.Locale; public class EnchantingInventoryTranslator extends AbstractBlockInventoryTranslator { public EnchantingInventoryTranslator() { @@ -71,7 +72,7 @@ public class EnchantingInventoryTranslator extends AbstractBlockInventoryTransla // The Bedrock index might need changed, so let's look it up and see. int bedrockIndex = value; if (bedrockIndex != -1) { - Enchantment enchantment = Enchantment.getByJavaIdentifier("minecraft:" + Enchantment.JavaEnchantment.of(bedrockIndex).name().toLowerCase()); + Enchantment enchantment = Enchantment.getByJavaIdentifier("minecraft:" + Enchantment.JavaEnchantment.of(bedrockIndex).name().toLowerCase(Locale.ROOT)); if (enchantment != null) { // Convert the Java enchantment index to Bedrock's bedrockIndex = enchantment.ordinal(); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockEmoteTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockEmoteTranslator.java index 43d2d314c..6be0be20f 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockEmoteTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockEmoteTranslator.java @@ -25,11 +25,8 @@ package org.geysermc.geyser.translator.protocol.bedrock.entity.player; -import com.github.steveice10.mc.protocol.data.game.entity.object.Direction; -import com.github.steveice10.mc.protocol.data.game.entity.player.PlayerAction; -import com.github.steveice10.mc.protocol.packet.ingame.serverbound.player.ServerboundPlayerActionPacket; -import com.nukkitx.math.vector.Vector3i; import com.nukkitx.protocol.bedrock.packet.EmotePacket; +import org.geysermc.geyser.api.event.bedrock.ClientEmoteEvent; import org.geysermc.geyser.configuration.EmoteOffhandWorkaroundOption; import org.geysermc.geyser.entity.type.Entity; import org.geysermc.geyser.session.GeyserSession; @@ -43,15 +40,20 @@ public class BedrockEmoteTranslator extends PacketTranslator { public void translate(GeyserSession session, EmotePacket packet) { if (session.getGeyser().getConfig().getEmoteOffhandWorkaround() != EmoteOffhandWorkaroundOption.DISABLED) { // Activate the workaround - we should trigger the offhand now - ServerboundPlayerActionPacket swapHandsPacket = new ServerboundPlayerActionPacket(PlayerAction.SWAP_HANDS, Vector3i.ZERO, - Direction.DOWN, 0); - session.sendDownstreamPacket(swapHandsPacket); + session.requestOffhandSwap(); if (session.getGeyser().getConfig().getEmoteOffhandWorkaround() == EmoteOffhandWorkaroundOption.NO_EMOTES) { return; } } + // For the future: could have a method that exposes which players will see the emote + ClientEmoteEvent event = new ClientEmoteEvent(session, packet.getEmoteId()); + session.getGeyser().eventBus().fire(event); + if (event.isCancelled()) { + return; + } + int javaId = session.getPlayerEntity().getEntityId(); for (GeyserSession otherSession : session.getGeyser().getSessionManager().getSessions().values()) { if (otherSession != session) { From 30277d54114de100175b20b4257a55314409723b Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Wed, 15 Feb 2023 16:17:38 -0500 Subject: [PATCH 3/6] Anticipate support for the patch version of 1.19.60 --- .../java/org/geysermc/geyser/network/GameProtocol.java | 4 ++++ .../org/geysermc/geyser/network/UpstreamPacketHandler.java | 7 +++++++ gradle/libs.versions.toml | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) 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 804187075..099a2305a 100644 --- a/core/src/main/java/org/geysermc/geyser/network/GameProtocol.java +++ b/core/src/main/java/org/geysermc/geyser/network/GameProtocol.java @@ -75,6 +75,10 @@ public final class GameProtocol { .minecraftVersion("1.19.50/1.19.51") .build()); SUPPORTED_BEDROCK_CODECS.add(Bedrock_v567.V567_CODEC); + // So the version checker will work + SUPPORTED_BEDROCK_CODECS.add(Bedrock_v567.V567_CODEC.toBuilder() + .protocolVersion(568) + .build()); } /** diff --git a/core/src/main/java/org/geysermc/geyser/network/UpstreamPacketHandler.java b/core/src/main/java/org/geysermc/geyser/network/UpstreamPacketHandler.java index a72d8ab9e..26c463bb0 100644 --- a/core/src/main/java/org/geysermc/geyser/network/UpstreamPacketHandler.java +++ b/core/src/main/java/org/geysermc/geyser/network/UpstreamPacketHandler.java @@ -31,6 +31,8 @@ import com.nukkitx.protocol.bedrock.data.ExperimentData; import com.nukkitx.protocol.bedrock.data.PacketCompressionAlgorithm; import com.nukkitx.protocol.bedrock.data.ResourcePackType; import com.nukkitx.protocol.bedrock.packet.*; +import com.nukkitx.protocol.bedrock.v567.Bedrock_v567; +import com.nukkitx.protocol.bedrock.v567.Bedrock_v567patch; import org.geysermc.geyser.Constants; import org.geysermc.geyser.GeyserImpl; import org.geysermc.geyser.api.network.AuthType; @@ -141,6 +143,11 @@ public class UpstreamPacketHandler extends LoggingPacketHandler { return true; } + // Hack for... whatever this is + if (loginPacket.getProtocolVersion() == Bedrock_v567.V567_CODEC.getProtocolVersion() && !session.getClientData().getGameVersion().equals("1.19.60")) { + session.getUpstream().getSession().setPacketCodec(Bedrock_v567patch.BEDROCK_V567PATCH); + } + PlayStatusPacket playStatus = new PlayStatusPacket(); playStatus.setStatus(PlayStatusPacket.Status.LOGIN_SUCCESS); session.sendUpstreamPacket(playStatus); diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 14ca47155..986fae748 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -8,7 +8,7 @@ netty = "4.1.80.Final" guava = "29.0-jre" gson = "2.3.1" # Provided by Spigot 1.8.8 websocket = "1.5.1" -protocol = "2.9.16-20230205.181702-1" +protocol = "2.9.16-20230215.204900-2" raknet = "1.6.28-20220125.214016-6" mcauthlib = "d9d773e" mcprotocollib = "1.19.3-20230107.194116-10" From 406dfcb22caf51f1cec3559e11599362e856192e Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Thu, 16 Feb 2023 20:01:51 -0500 Subject: [PATCH 4/6] Fix error on 1.19.62 --- .../java/org/geysermc/geyser/network/GameProtocol.java | 7 ++++--- gradle/libs.versions.toml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) 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 099a2305a..c76fd7b61 100644 --- a/core/src/main/java/org/geysermc/geyser/network/GameProtocol.java +++ b/core/src/main/java/org/geysermc/geyser/network/GameProtocol.java @@ -48,7 +48,7 @@ public final class GameProtocol { * Default Bedrock codec that should act as a fallback. Should represent the latest available * release of the game that Geyser supports. */ - public static final BedrockPacketCodec DEFAULT_BEDROCK_CODEC = Bedrock_v560.V560_CODEC; + public static final BedrockPacketCodec DEFAULT_BEDROCK_CODEC = Bedrock_v567.V567_CODEC; /** * A list of all supported Bedrock versions that can join Geyser */ @@ -71,13 +71,14 @@ public final class GameProtocol { SUPPORTED_BEDROCK_CODECS.add(Bedrock_v557.V557_CODEC.toBuilder() .minecraftVersion("1.19.40/1.19.41") .build()); - SUPPORTED_BEDROCK_CODECS.add(DEFAULT_BEDROCK_CODEC.toBuilder() + SUPPORTED_BEDROCK_CODECS.add(Bedrock_v560.V560_CODEC.toBuilder() .minecraftVersion("1.19.50/1.19.51") .build()); - SUPPORTED_BEDROCK_CODECS.add(Bedrock_v567.V567_CODEC); + SUPPORTED_BEDROCK_CODECS.add(DEFAULT_BEDROCK_CODEC); // So the version checker will work SUPPORTED_BEDROCK_CODECS.add(Bedrock_v567.V567_CODEC.toBuilder() .protocolVersion(568) + .minecraftVersion("1.19.62") .build()); } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 986fae748..f62faa54f 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -8,7 +8,7 @@ netty = "4.1.80.Final" guava = "29.0-jre" gson = "2.3.1" # Provided by Spigot 1.8.8 websocket = "1.5.1" -protocol = "2.9.16-20230215.204900-2" +protocol = "2.9.17-20230217.002312-1" raknet = "1.6.28-20220125.214016-6" mcauthlib = "d9d773e" mcprotocollib = "1.19.3-20230107.194116-10" From cfd7aeb927d0816a0d7943f370334ec6a876f16c Mon Sep 17 00:00:00 2001 From: Kas-tle <26531652+Kas-tle@users.noreply.github.com> Date: Fri, 17 Feb 2023 11:37:01 -0800 Subject: [PATCH 5/6] Update PR Build Action for API (#3535) * Use API from use making PR if exists * Update CONTRIBUTING.md * Address @Tim203's review * Fix path * Build the api before doing anything with the Geyser repo --------- Co-authored-by: Tim203 --- .github/workflows/pullrequest.yml | 41 ++++++++++++++++++++++++------- CONTRIBUTING.md | 4 ++- 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pullrequest.yml b/.github/workflows/pullrequest.yml index 39e9fe188..6781d7483 100644 --- a/.github/workflows/pullrequest.yml +++ b/.github/workflows/pullrequest.yml @@ -4,21 +4,44 @@ on: [pull_request] jobs: build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - name: Set up JDK 17 uses: actions/setup-java@v1 with: - distribution: 'temurin' java-version: 17 - cache: 'gradle' - - name: submodules-init - uses: snickerbockers/submodules-init@v4 - - name: Build with Gradle - run: ./gradlew build + distribution: temurin + cache: gradle + + - name: Check if the author has forked the API repo + uses: Kas-tle/ForkFinder@v1.0.1 + id: find_forks + with: + owner: GeyserMC + repo: api + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Use author's API repo if it exists + if: steps.find_forks.outputs.target_branch_found == 'true' + env: + API_FORK_URL: ${{ steps.find_forks.outputs.user_fork_url }} + API_FORK_BRANCH: ${{ github.event.pull_request.head.ref }} + run: | + git clone "${API_FORK_URL}" --single-branch --branch "${API_FORK_BRANCH}" api + cd api + ./gradlew publishToMavenLocal + + - name: Checkout repository and submodules + uses: actions/checkout@v3 + with: + submodules: recursive + path: geyser + + - name: Build Geyser + uses: gradle/gradle-build-action@v2 + with: + arguments: build + build-root-directory: geyser - name: Archive artifacts (Geyser Fabric) uses: actions/upload-artifact@v2 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ce6894845..dac8a9a07 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,4 +48,6 @@ Make sure to comment your code where possible. The nature of our software requires a lot of arrays and maps to be stored - where possible, use Fastutil's specialized maps. For example, if you're storing block state translations, use an `Int2IntMap`. -We have a rundown of all the tools you need to develop over on our [wiki](https://github.com/GeyserMC/Geyser/wiki/Developer-Guide). If you have any questions, please feel free to reach out to our [Discord](https://discord.gg/geysermc)! +We have a rundown of all the tools you need to develop over on our [wiki](https://wiki.geysermc.org/other/developer-guide/). If you have any questions, please feel free to reach out to our [Discord](https://discord.gg/geysermc)! + +If you're making a pull request that also depends on changes to [the base API](https://github.com/GeyserMC/api), simply fork the API repo and create a branch with the same name as your Geyser PR. The pull request [action](https://github.com/GeyserMC/Geyser/blob/master/.github/workflows/pullrequest.yml) will automatically use your API changes while building your changes to Geyser. \ No newline at end of file From e7b8b4ef29beec7d3696a3bd759df298286083ee Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Fri, 17 Feb 2023 18:55:40 -0500 Subject: [PATCH 6/6] Update supported versions in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b36235e36..6996086b9 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,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! -### Currently supporting Minecraft Bedrock 1.19.20 - 1.19.60 and Minecraft Java 1.19.3. +### Currently supporting Minecraft Bedrock 1.19.20 - 1.19.62 and Minecraft Java 1.19.3. ## Setting Up Take a look [here](https://wiki.geysermc.org/geyser/setup/) for how to set up Geyser.