Skip to content

Commit 9f4608e

Browse files
authored
Merge pull request #26 from GeyserMC/rewrite
Rewrite: Let's make this a plugin
2 parents 4b10b9e + acf0853 commit 9f4608e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1335
-1926
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818

1919
- uses: actions/setup-java@v3
2020
with:
21-
java-version: 17
21+
java-version: 21
2222
distribution: temurin
2323

2424
- name: Build
@@ -27,23 +27,12 @@ jobs:
2727
arguments: build
2828
cache-read-only: ${{ github.ref_name != 'master' && github.ref_name != 'development' }}
2929

30-
- name: Build image
31-
if: ${{ github.repository == 'GeyserMC/GlobalLinkServer' && github.ref_name == 'master' }}
32-
run: docker build . -t $IMAGE_NAME --label "run-number=${GITHUB_RUN_ID}"
33-
- name: Registry login
34-
if: ${{ github.repository == 'GeyserMC/GlobalLinkServer' && github.ref_name == 'master' }}
35-
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
36-
- name: Push image
37-
if: ${{ github.repository == 'GeyserMC/GlobalLinkServer' && github.ref_name == 'master' }}
38-
run: |
39-
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
40-
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
41-
VERSION=latest
42-
43-
echo IMAGE_ID=$IMAGE_ID
44-
echo VERSION=$VERSION
45-
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
46-
docker push $IMAGE_ID:$VERSION
30+
- name: Archive Artifacts
31+
uses: GeyserMC/actions/upload-multi-artifact@master
32+
if: success()
33+
with:
34+
artifacts: |
35+
GlobalLinkPlugin:build/libs/GlobalLinkPlugin.jar
4736
4837
- name: Notify Discord
4938
if: ${{ (success() || failure()) && github.repository == 'GeyserMC/GlobalLinkServer' }}

Dockerfile

Lines changed: 0 additions & 6 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License
22

3-
Copyright (c) 2021-2024 GeyserMC
3+
Copyright (c) 2021-2025 GeyserMC
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# GlobalLinkServer Plugin
2+
3+
> [!IMPORTANT]
4+
> This repo contains the code for the Geyser Global Linking Server plugin.
5+
> If you want to just link your account, join link.geysermc.org on Minecraft Java or Bedrock.
6+
> For more information visit https://link.geysermc.org/
7+
8+
### `server.properties`
9+
```properties
10+
allow-nether=false
11+
generate-structures=false
12+
generator-settings={"biome"\:"minecraft\:the_void","layers"\:[{"block"\:"minecraft\:air","height"\:1}]}
13+
level-type=minecraft\:flat
14+
spawn-protection=200
15+
```
16+
17+
### `spigot.yml`
18+
```yaml
19+
commands:
20+
send-namespaced: false
21+
```
22+
23+
24+
### `bukkit.yml`
25+
```yaml
26+
settings:
27+
allow-end: false
28+
```
29+

build.gradle.kts

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,22 @@
11
plugins {
2-
application
32
alias(libs.plugins.indra)
43
alias(libs.plugins.indra.licenser.spotless)
4+
alias(libs.plugins.paperweight)
5+
alias(libs.plugins.runpaper)
56
}
67

78
group = "org.geysermc.globallinkserver"
89

910
dependencies {
10-
implementation(libs.gson) // newer version required for record support
11-
implementation(libs.fastutil.common)
11+
paperweight.paperDevBundle("1.21.4-R0.1-SNAPSHOT")
1212

13-
implementation(libs.bundles.protocol)
14-
implementation(libs.mcprotocollib) {
15-
exclude("io.netty", "netty-all")
16-
}
17-
18-
// mcprotocollib won't work without this
19-
implementation(libs.netty.handler)
20-
21-
implementation(libs.adventure.text.legacy)
13+
compileOnly(libs.floodgate.api)
2214
implementation(libs.mariadb.client)
15+
implementation(libs.bundles.fastutil)
2316

2417
compileOnly(libs.checker.qual)
2518
}
2619

27-
application {
28-
mainClass.set("org.geysermc.globallinkserver.GlobalLinkServer")
29-
}
30-
3120
indra {
3221
github("GeyserMC", "GlobalLinkServer") {
3322
ci(true)
@@ -38,27 +27,39 @@ indra {
3827
mitLicense()
3928

4029
javaVersions {
41-
target(17)
30+
target(21)
4231
}
4332

4433
spotless {
4534
java {
46-
palantirJavaFormat()
35+
// Broken until paperweight updates to a newer version of spotless (6.23.3+)
36+
// palantirJavaFormat()
4737
formatAnnotations()
4838
}
4939
ratchetFrom("origin/master")
5040
}
5141
}
5242

43+
repositories {
44+
mavenLocal()
45+
46+
maven("https://repo.opencollab.dev/main")
47+
maven("https://repo.papermc.io/repository/maven-public/")
48+
49+
mavenCentral()
50+
51+
maven("https://jitpack.io") {
52+
content { includeGroupByRegex("com\\.github\\..*") }
53+
}
54+
}
55+
56+
paperweight.reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION
57+
5358
tasks.jar {
5459
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
5560
from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
5661

57-
archiveBaseName = "GlobalLinkServer"
62+
archiveBaseName = "GlobalLinkPlugin"
5863
archiveVersion = ""
5964
archiveClassifier = ""
60-
61-
manifest {
62-
attributes["Main-Class"] = application.mainClass
63-
}
6465
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=1.0-SNAPSHOT
1+
version=2.0-SNAPSHOT

gradle/libs.versions.toml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,30 @@
11
[versions]
2-
gson = "2.10.1"
3-
protocol = "3.0.0.Beta5-20241022.154658-14"
4-
netty = "4.1.110.Final"
5-
fastutil = "8.5.2"
6-
mcprotocollib = "86903ec" # Revert from jitpack after release
7-
adventure-text = "4.15.0-20231207.074016-23" # Match version to MCPL
2+
floodgate = "2.2.3-SNAPSHOT"
83
mariadb-client = "2.7.3"
4+
fastutil = "8.5.2"
95
checker-qual = "3.21.1"
6+
107
indra = "3.1.2"
8+
paperweight = "2.0.0-beta.12"
9+
runpaper = "2.3.1"
1110

1211
[libraries]
13-
gson = { module = "com.google.code.gson:gson", version.ref = "gson" }
14-
protocol-codec = { module = "org.cloudburstmc.protocol:bedrock-codec", version.ref = "protocol" }
15-
protocol-connection = { module = "org.cloudburstmc.protocol:bedrock-connection", version.ref = "protocol" }
16-
protocol-common = { module = "org.cloudburstmc.protocol:common", version.ref = "protocol" }
17-
18-
netty-handler = { group = "io.netty", name = "netty-handler", version.ref = "netty" }
19-
20-
fastutil-common = { module = "com.nukkitx.fastutil:fastutil-common", version.ref = "fastutil" }
21-
mcprotocollib = { module = "com.github.GeyserMC:mcprotocollib", version.ref = "mcprotocollib" }
22-
adventure-text-legacy = { module = "net.kyori:adventure-text-serializer-legacy", version.ref = "adventure-text" }
12+
floodgate-api = { group = "org.geysermc.floodgate", name = "api", version.ref = "floodgate" }
2313
mariadb-client = { module = "org.mariadb.jdbc:mariadb-java-client", version.ref = "mariadb-client" }
2414

15+
fastutil-int-int-maps = { group = "com.nukkitx.fastutil", name = "fastutil-int-int-maps", version.ref = "fastutil" }
16+
fastutil-int-object-maps = { group = "com.nukkitx.fastutil", name = "fastutil-int-object-maps", version.ref = "fastutil" }
17+
fastutil-object-int-maps = { group = "com.nukkitx.fastutil", name = "fastutil-object-int-maps", version.ref = "fastutil" }
18+
fastutil-object-object-maps = { group = "com.nukkitx.fastutil", name = "fastutil-object-object-maps", version.ref = "fastutil" }
19+
2520
checker-qual = { module = "org.checkerframework:checker-qual", version.ref = "checker-qual" }
2621

2722
[plugins]
2823
indra = { id = "net.kyori.indra", version.ref = "indra" }
2924
indra-publishing = { id = "net.kyori.indra.publishing", version.ref = "indra" }
3025
indra-licenser-spotless = { id = "net.kyori.indra.licenser.spotless", version.ref = "indra" }
26+
paperweight = { id = "io.papermc.paperweight.userdev", version.ref = "paperweight" }
27+
runpaper = { id = "xyz.jpenilla.run-paper", version.ref = "runpaper" }
3128

3229
[bundles]
33-
protocol = ["protocol-codec", "protocol-connection", "protocol-common"]
30+
fastutil = [ "fastutil-int-int-maps", "fastutil-int-object-maps", "fastutil-object-int-maps", "fastutil-object-object-maps" ]

gradle/wrapper/gradle-wrapper.jar

-19.3 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -55,7 +57,7 @@
5557
# Darwin, MinGW, and NonStop.
5658
#
5759
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5961
# within the Gradle project.
6062
#
6163
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -83,7 +85,9 @@ done
8385
# This is normally unused
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
86-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
88+
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90+
' "$PWD" ) || exit
8791

8892
# Use the maximum available, or set MAX_FD != -1 to use that value.
8993
MAX_FD=maximum
@@ -144,15 +148,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144148
case $MAX_FD in #(
145149
max*)
146150
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147-
# shellcheck disable=SC3045
151+
# shellcheck disable=SC2039,SC3045
148152
MAX_FD=$( ulimit -H -n ) ||
149153
warn "Could not query maximum file descriptor limit"
150154
esac
151155
case $MAX_FD in #(
152156
'' | soft) :;; #(
153157
*)
154158
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155-
# shellcheck disable=SC3045
159+
# shellcheck disable=SC2039,SC3045
156160
ulimit -n "$MAX_FD" ||
157161
warn "Could not set maximum file descriptor limit to $MAX_FD"
158162
esac
@@ -201,11 +205,11 @@ fi
201205
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
202206
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
203207

204-
# Collect all arguments for the java command;
205-
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
206-
# shell script including quotes and variable substitutions, so put them in
207-
# double quotes to make sure that they get re-expanded; and
208-
# * put everything else in single quotes, so that it's not re-expanded.
208+
# Collect all arguments for the java command:
209+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
210+
# and any embedded shellness will be escaped.
211+
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
212+
# treated as '${Hostname}' itself on the command line.
209213

210214
set -- \
211215
"-Dorg.gradle.appname=$APP_BASE_NAME" \

gradlew.bat

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
4345
%JAVA_EXE% -version >NUL 2>&1
4446
if %ERRORLEVEL% equ 0 goto execute
4547

46-
echo.
47-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48-
echo.
49-
echo Please set the JAVA_HOME variable in your environment to match the
50-
echo location of your Java installation.
48+
echo. 1>&2
49+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
50+
echo. 1>&2
51+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
52+
echo location of your Java installation. 1>&2
5153

5254
goto fail
5355

@@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5759

5860
if exist "%JAVA_EXE%" goto execute
5961

60-
echo.
61-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62-
echo.
63-
echo Please set the JAVA_HOME variable in your environment to match the
64-
echo location of your Java installation.
62+
echo. 1>&2
63+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
64+
echo. 1>&2
65+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
66+
echo location of your Java installation. 1>&2
6567

6668
goto fail
6769

settings.gradle.kts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
@file:Suppress("UnstableApiUsage")
22

3-
dependencyResolutionManagement {
4-
repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS
3+
pluginManagement {
54
repositories {
6-
mavenLocal()
7-
8-
maven("https://repo.opencollab.dev/main")
9-
10-
mavenCentral()
11-
12-
maven("https://jitpack.io") {
13-
content { includeGroupByRegex("com\\.github\\..*") }
14-
}
5+
gradlePluginPortal()
6+
maven("https://repo.papermc.io/repository/maven-public/")
157
}
168
}
179

0 commit comments

Comments
 (0)