Skip to content

Commit 5636c7e

Browse files
committed
Merge remote-tracking branch 'upstream/master' into fix/protocol
2 parents 85c5682 + 1bca642 commit 5636c7e

File tree

15 files changed

+169
-89
lines changed

15 files changed

+169
-89
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,40 @@
1-
name: Build Pull Request
1+
name: Build Remote
22

3-
on:
4-
pull_request:
5-
merge_group:
3+
on:
4+
workflow_call:
5+
inputs:
6+
repository:
7+
required: true
8+
description: 'The repo of the remote'
9+
type: string
10+
ref:
11+
required: true
12+
description: 'The ref of the remote'
13+
type: string
14+
15+
permissions: {}
616

717
jobs:
818
build:
919
runs-on: ubuntu-latest
1020
steps:
21+
- name: Set Build Number
22+
run: |
23+
echo "BUILD_NUMBER=${GITHUB_RUN_NUMBER}" >> $GITHUB_ENV
24+
1125
- name: Set up JDK 17
1226
# See https://github.com/actions/setup-java/commits
1327
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
1428
with:
1529
java-version: 17
1630
distribution: temurin
1731

18-
- name: Check if the author has forked the API repo
19-
# See https://github.com/Kas-tle/find-forks-action/commits
20-
uses: Kas-tle/find-forks-action@1b5447d1e3c7a8ed79583dd817cc5399686eed3a
21-
id: find_forks
22-
with:
23-
owner: GeyserMC
24-
repo: api
25-
token: ${{ secrets.GITHUB_TOKEN }}
26-
27-
- name: Use author's API repo if it exists
28-
if: ${{ steps.find_forks.outputs.target_branch_found == 'true' }}
29-
env:
30-
API_FORK_URL: ${{ steps.find_forks.outputs.user_fork_url }}
31-
API_FORK_BRANCH: ${{ github.event.pull_request.head.ref }}
32-
run: |
33-
git clone "${API_FORK_URL}" --single-branch --branch "${API_FORK_BRANCH}" api
34-
cd api
35-
./gradlew publishToMavenLocal
36-
3732
- name: Checkout repository and submodules
3833
# See https://github.com/actions/checkout/commits
3934
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
4035
with:
36+
repository: ${{ inputs.repository }}
37+
ref: ${{ inputs.ref }}
4138
submodules: recursive
4239
path: geyser
4340

@@ -46,11 +43,12 @@ jobs:
4643
uses: gradle/wrapper-validation-action@699bb18358f12c5b78b37bb0111d3a0e2276e0e2 # v2.1.1
4744

4845
- name: Build Geyser
49-
# See https://github.com/gradle/gradle-build-action/commits
50-
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 from https://github.com/gradle/actions/commits
46+
# See https://github.com/gradle/actions/commits
47+
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
5148
with:
5249
arguments: build
5350
build-root-directory: geyser
51+
cache-read-only: true
5452

5553
- name: Archive artifacts (Geyser Fabric)
5654
# See https://github.com/actions/upload-artifact/commits
@@ -101,22 +99,4 @@ jobs:
10199
with:
102100
name: Geyser ViaProxy
103101
path: geyser/bootstrap/viaproxy/build/libs/Geyser-ViaProxy.jar
104-
if-no-files-found: error
105-
106-
- name: Trigger Preview Deployment
107-
if: >-
108-
contains(github.event.pull_request.labels.*.name, 'PR: Needs Testing')
109-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea
110-
with:
111-
script: |
112-
github.rest.actions.createWorkflowDispatch({
113-
owner: context.repo.owner,
114-
repo: context.repo.repo,
115-
workflow_id: 'preview.yml',
116-
ref: 'master',
117-
inputs: {
118-
runId: '${{ github.run_id }}',
119-
build: '${{ github.run_number }}',
120-
version: 'pr.${{ github.event.pull_request.number }}'
121-
}
122-
});
102+
if-no-files-found: error

.github/workflows/build.yml

+16-6
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ on:
77
- 'gh-readonly-queue/**'
88
paths-ignore:
99
- '.github/ISSUE_TEMPLATE/*.yml'
10-
- '.github/actions/pullrequest.yml'
11-
- '.github/actions/preview.yml'
10+
- '.github/actions/workflows/build-remote.yml'
11+
- '.github/actions/workflows/preview.yml'
12+
- '.github/actions/workflows/pull-request.yml'
1213
- '.idea/copyright/*.xml'
1314
- '.gitignore'
1415
- 'CONTRIBUTING.md'
@@ -23,6 +24,13 @@ jobs:
2324
env:
2425
PROJECT: 'geyser'
2526
steps:
27+
- name: Set Build Number
28+
env:
29+
BUILD_JSON: ${{ vars.RELEASEACTION_PREVRELEASE }}
30+
run: |
31+
BUILD_NUMBER=$(echo $BUILD_JSON | jq --arg branch "${GITHUB_REF_NAME}" 'if .[$branch] == null then 1 else .[$branch] | .t | tonumber + 1 end // 1')
32+
echo "BUILD_NUMBER=${BUILD_NUMBER}" >> $GITHUB_ENV
33+
2634
- name: Checkout repository and submodules
2735
# See https://github.com/actions/checkout/commits
2836
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
@@ -40,8 +48,8 @@ jobs:
4048
distribution: temurin
4149

4250
- name: Build
43-
# See https://github.com/gradle/gradle-build-action/commits
44-
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 from https://github.com/gradle/actions/commits
51+
# See https://github.com/gradle/actions/commits
52+
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
4553
with:
4654
arguments: build
4755
gradle-home-cache-cleanup: true
@@ -108,7 +116,8 @@ jobs:
108116

109117
- name: Get Release Metadata
110118
if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }}
111-
uses: Kas-tle/base-release-action@b863fa0f89bd15267a96a72efb84aec25f168d4c # https://github.com/Kas-tle/base-release-action/releases/tag/main-11
119+
# See https://github.com/Kas-tle/base-release-action/releases/tag/main-11
120+
uses: Kas-tle/base-release-action@b863fa0f89bd15267a96a72efb84aec25f168d4c # main-11
112121
with:
113122
appID: ${{ secrets.RELEASE_APP_ID }}
114123
appPrivateKey: ${{ secrets.RELEASE_APP_PK }}
@@ -134,6 +143,7 @@ jobs:
134143
| .downloads |= map_values({"name", "sha256"})
135144
| {$project, "repo", $version, "number": .build, "changes", "downloads"}
136145
' | tee metadata.json
146+
echo
137147
- name: Publish to Downloads API
138148
if: ${{ success() && github.repository == 'GeyserMC/Geyser' && github.ref_name == 'master' }}
139149
shell: bash
@@ -177,4 +187,4 @@ jobs:
177187
uses: Tim203/actions-git-discord-webhook@70f38ded3aca51635ec978ab4e1a58cd4cd0c2ff
178188
with:
179189
webhook_url: ${{ secrets.DISCORD_WEBHOOK }}
180-
status: ${{ job.status }}
190+
status: ${{ job.status }}

.github/workflows/preview.yml

+26-5
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,44 @@ on:
1212
version:
1313
required: true
1414
description: 'Version under which to upload to the Downloads API'
15+
workflow_call:
16+
inputs:
17+
build:
18+
required: true
19+
description: 'Build number for the release'
20+
type: string
21+
version:
22+
required: true
23+
description: 'Version under which to upload to the Downloads API'
24+
type: string
1525

1626
jobs:
1727
upload:
1828
runs-on: ubuntu-latest
1929
env:
2030
PROJECT: 'geyserpreview'
21-
BUILD: ${{ github.event.inputs.build }}
22-
VERSION: ${{ github.event.inputs.version }}
2331
steps:
24-
- uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # https://github.com/actions/download-artifact/releases/tag/v4.1.4
32+
- name: Set Variables
33+
id: setvars
34+
run: |
35+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
36+
echo "BUILD=${{ github.event.inputs.build }}" >> $GITHUB_ENV
37+
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
38+
echo "RUN=${{ github.event.inputs.runId }}" >> $GITHUB_OUTPUT
39+
else
40+
echo "BUILD=${{ inputs.build }}" >> $GITHUB_ENV
41+
echo "VERSION=${{ inputs.version }}" >> $GITHUB_ENV
42+
echo "RUN=${{ github.run_id }}" >> $GITHUB_OUTPUT
43+
fi
44+
- uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427
2545
with:
26-
run-id: ${{ github.event.inputs.runId }}
46+
run-id: ${{ steps.setvars.outputs.RUN }}
2747
github-token: ${{ secrets.GITHUB_TOKEN }}
2848
merge-multiple: true
2949
- name: Get Preview Metadata
3050
if: success()
31-
uses: Kas-tle/base-release-action@b863fa0f89bd15267a96a72efb84aec25f168d4c # https://github.com/Kas-tle/base-release-action/releases/tag/main-11
51+
# See https://github.com/Kas-tle/base-release-action/releases/tag/main-11
52+
uses: Kas-tle/base-release-action@664c39985eb9d0d393ce98e7eb8414d3d98e762a # main-11
3253
with:
3354
appID: ${{ secrets.RELEASE_APP_ID }}
3455
appPrivateKey: ${{ secrets.RELEASE_APP_PK }}

.github/workflows/pull-request.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Process Pull Request
2+
3+
on:
4+
pull_request_target:
5+
6+
jobs:
7+
build:
8+
# Forbid access to secrets nor GH Token perms while building the PR
9+
permissions: {}
10+
secrets: {}
11+
uses: ./.github/workflows/build-remote.yml
12+
with:
13+
repository: ${{ github.event.pull_request.head.repo.full_name }}
14+
ref: ${{ github.event.pull_request.head.sha }}
15+
preview:
16+
needs: [build]
17+
if: >-
18+
contains(github.event.pull_request.labels.*.name, 'PR: Needs Testing')
19+
# Allow access to secrets if we are uploading a preview
20+
secrets: inherit
21+
uses: ./.github/workflows/preview.yml
22+
with:
23+
build: ${{ github.run_number }}
24+
version: pr.${{ github.event.pull_request.number }}

bootstrap/bungeecord/build.gradle.kts

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
2222

2323
dependencies {
2424
exclude(dependency("com.google.*:.*"))
25+
exclude(dependency("io.netty.incubator:.*"))
2526
exclude(dependency("io.netty:netty-transport-native-epoll:.*"))
2627
exclude(dependency("io.netty:netty-transport-native-unix-common:.*"))
2728
exclude(dependency("io.netty:netty-handler:.*"))

bootstrap/spigot/build.gradle.kts

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
4141

4242
// We cannot shade Netty, or else native libraries will not load
4343
// Needed because older Spigot builds do not provide the haproxy module
44+
exclude(dependency("io.netty.incubator:.*"))
4445
exclude(dependency("io.netty:netty-transport-classes-epoll:.*"))
4546
exclude(dependency("io.netty:netty-transport-native-epoll:.*"))
4647
exclude(dependency("io.netty:netty-transport-native-unix-common:.*"))

bootstrap/velocity/build.gradle.kts

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ platformRelocate("org.yaml")
1212

1313
exclude("com.google.*:*")
1414

15-
// Needed because Velocity provides every dependency except netty-resolver-dns
15+
// Needed because Velocity provides every dependency except netty-resolver-dns
16+
exclude("io.netty.incubator:.*")
1617
exclude("io.netty:netty-transport-native-epoll:*")
1718
exclude("io.netty:netty-transport-native-unix-common:*")
1819
exclude("io.netty:netty-transport-native-kqueue:*")
@@ -57,6 +58,7 @@ tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
5758
exclude(dependency("io.netty:netty-transport:.*"))
5859
exclude(dependency("io.netty:netty-codec:.*"))
5960
exclude(dependency("io.netty:netty-codec-haproxy:.*"))
61+
exclude(dependency("io.netty.incubator:.*"))
6062
exclude(dependency("org.slf4j:.*"))
6163
exclude(dependency("org.ow2.asm:.*"))
6264
// Exclude all Kyori dependencies except the legacy NBT serializer

bootstrap/viaproxy/build.gradle.kts

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
2222
dependencies {
2323
exclude(dependency("com.google.*:.*"))
2424
exclude(dependency("io.netty:.*"))
25+
exclude(dependency("io.netty.incubator:.*"))
2526
exclude(dependency("org.slf4j:.*"))
2627
exclude(dependency("org.ow2.asm:.*"))
2728
}

build-logic/src/main/kotlin/geyser.modded-conventions.gradle.kts

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ provided("io.netty", "netty-transport-native-epoll")
2626
provided("io.netty", "netty-transport-native-unix-common")
2727
provided("io.netty", "netty-transport-classes-kqueue")
2828
provided("io.netty", "netty-transport-native-kqueue")
29+
provided("io.netty.incubator", "netty-incubator-transport-native-io_uring")
30+
provided("io.netty.incubator", "netty-incubator-transport-classes-io_uring")
2931
provided("io.netty", "netty-handler")
3032
provided("io.netty", "netty-common")
3133
provided("io.netty", "netty-buffer")

core/build.gradle.kts

+3-9
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ dependencies {
4747
implementation(libs.netty.transport.native.epoll) { artifact { classifier = "linux-x86_64" } }
4848
implementation(libs.netty.transport.native.epoll) { artifact { classifier = "linux-aarch_64" } }
4949
implementation(libs.netty.transport.native.kqueue) { artifact { classifier = "osx-x86_64" } }
50+
implementation(libs.netty.transport.native.io.uring) { artifact { classifier = "linux-x86_64" } }
51+
implementation(libs.netty.transport.native.io.uring) { artifact { classifier = "linux-aarch_64" } }
5052

5153
// Adventure text serialization
5254
api(libs.bundles.adventure)
@@ -66,11 +68,6 @@ dependencies {
6668
api(libs.events)
6769
}
6870

69-
configurations.api {
70-
// This is still experimental - additionally, it could only really benefit standalone
71-
exclude(group = "io.netty.incubator", module = "netty-incubator-transport-native-io_uring")
72-
}
73-
7471
tasks.processResources {
7572
// This is solely for backwards compatibility for other programs that used this file before the switch to gradle.
7673
// It used to be generated by the maven Git-Commit-Id-Plugin
@@ -101,7 +98,7 @@ configure<BlossomExtension> {
10198
}
10299

103100
fun Project.buildNumber(): Int =
104-
(System.getenv("GITHUB_RUN_NUMBER") ?: jenkinsBuildNumber())?.let { Integer.parseInt(it) } ?: -1
101+
(System.getenv("BUILD_NUMBER"))?.let { Integer.parseInt(it) } ?: -1
105102

106103
inner class GitInfo {
107104
val branch: String
@@ -134,9 +131,6 @@ inner class GitInfo {
134131
}
135132
}
136133

137-
// todo remove this when we're not using Jenkins anymore
138-
fun jenkinsBuildNumber(): String? = System.getenv("BUILD_NUMBER")
139-
140134
// Manual task to download the bedrock data files from the CloudburstMC/Data repository
141135
// Invoke with ./gradlew :core:downloadBedrockData --suffix=1_20_70
142136
// Set suffix to the current Bedrock version

core/src/main/java/org/geysermc/geyser/entity/type/living/animal/tameable/CatEntity.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
public class CatEntity extends TameableEntity {
4747

48-
private byte collarColor;
48+
private byte collarColor = 14; // Red - default
4949

5050
public CatEntity(GeyserSession session, int entityId, long geyserId, UUID uuid, EntityDefinition<?> definition, Vector3f position, Vector3f motion, float yaw, float pitch, float headYaw) {
5151
super(session, entityId, geyserId, uuid, definition, position, motion, yaw, pitch, headYaw);
@@ -76,10 +76,7 @@ protected float getBabySize() {
7676
@Override
7777
public void setTameableFlags(ByteEntityMetadata entityMetadata) {
7878
super.setTameableFlags(entityMetadata);
79-
// Update collar color if tamed
80-
if (getFlag(EntityFlag.TAMED)) {
81-
dirtyMetadata.put(EntityDataTypes.COLOR, collarColor);
82-
}
79+
updateCollarColor();
8380
}
8481

8582
public void setCatVariant(IntEntityMetadata entityMetadata) {
@@ -101,6 +98,10 @@ public void setResting(BooleanEntityMetadata entityMetadata) {
10198

10299
public void setCollarColor(IntEntityMetadata entityMetadata) {
103100
collarColor = (byte) entityMetadata.getPrimitiveValue();
101+
updateCollarColor();
102+
}
103+
104+
private void updateCollarColor() {
104105
// Needed or else wild cats are a red color
105106
if (getFlag(EntityFlag.TAMED)) {
106107
dirtyMetadata.put(EntityDataTypes.COLOR, collarColor);

0 commit comments

Comments
 (0)