From 23294484ded4e7b7994bc36d4f00444f0d8093ae Mon Sep 17 00:00:00 2001 From: rtm516 Date: Sun, 19 Mar 2023 15:08:51 +0000 Subject: [PATCH 01/11] Update downloads api publishing steps --- .github/workflows/build.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2d1c84670..0c88bf213 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -106,12 +106,16 @@ jobs: # Save the private key to a file echo "$DOWNLOADS_PRIVATE_KEY" > id_ecdsa chmod 600 id_ecdsa + # Set the project + project=geyser # Get the version from gradle.properties version=$(cat gradle.properties | grep -o "version=[0-9\\.]*" | cut -d"=" -f2) # Copy over artifacts - scp -B -o StrictHostKeyChecking=no -i id_ecdsa bootstrap/**/build/libs/Geyser-*.jar $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP:~/files/ + rsync -P -e "ssh -o StrictHostKeyChecking=no -i id_ecdsa" bootstrap/**/build/libs/Geyser-*.jar $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP:~/uploads/$project/$GITHUB_RUN_NUMBER/ # Run the build script - ssh -o StrictHostKeyChecking=no -i id_ecdsa $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP ./handleBuild.sh geyser $version $GITHUB_RUN_NUMBER $GITHUB_SHA + # Push the metadata + echo "{\"project\": \"$project\", \"version\": \"$version\", \"id\": $GITHUB_RUN_NUMBER, \"commit\": \"$GITHUB_SHA\"}" > metadata.json + rsync -P -e "ssh -o StrictHostKeyChecking=no -i id_ecdsa" metadata.json $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP:~/uploads/$project/$GITHUB_RUN_NUMBER/ - name: Notify Discord if: ${{ (success() || failure()) && github.repository == 'GeyserMC/Geyser' }} From b56f4016886a69c11a705b038ea0464e09d9b9a5 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Sun, 19 Mar 2023 11:24:45 -0400 Subject: [PATCH 02/11] Update MCProtocolLib to fix #3624 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7e8ddb2ad..a656f6b74 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,7 +11,7 @@ websocket = "1.5.1" protocol = "2.9.17-20230217.002312-1" raknet = "1.6.28-20220125.214016-6" mcauthlib = "d9d773e" -mcprotocollib = "1.19.4-20230317.173631-4" +mcprotocollib = "1.19.4-20230319.152208-5" adventure = "4.12.0-20220629.025215-9" adventure-platform = "4.1.2" junit = "5.9.2" From 021ffe2d946e270c170ebbd34c014fd6e80ffc87 Mon Sep 17 00:00:00 2001 From: David Choo <4722249+davchoo@users.noreply.github.com> Date: Sun, 19 Mar 2023 11:30:56 -0400 Subject: [PATCH 03/11] Update ringing bell block event logic (#3625) Check for BellValue instead of a GenericBlockValue Removes now unnecessary JAVA_BELL_ID from BlockStateValues --- .../geyser/level/block/BlockStateValues.java | 1 - .../registry/populator/BlockRegistryPopulator.java | 10 +--------- .../java/level/JavaBlockEventTranslator.java | 13 +++++++------ 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/level/block/BlockStateValues.java b/core/src/main/java/org/geysermc/geyser/level/block/BlockStateValues.java index 58cbce77f..c6fc60303 100644 --- a/core/src/main/java/org/geysermc/geyser/level/block/BlockStateValues.java +++ b/core/src/main/java/org/geysermc/geyser/level/block/BlockStateValues.java @@ -68,7 +68,6 @@ public final class BlockStateValues { public static final int JAVA_AIR_ID = 0; - public static int JAVA_BELL_ID; public static int JAVA_COBWEB_ID; public static int JAVA_FURNACE_ID; public static int JAVA_FURNACE_LIT_ID; diff --git a/core/src/main/java/org/geysermc/geyser/registry/populator/BlockRegistryPopulator.java b/core/src/main/java/org/geysermc/geyser/registry/populator/BlockRegistryPopulator.java index b931750e1..ad1066491 100644 --- a/core/src/main/java/org/geysermc/geyser/registry/populator/BlockRegistryPopulator.java +++ b/core/src/main/java/org/geysermc/geyser/registry/populator/BlockRegistryPopulator.java @@ -223,7 +223,6 @@ public final class BlockRegistryPopulator { Deque cleanIdentifiers = new ArrayDeque<>(); int javaRuntimeId = -1; - int bellBlockId = -1; int cobwebBlockId = -1; int furnaceRuntimeId = -1; int furnaceLitRuntimeId = -1; @@ -300,10 +299,7 @@ public final class BlockRegistryPopulator { // It's possible to only have this store differences in names, but the key set of all Java names is used in sending command suggestions BlockRegistries.JAVA_TO_BEDROCK_IDENTIFIERS.register(cleanJavaIdentifier.intern(), bedrockIdentifier.intern()); - if (javaId.startsWith("minecraft:bell[")) { - bellBlockId = uniqueJavaId; - - } else if (javaId.contains("cobweb")) { + if (javaId.contains("cobweb")) { cobwebBlockId = uniqueJavaId; } else if (javaId.startsWith("minecraft:furnace[facing=north")) { @@ -324,10 +320,6 @@ public final class BlockRegistryPopulator { slimeBlockRuntimeId = javaRuntimeId; } } - if (bellBlockId == -1) { - throw new AssertionError("Unable to find bell in palette"); - } - BlockStateValues.JAVA_BELL_ID = bellBlockId; if (cobwebBlockId == -1) { throw new AssertionError("Unable to find cobwebs in palette"); diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaBlockEventTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaBlockEventTranslator.java index 149e8356e..aa7c9e6e7 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaBlockEventTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/level/JavaBlockEventTranslator.java @@ -103,7 +103,7 @@ public class JavaBlockEventTranslator extends PacketTranslator 0; // north - case 4 -> 1; // east - case 5 -> 3;// west - default -> bellValue.getValue(); // south (2) is identical + int bedrockRingDirection = switch (bellValue.getDirection()) { + case SOUTH -> 0; + case WEST -> 1; + case NORTH -> 2; + case EAST -> 3; + default -> throw new IllegalStateException("Unexpected BellValue Direction: " + bellValue.getDirection()); }; builder.putInt("Direction", bedrockRingDirection); builder.putByte("Ringing", (byte) 1); From 775725c617acabdb8afc90b6134a2f0e128a4fcc Mon Sep 17 00:00:00 2001 From: rtm516 Date: Sun, 19 Mar 2023 17:09:18 +0000 Subject: [PATCH 04/11] Create the build directory when pushing to the api --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0c88bf213..668c9ca72 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -110,6 +110,8 @@ jobs: project=geyser # Get the version from gradle.properties version=$(cat gradle.properties | grep -o "version=[0-9\\.]*" | cut -d"=" -f2) + # Create the build folder + ssh -o StrictHostKeyChecking=no -i id_ecdsa $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP mkdir -p "~/uploads/$project/$GITHUB_RUN_NUMBER/" # Copy over artifacts rsync -P -e "ssh -o StrictHostKeyChecking=no -i id_ecdsa" bootstrap/**/build/libs/Geyser-*.jar $DOWNLOADS_USERNAME@$DOWNLOADS_SERVER_IP:~/uploads/$project/$GITHUB_RUN_NUMBER/ # Run the build script From b664bb961e925d955a74ddf75ef36fe3ee16cec9 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Sun, 19 Mar 2023 14:08:48 -0400 Subject: [PATCH 05/11] Indicate 1.19.71 support --- README.md | 2 +- .../main/java/org/geysermc/geyser/network/GameProtocol.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cfc99a8ba..013e87239 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.30 - 1.19.70 and Minecraft Java 1.19.4. +### Currently supporting Minecraft Bedrock 1.19.30 - 1.19.71 and Minecraft Java 1.19.4. ## Setting Up Take a look [here](https://wiki.geysermc.org/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 083bc5b58..8ce4fd196 100644 --- a/core/src/main/java/org/geysermc/geyser/network/GameProtocol.java +++ b/core/src/main/java/org/geysermc/geyser/network/GameProtocol.java @@ -49,7 +49,7 @@ public final class GameProtocol { */ public static final BedrockPacketCodec DEFAULT_BEDROCK_CODEC = Bedrock_v567patch.BEDROCK_V567PATCH.toBuilder() .protocolVersion(575) - .minecraftVersion("1.19.70") + .minecraftVersion("1.19.71") .build(); /** * A list of all supported Bedrock versions that can join Geyser @@ -77,7 +77,9 @@ public final class GameProtocol { .protocolVersion(568) .minecraftVersion("1.19.62") .build()); - SUPPORTED_BEDROCK_CODECS.add(DEFAULT_BEDROCK_CODEC); + SUPPORTED_BEDROCK_CODECS.add(DEFAULT_BEDROCK_CODEC.toBuilder() + .minecraftVersion("1.19.70/1.19.71") + .build()); } /** From b695dc075d5db6c6de3f5703a0dbfea317cd34af Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Sun, 19 Mar 2023 14:09:01 -0400 Subject: [PATCH 06/11] Fix command redirection detection --- .../translator/protocol/java/JavaCommandsTranslator.java | 7 ++++--- gradle/libs.versions.toml | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaCommandsTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaCommandsTranslator.java index 24a52600a..5b009b81c 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaCommandsTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/java/JavaCommandsTranslator.java @@ -199,9 +199,10 @@ public class JavaCommandsTranslator extends PacketTranslator= 1) { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index a656f6b74..4f7433034 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,7 +11,7 @@ websocket = "1.5.1" protocol = "2.9.17-20230217.002312-1" raknet = "1.6.28-20220125.214016-6" mcauthlib = "d9d773e" -mcprotocollib = "1.19.4-20230319.152208-5" +mcprotocollib = "1.19.4-20230319.175814-6" adventure = "4.12.0-20220629.025215-9" adventure-platform = "4.1.2" junit = "5.9.2" From 4a20bbad88f968bd9055b081df95c67924dead19 Mon Sep 17 00:00:00 2001 From: Redned Date: Sun, 19 Mar 2023 15:24:52 -0500 Subject: [PATCH 07/11] Update README with new download link --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 013e87239..77e2671f9 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,6 @@ Geyser -[![forthebadge made-with-java](https://forthebadge.com/images/badges/made-with-java.svg)](https://java.com/) - [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) -[![Build Status](https://ci.opencollab.dev/job/Geyser/job/master/badge/icon)](https://ci.opencollab.dev/job/GeyserMC/job/Geyser/job/master/) [![Discord](https://img.shields.io/discord/613163671870242838.svg?color=%237289da&label=discord)](https://discord.gg/geysermc) [![Crowdin](https://badges.crowdin.net/geyser/localized.svg)](https://translate.geysermc.org/) @@ -27,7 +24,7 @@ Take a look [here](https://wiki.geysermc.org/geyser/setup/) for how to set up Ge ## Links: - Website: https://geysermc.org - Docs: https://wiki.geysermc.org/geyser/ -- Download: https://ci.geysermc.org +- Download: https://geysermc.org/download - Discord: https://discord.gg/geysermc - Donate: https://opencollective.com/geysermc - Test Server: `test.geysermc.org` port `25565` for Java and `19132` for Bedrock From 05829eeed8daadd8e779ad50f3d89879f196f81a Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Mon, 20 Mar 2023 13:04:53 -0400 Subject: [PATCH 08/11] Upload Fabric platform to Modrinth --- .github/workflows/publish.yml | 16 ++++++++++++++++ bootstrap/fabric/build.gradle.kts | 19 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..2b5bea7df --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,16 @@ +name: publish + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: gradle/wrapper-validation-action@v1 + - uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: 17 + - name: build and publish + env: + MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} + run: ./gradlew fabric:modrinth \ No newline at end of file diff --git a/bootstrap/fabric/build.gradle.kts b/bootstrap/fabric/build.gradle.kts index 743b75a26..890f5d656 100644 --- a/bootstrap/fabric/build.gradle.kts +++ b/bootstrap/fabric/build.gradle.kts @@ -1,5 +1,6 @@ plugins { id("fabric-loom") version "1.0-SNAPSHOT" + id("com.modrinth.minotaur") version "2.+" } java { @@ -74,4 +75,22 @@ tasks { archiveClassifier.set("") archiveVersion.set("") } +} + +modrinth { + projectId.set("wKkoqHrH") + versionNumber.set(project.version as String + "-" + System.getenv("GITHUB_RUN_NUMBER")) + versionType.set("beta") + changelog.set("A changelog can be found at https://github.com/GeyserMC/Geyser/commits") + + syncBodyFrom.set(rootProject.file("README.md").readText()) + + uploadFile.set(tasks.getByPath("remapJar")) + gameVersions.addAll("1.19", "1.19.1", "1.19.2", "1.19.3", "1.19.4") + + loaders.add("fabric") + + dependencies { + required.project("fabric-api") + } } \ No newline at end of file From 66005edcc6c9015b75325fba8978cd182c587bab Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Mon, 20 Mar 2023 13:08:07 -0400 Subject: [PATCH 09/11] Actually run it --- .github/workflows/publish.yml | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2b5bea7df..04712681d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,17 @@ -name: publish +name: Publish +on: + workflow_dispatch: + push: + paths-ignore: + - '.github/ISSUE_TEMPLATE/*.yml' + - '.github/actions/pullrequest.yml' + - '.idea/copyright/*.xml' + - '.gitignore' + - 'CONTRIBUTING.md' + - 'LICENSE' + - 'Jenkinsfile ' + - 'README.md' + - 'licenseheader.txt' jobs: build: @@ -10,7 +23,7 @@ jobs: with: distribution: 'temurin' java-version: 17 - - name: build and publish + - name: Publish to Modrinth env: MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} run: ./gradlew fabric:modrinth \ No newline at end of file From 775e1e8921bd08b2d7f68ce67935b7d63685f3c5 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Mon, 20 Mar 2023 13:32:02 -0400 Subject: [PATCH 10/11] Modrinth: submodules exist too --- .github/workflows/publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 04712681d..2b002b0de 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,6 +18,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + with: + submodules: recursive - uses: gradle/wrapper-validation-action@v1 - uses: actions/setup-java@v3 with: From 7ef005006b76875fcc7bca3c670b69bd544a4112 Mon Sep 17 00:00:00 2001 From: Camotoy <20743703+Camotoy@users.noreply.github.com> Date: Tue, 21 Mar 2023 15:07:51 -0400 Subject: [PATCH 11/11] Safety null check for dismount check code --- .../player/BedrockInteractTranslator.java | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockInteractTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockInteractTranslator.java index 22a895465..93d0c4a83 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockInteractTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/protocol/bedrock/entity/player/BedrockInteractTranslator.java @@ -79,21 +79,23 @@ public class BedrockInteractTranslator extends PacketTranslator session.sendDownstreamPacket(sneakPacket); Entity currentVehicle = session.getPlayerEntity().getVehicle(); - session.setMountVehicleScheduledFuture(session.scheduleInEventLoop(() -> { - if (session.getPlayerEntity().getVehicle() == null) { - return; - } + if (currentVehicle != null) { + session.setMountVehicleScheduledFuture(session.scheduleInEventLoop(() -> { + if (session.getPlayerEntity().getVehicle() == null) { + return; + } - long vehicleBedrockId = currentVehicle.getGeyserId(); - if (session.getPlayerEntity().getVehicle().getGeyserId() == vehicleBedrockId) { - // The Bedrock client, as of 1.19.51, dismounts on its end. The server may not agree with this. - // If the server doesn't agree with our dismount (sends a packet saying we dismounted), - // then remount the player. - SetEntityLinkPacket linkPacket = new SetEntityLinkPacket(); - linkPacket.setEntityLink(new EntityLinkData(vehicleBedrockId, session.getPlayerEntity().getGeyserId(), EntityLinkData.Type.PASSENGER, true, false)); - session.sendUpstreamPacket(linkPacket); - } - }, 1, TimeUnit.SECONDS)); + long vehicleBedrockId = currentVehicle.getGeyserId(); + if (session.getPlayerEntity().getVehicle().getGeyserId() == vehicleBedrockId) { + // The Bedrock client, as of 1.19.51, dismounts on its end. The server may not agree with this. + // If the server doesn't agree with our dismount (sends a packet saying we dismounted), + // then remount the player. + SetEntityLinkPacket linkPacket = new SetEntityLinkPacket(); + linkPacket.setEntityLink(new EntityLinkData(vehicleBedrockId, session.getPlayerEntity().getGeyserId(), EntityLinkData.Type.PASSENGER, true, false)); + session.sendUpstreamPacket(linkPacket); + } + }, 1, TimeUnit.SECONDS)); + } break; case MOUSEOVER: // Handle the buttons for mobile - "Mount", etc; and the suggestions for console - "ZL: Mount", etc