From 15cce53adf25a6c6ffb643da6a1fd718108e502a Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Thu, 16 Mar 2023 02:14:22 -0400 Subject: [PATCH 01/15] Revert "Handle exceptions in ConnectionRequestBuilderImpl#fireAndForget (#875)" (#978) This reverts commit b4e04204a992af41be904470c917ee9d41626130. --- .../proxy/connection/client/ConnectedPlayer.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java index 3d9d69aef..61a2b5565 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java @@ -1244,10 +1244,7 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player, @Override public void fireAndForget() { - connectWithIndication().exceptionally((ex) -> { - logger.error("Exception while connecting with indication", ex); - return null; - }); + connectWithIndication(); } } } From 01f1e1a94e8628cc1f1a0966c7f02a902075a8e9 Mon Sep 17 00:00:00 2001 From: EpicPlayerA10 <62206933+EpicPlayerA10@users.noreply.github.com> Date: Thu, 16 Mar 2023 07:32:09 +0100 Subject: [PATCH 02/15] Fix header and footer desync (#928) --- .../proxy/connection/backend/TransitionSessionHandler.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/TransitionSessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/TransitionSessionHandler.java index 2d8008d24..25cbbef63 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/TransitionSessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/TransitionSessionHandler.java @@ -102,6 +102,9 @@ public class TransitionSessionHandler implements MinecraftSessionHandler { // Send keep alive to try to avoid timeouts player.sendKeepAlive(); + + // Reset Tablist header and footer to prevent desync + player.clearHeaderAndFooter(); } // The goods are in hand! We got JoinGame. Let's transition completely to the new state. From c7ba5255e3b0170a0e7183f3a38927931de34a03 Mon Sep 17 00:00:00 2001 From: Gero Date: Tue, 21 Mar 2023 09:22:40 +0100 Subject: [PATCH 03/15] Add Player#hasSentPlayerSettings (#980) --- .../main/java/com/velocitypowered/api/proxy/Player.java | 7 +++++++ .../proxy/connection/client/ConnectedPlayer.java | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/api/src/main/java/com/velocitypowered/api/proxy/Player.java b/api/src/main/java/com/velocitypowered/api/proxy/Player.java index cd41d8468..9382fec22 100644 --- a/api/src/main/java/com/velocitypowered/api/proxy/Player.java +++ b/api/src/main/java/com/velocitypowered/api/proxy/Player.java @@ -88,6 +88,13 @@ public interface Player extends */ PlayerSettings getPlayerSettings(); + /** + * Returns whether the player has sent its client settings. + * + * @return true if the player has sent its client settings + */ + boolean hasSentPlayerSettings(); + /** * Returns the player's mod info if they have a modded client. * diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java index 61a2b5565..579cd60ee 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java @@ -282,6 +282,11 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player, return settings == null ? ClientSettingsWrapper.DEFAULT : this.settings; } + @Override + public boolean hasSentPlayerSettings() { + return settings != null; + } + void setPlayerSettings(ClientSettings settings) { ClientSettingsWrapper cs = new ClientSettingsWrapper(settings); this.settings = cs; From e9526e0e233e0d0a9c4e3c5addab2ac8119e0062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20St=C3=A4ding?= Date: Sun, 26 Mar 2023 14:53:11 +0200 Subject: [PATCH 04/15] Move dependencies to gradle version catalog and clean up buildscripts --- api/build.gradle.kts | 45 +++++++------------- build.gradle.kts | 7 ++-- buildSrc/build.gradle.kts | 12 ++---- buildSrc/settings.gradle.kts | 11 +++++ gradle.properties | 26 ------------ gradle/libs.versions.toml | 54 ++++++++++++++++++++++++ native/build.gradle.kts | 10 ++--- proxy/build.gradle.kts | 81 +++++++++++------------------------- settings.gradle.kts | 24 +++++------ version | 1 + 10 files changed, 127 insertions(+), 144 deletions(-) create mode 100644 buildSrc/settings.gradle.kts delete mode 100644 gradle.properties create mode 100644 gradle/libs.versions.toml create mode 100644 version diff --git a/api/build.gradle.kts b/api/build.gradle.kts index 3ab8bfe94..1e448d0c2 100644 --- a/api/build.gradle.kts +++ b/api/build.gradle.kts @@ -10,45 +10,32 @@ java { sourceSets["main"].java { srcDir("src/ap/java") } - + sourceSets["main"].resources { srcDir("src/ap/resources") } } -val gsonVersion: String by project.extra -val guiceVersion: String by project.extra -val guavaVersion: String by project.extra -val adventureVersion: String by project.extra -val slf4jVersion: String by project.extra -val checkerFrameworkVersion: String by project.extra -val configurateVersion: String by project.extra -val caffeineVersion: String by project.extra - dependencies { - api("com.google.code.gson:gson:$gsonVersion") - api("com.google.guava:guava:$guavaVersion") + api(libs.gson) + api(libs.guava) // DEPRECATED: Will be removed in Velocity Polymer api("com.moandjiezana.toml:toml4j:0.7.2") - api(platform("net.kyori:adventure-bom:${adventureVersion}")) + api(platform(libs.adventure.bom)) api("net.kyori:adventure-api") api("net.kyori:adventure-text-serializer-gson") api("net.kyori:adventure-text-serializer-legacy") api("net.kyori:adventure-text-serializer-plain") api("net.kyori:adventure-text-minimessage") - api("org.slf4j:slf4j-api:$slf4jVersion") - api("com.google.inject:guice:$guiceVersion") - api("org.checkerframework:checker-qual:${checkerFrameworkVersion}") - api("com.velocitypowered:velocity-brigadier:1.0.0-SNAPSHOT") - - api("org.spongepowered:configurate-hocon:${configurateVersion}") - api("org.spongepowered:configurate-yaml:${configurateVersion}") - api("org.spongepowered:configurate-gson:${configurateVersion}") - - api("com.github.ben-manes.caffeine:caffeine:$caffeineVersion") + api(libs.slf4j) + api(libs.guice) + api(libs.checker.qual) + api(libs.brigadier) + api(libs.bundles.configurate) + api(libs.caffeine) } tasks { @@ -65,12 +52,12 @@ tasks { o.source = "8" o.links( - "https://www.slf4j.org/apidocs/", - "https://guava.dev/releases/$guavaVersion/api/docs/", - "https://google.github.io/guice/api-docs/$guiceVersion/javadoc/", - "https://docs.oracle.com/en/java/javase/11/docs/api/", - "https://jd.advntr.dev/api/$adventureVersion/", - "https://javadoc.io/doc/com.github.ben-manes.caffeine/caffeine" + "https://www.slf4j.org/apidocs/", + "https://guava.dev/releases/${libs.guava.get().version}/api/docs/", + "https://google.github.io/guice/api-docs/${libs.guice.get().version}/javadoc/", + "https://docs.oracle.com/en/java/javase/11/docs/api/", + "https://jd.advntr.dev/api/${libs.adventure.bom.get().version}/", + "https://javadoc.io/doc/com.github.ben-manes.caffeine/caffeine" ) // Disable the crazy super-strict doclint tool in Java 8 diff --git a/build.gradle.kts b/build.gradle.kts index 8b6870d55..ab9c0d7e9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,11 +6,9 @@ plugins { `java-library` } -val junitVersion: String by project.extra - allprojects { group = "com.velocitypowered" - version = "3.2.0-SNAPSHOT" + version = rootProject.file("version").readLines().first() } subprojects { @@ -31,8 +29,9 @@ subprojects { maven("https://s01.oss.sonatype.org/content/repositories/snapshots/") // adventure maven("https://repo.papermc.io/repository/maven-public/") } + dependencies { - testImplementation("org.junit.jupiter:junit-jupiter:$junitVersion") + testImplementation(rootProject.libs.junit) } tasks { diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 50f06b205..95806a655 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -1,17 +1,13 @@ +@Suppress("DSL_SCOPE_VIOLATION") // fixed in Gradle 8.1 plugins { `kotlin-dsl` checkstyle - id("net.kyori.indra.publishing") version "2.0.6" - id("com.diffplug.spotless") version "6.12.0" -} - -repositories { - mavenCentral() - maven("https://plugins.gradle.org/m2") + alias(libs.plugins.indra.publishing) + alias(libs.plugins.spotless) } dependencies { - implementation("com.diffplug.spotless:spotless-plugin-gradle:6.12.0") + implementation("com.diffplug.spotless:spotless-plugin-gradle:${libs.plugins.spotless.get().version}") } gradlePlugin { diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts new file mode 100644 index 000000000..325a8d54e --- /dev/null +++ b/buildSrc/settings.gradle.kts @@ -0,0 +1,11 @@ +dependencyResolutionManagement { + repositories { + mavenCentral() + gradlePluginPortal() + } + versionCatalogs { + register("libs") { + from(files("../gradle/libs.versions.toml")) // include from parent project + } + } +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties deleted file mode 100644 index 395b8d797..000000000 --- a/gradle.properties +++ /dev/null @@ -1,26 +0,0 @@ -# API dependencies. -gsonVersion=2.10.1 -junitVersion=5.9.0 -slf4jVersion=1.7.30 -adventureVersion=4.12.0 -guavaVersion=25.1-jre -checkerFrameworkVersion=3.28.0 -configurateVersion=3.7.3 -guiceVersion=5.1.0 - -# Proxy dependencies. -log4jVersion=2.20.0 -nettyVersion=4.1.90.Final -flareVersion=2.0.1 -asyncHttpClientVersion=2.12.3 -bstatsVersion=3.0.1 -caffeineVersion=3.1.5 -lmbdaVersion=2.0.0 -nightConfigVersion=3.6.6 -completableFuturesVersion=0.3.5 -adventureFacetVersion=4.2.0 -fastutilVersion=8.5.12 -disruptorVersion=3.4.4 -jlineVersion=3.23.0 -terminalConsoleAppenderVersion=1.3.0 -joptSimpleVersion=5.0.4 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 000000000..1d3ff2154 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,54 @@ +[versions] +configurate = "3.7.3" +flare = "2.0.1" +log4j = "2.20.0" +netty = "4.1.90.Final" + +[plugins] +indra-publishing = "net.kyori.indra.publishing:2.0.6" +shadow = "com.github.johnrengelman.shadow:8.1.0" +spotless = "com.diffplug.spotless:6.12.0" + +[libraries] +adventure-bom = "net.kyori:adventure-bom:4.12.0" +adventure-facet = "net.kyori:adventure-platform-facet:4.2.0" +asynchttpclient = "org.asynchttpclient:async-http-client:2.12.3" +brigadier = "com.velocitypowered:velocity-brigadier:1.0.0-SNAPSHOT" +bstats = "org.bstats:bstats-base:3.0.1" +caffeine = "com.github.ben-manes.caffeine:caffeine:3.1.5" +checker-qual = "org.checkerframework:checker-qual:3.28.0" +completablefutures = "com.spotify:completable-futures:0.3.5" +configurate-hocon = { module = "org.spongepowered:configurate-hocon", version.ref = "configurate" } +configurate-yaml = { module = "org.spongepowered:configurate-yaml", version.ref = "configurate" } +configurate-gson = { module = "org.spongepowered:configurate-gson", version.ref = "configurate" } +disruptor = "com.lmax:disruptor:3.4.4" +fastutil = "it.unimi.dsi:fastutil:8.5.12" +flare-core = { module = "space.vectrix.flare:flare", version.ref = "flare" } +flare-fastutil = { module = "space.vectrix.flare:flare-fastutil", version.ref = "flare" } +jline = "org.jline:jline-terminal-jansi:3.23.0" +jopt = "net.sf.jopt-simple:jopt-simple:5.0.4" +junit = "org.junit.jupiter:junit-jupiter:5.9.0" +guava = "com.google.guava:guava:25.1-jre" +gson = "com.google.code.gson:gson:2.10.1" +guice = "com.google.inject:guice:5.1.0" +lmbda = "org.lanternpowered:lmbda:2.0.0" +log4j-api = { module = "org.apache.logging.log4j:log4j-api", version.ref = "log4j" } +log4j-core = { module = "org.apache.logging.log4j:log4j-core", version.ref = "log4j" } +log4j-slf4j-impl = { module = "org.apache.logging.log4j:log4j-slf4j-impl", version.ref = "log4j" } +log4j-iostreams = { module = "org.apache.logging.log4j:log4j-iostreams", version.ref = "log4j" } +log4j-jul = { module = "org.apache.logging.log4j:log4j-jul", version.ref = "log4j" } +mockito = "org.mockito:mockito-core:5.2.0" +netty-codec = { module = "io.netty:netty-codec", version.ref = "netty" } +netty-codec-haproxy = { module = "io.netty:netty-codec-haproxy", version.ref = "netty" } +netty-codec-http = { module = "io.netty:netty-codec-http", version.ref = "netty" } +netty-handler = { module = "io.netty:netty-handler", version.ref = "netty" } +netty-transport-native-epoll = { module = "io.netty:netty-transport-native-epoll", version.ref = "netty" } +nightconfig = "com.electronwill.night-config:toml:3.6.6" +slf4j = "org.slf4j:slf4j-api:1.7.30" +spotbugs-annotations = "com.github.spotbugs:spotbugs-annotations:4.7.3" +terminalconsoleappender = "net.minecrell:terminalconsoleappender:1.3.0" + +[bundles] +configurate = ["configurate-hocon", "configurate-yaml", "configurate-gson"] +flare = ["flare-core", "flare-fastutil"] +log4j = ["log4j-api", "log4j-core", "log4j-slf4j-impl", "log4j-iostreams", "log4j-jul"] diff --git a/native/build.gradle.kts b/native/build.gradle.kts index eb381692d..24a6e583d 100644 --- a/native/build.gradle.kts +++ b/native/build.gradle.kts @@ -3,12 +3,8 @@ plugins { `maven-publish` } -val guavaVersion: String by project.extra -val nettyVersion: String by project.extra -val checkerFrameworkVersion: String by project.extra - dependencies { - implementation("com.google.guava:guava:${guavaVersion}") - implementation("io.netty:netty-handler:${nettyVersion}") - implementation("org.checkerframework:checker-qual:${checkerFrameworkVersion}") + implementation(libs.guava) + implementation(libs.netty.handler) + implementation(libs.checker.qual) } \ No newline at end of file diff --git a/proxy/build.gradle.kts b/proxy/build.gradle.kts index 6d94c5675..e02eaed89 100644 --- a/proxy/build.gradle.kts +++ b/proxy/build.gradle.kts @@ -1,9 +1,10 @@ import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer +@Suppress("DSL_SCOPE_VIOLATION") // fixed in Gradle 8.1 plugins { application `set-manifest-impl-version` - id("com.github.johnrengelman.shadow") version "8.1.0" + alias(libs.plugins.shadow) } application { @@ -88,65 +89,33 @@ tasks { } } -val adventureVersion: String by project.extra -val adventureFacetVersion: String by project.extra -val asyncHttpClientVersion: String by project.extra -val bstatsVersion: String by project.extra -val completableFuturesVersion: String by project.extra -val disruptorVersion: String by project.extra -val fastutilVersion: String by project.extra -val flareVersion: String by project.extra -val jlineVersion: String by project.extra -val joptSimpleVersion: String by project.extra -val lmbdaVersion: String by project.extra -val log4jVersion: String by project.extra -val nettyVersion: String by project.extra -val nightConfigVersion: String by project.extra -val semver4jVersion: String by project.extra -val terminalConsoleAppenderVersion: String by project.extra - dependencies { implementation(project(":velocity-api")) implementation(project(":velocity-native")) - implementation("io.netty:netty-codec:${nettyVersion}") - implementation("io.netty:netty-codec-haproxy:${nettyVersion}") - implementation("io.netty:netty-codec-http:${nettyVersion}") - implementation("io.netty:netty-handler:${nettyVersion}") - implementation("io.netty:netty-transport-native-epoll:${nettyVersion}") - implementation("io.netty:netty-transport-native-epoll:${nettyVersion}:linux-x86_64") - implementation("io.netty:netty-transport-native-epoll:${nettyVersion}:linux-aarch_64") + implementation(libs.bundles.log4j) + implementation(libs.netty.codec) + implementation(libs.netty.codec.haproxy) + implementation(libs.netty.codec.http) + implementation(libs.netty.handler) + implementation(libs.netty.transport.native.epoll) + implementation(variantOf(libs.netty.transport.native.epoll) { classifier("linux-x86_64") }) + implementation(variantOf(libs.netty.transport.native.epoll) { classifier("linux-aarch_64") }) - implementation("org.apache.logging.log4j:log4j-api:${log4jVersion}") - implementation("org.apache.logging.log4j:log4j-core:${log4jVersion}") - implementation("org.apache.logging.log4j:log4j-slf4j-impl:${log4jVersion}") - implementation("org.apache.logging.log4j:log4j-iostreams:${log4jVersion}") - implementation("org.apache.logging.log4j:log4j-jul:${log4jVersion}") - - implementation("net.sf.jopt-simple:jopt-simple:$joptSimpleVersion") // command-line options - implementation("net.minecrell:terminalconsoleappender:$terminalConsoleAppenderVersion") - runtimeOnly("org.jline:jline-terminal-jansi:$jlineVersion") // Needed for JLine - runtimeOnly("com.lmax:disruptor:$disruptorVersion") // Async loggers - - implementation("it.unimi.dsi:fastutil-core:$fastutilVersion") - - implementation(platform("net.kyori:adventure-bom:$adventureVersion")) + implementation(libs.jopt) + implementation(libs.terminalconsoleappender) + runtimeOnly(libs.jline) + runtimeOnly(libs.disruptor) + implementation(libs.fastutil) + implementation(platform("net.kyori:adventure-bom:4.12.0")) implementation("net.kyori:adventure-nbt") - implementation("net.kyori:adventure-platform-facet:$adventureFacetVersion") - - implementation("org.asynchttpclient:async-http-client:$asyncHttpClientVersion") - - implementation("com.spotify:completable-futures:$completableFuturesVersion") - - implementation("com.electronwill.night-config:toml:$nightConfigVersion") - - implementation("org.bstats:bstats-base:$bstatsVersion") - implementation("org.lanternpowered:lmbda:$lmbdaVersion") - - implementation("space.vectrix.flare:flare:$flareVersion") - implementation("space.vectrix.flare:flare-fastutil:$flareVersion") - - compileOnly("com.github.spotbugs:spotbugs-annotations:4.7.3") - - testImplementation("org.mockito:mockito-core:3.+") + implementation(libs.adventure.facet) + implementation(libs.asynchttpclient) + implementation(libs.completablefutures) + implementation(libs.nightconfig) + implementation(libs.bstats) + implementation(libs.lmbda) + implementation(libs.bundles.flare) + compileOnly(libs.spotbugs.annotations) + testImplementation(libs.mockito) } diff --git a/settings.gradle.kts b/settings.gradle.kts index d93eda7a7..b8d700802 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,19 +1,15 @@ -pluginManagement { - repositories { - gradlePluginPortal() - } -} - plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.4.0" } rootProject.name = "velocity" -include( - "api", - "proxy", - "native" -) -findProject(":api")?.name = "velocity-api" -findProject(":proxy")?.name = "velocity-proxy" -findProject(":native")?.name = "velocity-native" \ No newline at end of file + +sequenceOf( + "api", + "proxy", + "native", +).forEach { + val project = ":velocity-$it" + include(project) + project(project).projectDir = file(it) +} diff --git a/version b/version new file mode 100644 index 000000000..e1f3bbde8 --- /dev/null +++ b/version @@ -0,0 +1 @@ +3.2.0-SNAPSHOT From 44d06ce79c6876aa9e59fad4a41db12032692642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20St=C3=A4ding?= Date: Sun, 26 Mar 2023 14:55:32 +0200 Subject: [PATCH 05/15] Fix missing newline in native/build.gradle.kts --- native/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/native/build.gradle.kts b/native/build.gradle.kts index 24a6e583d..165cb30f9 100644 --- a/native/build.gradle.kts +++ b/native/build.gradle.kts @@ -7,4 +7,4 @@ dependencies { implementation(libs.guava) implementation(libs.netty.handler) implementation(libs.checker.qual) -} \ No newline at end of file +} From ace5e72c8d8c68d2842d7847d661537b2229fd93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20St=C3=A4ding?= Date: Sun, 26 Mar 2023 14:57:54 +0200 Subject: [PATCH 06/15] Fix another missing newline --- buildSrc/settings.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts index 325a8d54e..0ecd59401 100644 --- a/buildSrc/settings.gradle.kts +++ b/buildSrc/settings.gradle.kts @@ -8,4 +8,4 @@ dependencyResolutionManagement { from(files("../gradle/libs.versions.toml")) // include from parent project } } -} \ No newline at end of file +} From 7b5f010215c48c032b58d14701aa4116faccb21f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20St=C3=A4ding?= Date: Sun, 26 Mar 2023 16:18:28 +0200 Subject: [PATCH 07/15] Forgot to migrate adventure bom declaration --- proxy/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxy/build.gradle.kts b/proxy/build.gradle.kts index e02eaed89..486e1f7bd 100644 --- a/proxy/build.gradle.kts +++ b/proxy/build.gradle.kts @@ -107,7 +107,7 @@ dependencies { runtimeOnly(libs.jline) runtimeOnly(libs.disruptor) implementation(libs.fastutil) - implementation(platform("net.kyori:adventure-bom:4.12.0")) + implementation(platform(libs.adventure.bom)) implementation("net.kyori:adventure-nbt") implementation(libs.adventure.facet) implementation(libs.asynchttpclient) From 39fc2805fd396d7a66bf0aa3444137714c7e7c7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20St=C3=A4ding?= Date: Sun, 26 Mar 2023 21:59:06 +0200 Subject: [PATCH 08/15] Move group and version declaration to gradle.properties --- build.gradle.kts | 5 ----- gradle.properties | 2 ++ version | 1 - 3 files changed, 2 insertions(+), 6 deletions(-) create mode 100644 gradle.properties delete mode 100644 version diff --git a/build.gradle.kts b/build.gradle.kts index ab9c0d7e9..f1a64c850 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,11 +6,6 @@ plugins { `java-library` } -allprojects { - group = "com.velocitypowered" - version = rootProject.file("version").readLines().first() -} - subprojects { apply() diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 000000000..0f76ae151 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,2 @@ +group=com.velocitypowered +version=3.2.0-SNAPSHOT diff --git a/version b/version deleted file mode 100644 index e1f3bbde8..000000000 --- a/version +++ /dev/null @@ -1 +0,0 @@ -3.2.0-SNAPSHOT From 93b6376b389d29f16e2e24729c305431913df0e8 Mon Sep 17 00:00:00 2001 From: Gero Date: Wed, 29 Mar 2023 09:21:01 +0200 Subject: [PATCH 09/15] Remove registry decoding (#979) --- .../backend/VelocityServerConnection.java | 8 +- .../client/ClientPlaySessionHandler.java | 2 +- .../connection/registry/DimensionData.java | 388 ------------------ .../registry/DimensionRegistry.java | 128 ------ .../proxy/protocol/packet/JoinGame.java | 105 ++--- .../proxy/protocol/packet/Respawn.java | 11 +- 6 files changed, 33 insertions(+), 609 deletions(-) delete mode 100644 proxy/src/main/java/com/velocitypowered/proxy/connection/registry/DimensionData.java delete mode 100644 proxy/src/main/java/com/velocitypowered/proxy/connection/registry/DimensionRegistry.java diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/VelocityServerConnection.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/VelocityServerConnection.java index 22c1dd821..a2300b978 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/VelocityServerConnection.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/VelocityServerConnection.java @@ -35,7 +35,6 @@ import com.velocitypowered.proxy.connection.ConnectionTypes; import com.velocitypowered.proxy.connection.MinecraftConnection; import com.velocitypowered.proxy.connection.MinecraftConnectionAssociation; import com.velocitypowered.proxy.connection.client.ConnectedPlayer; -import com.velocitypowered.proxy.connection.registry.DimensionRegistry; import com.velocitypowered.proxy.connection.util.ConnectionRequestResults.Impl; import com.velocitypowered.proxy.protocol.StateRegistry; import com.velocitypowered.proxy.protocol.packet.Handshake; @@ -52,6 +51,7 @@ import java.util.Map; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.function.UnaryOperator; +import net.kyori.adventure.nbt.CompoundBinaryTag; import org.checkerframework.checker.nullness.qual.MonotonicNonNull; import org.checkerframework.checker.nullness.qual.Nullable; @@ -69,7 +69,7 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation, private boolean gracefulDisconnect = false; private BackendConnectionPhase connectionPhase = BackendConnectionPhases.UNKNOWN; private final Map pendingPings = new HashMap<>(); - private @MonotonicNonNull DimensionRegistry activeDimensionRegistry; + private @MonotonicNonNull CompoundBinaryTag activeDimensionRegistry; /** * Initializes a new server connection. @@ -344,11 +344,11 @@ public class VelocityServerConnection implements MinecraftConnectionAssociation, return hasCompletedJoin; } - public DimensionRegistry getActiveDimensionRegistry() { + public CompoundBinaryTag getActiveDimensionRegistry() { return activeDimensionRegistry; } - public void setActiveDimensionRegistry(DimensionRegistry activeDimensionRegistry) { + public void setActiveDimensionRegistry(CompoundBinaryTag activeDimensionRegistry) { this.activeDimensionRegistry = activeDimensionRegistry; } } diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java index 82f6706d7..bc041d8ab 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java @@ -473,7 +473,7 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler { } } - destination.setActiveDimensionRegistry(joinGame.getDimensionRegistry()); // 1.16 + destination.setActiveDimensionRegistry(joinGame.getRegistry()); // 1.16 // Remove previous boss bars. These don't get cleared when sending JoinGame, thus the need to // track them. diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/registry/DimensionData.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/registry/DimensionData.java deleted file mode 100644 index 1a484abc0..000000000 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/registry/DimensionData.java +++ /dev/null @@ -1,388 +0,0 @@ -/* - * Copyright (C) 2020-2023 Velocity Contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.velocitypowered.proxy.connection.registry; - -import com.google.common.base.Preconditions; -import com.velocitypowered.api.network.ProtocolVersion; -import net.kyori.adventure.nbt.CompoundBinaryTag; -import org.checkerframework.checker.nullness.qual.Nullable; - -/** - * Represents a dimension sent to the client by the server. - */ -public final class DimensionData { - - private static final String UNKNOWN_DIMENSION_ID = "velocity:unknown_dimension"; - - private final String registryIdentifier; - private final @Nullable Integer dimensionId; - private final boolean isNatural; - private final float ambientLight; - private final boolean isShrunk; - private final boolean isUltrawarm; - private final boolean hasCeiling; - private final boolean hasSkylight; - private final boolean isPiglinSafe; - private final boolean doBedsWork; - private final boolean doRespawnAnchorsWork; - private final boolean hasRaids; - private final int logicalHeight; - private final String burningBehaviourIdentifier; - private final @Nullable Long fixedTime; - private final @Nullable Boolean createDragonFight; - private final @Nullable Double coordinateScale; - private final @Nullable String effects; - private final @Nullable Integer minY; // Required and added by 1.17 - private final @Nullable Integer height; // Required and added by 1.17 - private final @Nullable Integer monsterSpawnBlockLightLimit; // Required and added by 1.19 - private final @Nullable Integer monsterSpawnLightLevel; // Required and added by 1.19 - - /** - * Initializes a new {@link DimensionData} instance. - * - * @param registryIdentifier the identifier for the dimension from the registry. - * @param dimensionId the dimension ID contained in the registry (the "id" tag) - * @param isNatural indicates if the dimension use natural world generation - * (e.g. overworld) - * @param ambientLight the light level the client sees without external lighting - * @param isShrunk indicates if the world is shrunk, aka not the full 256 - * blocks (e.g. nether) - * @param isUltrawarm internal dimension warmth flag - * @param hasCeiling indicates if the dimension has a ceiling layer - * @param hasSkylight indicates if the dimension should display the sun - * @param isPiglinSafe indicates if piglins should naturally zombify in this - * dimension - * @param doBedsWork indicates if players should be able to sleep in beds in this - * dimension - * @param doRespawnAnchorsWork indicates if player respawn points can be used in this - * dimension - * @param hasRaids indicates if raids can be spawned in the dimension - * @param logicalHeight the natural max height for the given dimension - * @param burningBehaviourIdentifier the identifier for how burning blocks work in the dimension - * @param fixedTime optional. If set to any game daytime value will deactivate - * time cycle - * @param createDragonFight optional. Internal flag used in the end dimension - * @param coordinateScale optional, unknown purpose - * @param effects optional, unknown purpose - * @param minY the world effective lowest build-level - * @param height the world height above zero - * @param monsterSpawnBlockLightLimit an integer controlling the block light needed to prevent - * monster spawns. - * @param monsterSpawnLightLevel an int provider which is evaluated to find a value to - * compare the current overall brightness with to determine if - * a monster should be allowed to spawn. - */ - public DimensionData(String registryIdentifier, - @Nullable Integer dimensionId, - boolean isNatural, - float ambientLight, boolean isShrunk, boolean isUltrawarm, - boolean hasCeiling, boolean hasSkylight, - boolean isPiglinSafe, boolean doBedsWork, - boolean doRespawnAnchorsWork, boolean hasRaids, - int logicalHeight, String burningBehaviourIdentifier, - @Nullable Long fixedTime, @Nullable Boolean createDragonFight, - @Nullable Double coordinateScale, - @Nullable String effects, - @Nullable Integer minY, @Nullable Integer height, - @Nullable Integer monsterSpawnBlockLightLimit, - @Nullable Integer monsterSpawnLightLevel) { - this.monsterSpawnBlockLightLimit = monsterSpawnBlockLightLimit; - this.monsterSpawnLightLevel = monsterSpawnLightLevel; - Preconditions.checkNotNull( - registryIdentifier, "registryIdentifier cannot be null"); - Preconditions.checkArgument(registryIdentifier.length() > 0, - "registryIdentifier cannot be empty"); - Preconditions.checkArgument(logicalHeight >= 0, "localHeight must be >= 0"); - Preconditions.checkNotNull( - burningBehaviourIdentifier, "burningBehaviourIdentifier cannot be null"); - Preconditions.checkArgument(burningBehaviourIdentifier.length() > 0, - "burningBehaviourIdentifier cannot be empty"); - this.registryIdentifier = registryIdentifier; - this.dimensionId = dimensionId; - this.isNatural = isNatural; - this.ambientLight = ambientLight; - this.isShrunk = isShrunk; - this.isUltrawarm = isUltrawarm; - this.hasCeiling = hasCeiling; - this.hasSkylight = hasSkylight; - this.isPiglinSafe = isPiglinSafe; - this.doBedsWork = doBedsWork; - this.doRespawnAnchorsWork = doRespawnAnchorsWork; - this.hasRaids = hasRaids; - this.logicalHeight = logicalHeight; - this.burningBehaviourIdentifier = burningBehaviourIdentifier; - this.fixedTime = fixedTime; - this.createDragonFight = createDragonFight; - this.coordinateScale = coordinateScale; - this.effects = effects; - this.minY = minY; - this.height = height; - } - - public String getRegistryIdentifier() { - return registryIdentifier; - } - - public @Nullable Integer getDimensionId() { - return dimensionId; - } - - public boolean isNatural() { - return isNatural; - } - - public float getAmbientLight() { - return ambientLight; - } - - public boolean isShrunk() { - return isShrunk; - } - - public boolean isUltrawarm() { - return isUltrawarm; - } - - public boolean hasCeiling() { - return hasCeiling; - } - - public boolean hasSkylight() { - return hasSkylight; - } - - public boolean isPiglinSafe() { - return isPiglinSafe; - } - - public boolean doBedsWork() { - return doBedsWork; - } - - public boolean doRespawnAnchorsWork() { - return doRespawnAnchorsWork; - } - - public boolean hasRaids() { - return hasRaids; - } - - public int getLogicalHeight() { - return logicalHeight; - } - - public String getBurningBehaviourIdentifier() { - return burningBehaviourIdentifier; - } - - public @Nullable Long getFixedTime() { - return fixedTime; - } - - public @Nullable Boolean getCreateDragonFight() { - return createDragonFight; - } - - public @Nullable Double getCoordinateScale() { - return coordinateScale; - } - - public @Nullable Integer getMinY() { - return minY; - } - - public @Nullable Integer getHeight() { - return height; - } - - /** - * Returns a fresh {@link DimensionData} with the specified {@code registryIdentifier} and - * {@code dimensionId}. - * - * @param registryIdentifier the identifier for the dimension from the registry - * @param dimensionId optional, dimension ID - * @return a new {@link DimensionData} - */ - public DimensionData annotateWith(String registryIdentifier, - @Nullable Integer dimensionId) { - return new DimensionData(registryIdentifier, dimensionId, isNatural, ambientLight, isShrunk, - isUltrawarm, hasCeiling, hasSkylight, isPiglinSafe, doBedsWork, doRespawnAnchorsWork, - hasRaids, logicalHeight, burningBehaviourIdentifier, fixedTime, createDragonFight, - coordinateScale, effects, minY, height, monsterSpawnBlockLightLimit, - monsterSpawnLightLevel); - } - - public boolean isUnannotated() { - return this.registryIdentifier.equalsIgnoreCase(UNKNOWN_DIMENSION_ID); - } - - /** - * Parses a given CompoundTag to a DimensionData instance. Assumes the data only contains - * dimension details. - * - * @param details the compound from the registry to read - * @param version the protocol version - * @return game dimension data - */ - public static DimensionData decodeBaseCompoundTag(CompoundBinaryTag details, - ProtocolVersion version) { - boolean isNatural = details.getBoolean("natural"); - float ambientLight = details.getFloat("ambient_light"); - boolean isShrunk = details.getBoolean("shrunk"); - boolean isUltrawarm = details.getBoolean("ultrawarm"); - boolean hasCeiling = details.getBoolean("has_ceiling"); - boolean hasSkylight = details.getBoolean("has_skylight"); - boolean isPiglinSafe = details.getBoolean("piglin_safe"); - boolean doBedsWork = details.getBoolean("bed_works"); - boolean doRespawnAnchorsWork = details.getBoolean("respawn_anchor_works"); - boolean hasRaids = details.getBoolean("has_raids"); - int logicalHeight = details.getInt("logical_height"); - String burningBehaviourIdentifier = details.getString("infiniburn"); - Long fixedTime = details.keySet().contains("fixed_time") - ? details.getLong("fixed_time") : null; - Boolean hasEnderdragonFight = details.keySet().contains("has_enderdragon_fight") - ? details.getBoolean("has_enderdragon_fight") : null; - Double coordinateScale = details.keySet().contains("coordinate_scale") - ? details.getDouble("coordinate_scale") : null; - String effects = details.keySet().contains("effects") ? details.getString("effects") - : null; - Integer minY = details.keySet().contains("min_y") ? details.getInt("min_y") : null; - Integer height = details.keySet().contains("height") ? details.getInt("height") : null; - Integer monsterSpawnBlockLightLimit = - details.keySet().contains("monster_spawn_block_light_limit") - ? details.getInt("monster_spawn_block_light_limit") : null; - Integer monsterSpawnLightLevel = - details.keySet().contains("monster_spawn_light_level") ? details.getInt( - "monster_spawn_block_light_limit") : - null; - if (version.compareTo(ProtocolVersion.MINECRAFT_1_17) >= 0) { - Preconditions.checkNotNull(height, - "DimensionData requires 'height' to be present for this version"); - Preconditions.checkNotNull(minY, - "DimensionData requires 'minY' to be present for this version"); - } - if (version.compareTo(ProtocolVersion.MINECRAFT_1_19) >= 0) { - Preconditions.checkNotNull(monsterSpawnBlockLightLimit, - "DimensionData requires 'monster_spawn_block_light_limit' to be present" - + " for this version."); - Preconditions.checkNotNull(monsterSpawnLightLevel, - "DimensionData requires 'monster_spawn_light_level' to be present" - + " for this version."); - } - return new DimensionData( - UNKNOWN_DIMENSION_ID, null, isNatural, ambientLight, isShrunk, - isUltrawarm, hasCeiling, hasSkylight, isPiglinSafe, doBedsWork, doRespawnAnchorsWork, - hasRaids, logicalHeight, burningBehaviourIdentifier, fixedTime, hasEnderdragonFight, - coordinateScale, effects, minY, height, monsterSpawnBlockLightLimit, - monsterSpawnLightLevel); - } - - /** - * Parses a given CompoundTag to a DimensionData instance. Assumes the data is part of a dimension - * registry. - * - * @param dimTag the compound from the registry to read - * @param version the protocol version - * @return game dimension data - */ - public static DimensionData decodeRegistryEntry(CompoundBinaryTag dimTag, - ProtocolVersion version) { - String registryIdentifier = dimTag.getString("name"); - CompoundBinaryTag details; - Integer dimensionId = null; - if (version.compareTo(ProtocolVersion.MINECRAFT_1_16_2) >= 0) { - dimensionId = dimTag.getInt("id"); - details = dimTag.getCompound("element"); - } else { - details = dimTag; - } - - DimensionData deserializedDetails = decodeBaseCompoundTag(details, version); - return deserializedDetails.annotateWith(registryIdentifier, dimensionId); - } - - /** - * Encodes the Dimension data as CompoundTag. - * - * @param version the version to serialize as - * @return compound containing the dimension data - */ - public CompoundBinaryTag encodeAsCompoundTag(ProtocolVersion version) { - CompoundBinaryTag details = serializeDimensionDetails(); - if (version.compareTo(ProtocolVersion.MINECRAFT_1_16_2) >= 0) { - if (dimensionId == null) { - throw new IllegalStateException("Tried to serialize a 1.16.2+ dimension registry entry " - + "without an ID"); - } - - return CompoundBinaryTag.builder() - .putString("name", registryIdentifier) - .putInt("id", dimensionId) - .put("element", details) - .build(); - } else { - return details.putString("name", registryIdentifier); - } - } - - /** - * Serializes details of this dimension. - * - * @return serialized details of this dimension - */ - public CompoundBinaryTag serializeDimensionDetails() { - CompoundBinaryTag.Builder ret = CompoundBinaryTag.builder(); - ret.putBoolean("natural", isNatural); - ret.putFloat("ambient_light", ambientLight); - ret.putBoolean("shrunk", isShrunk); - ret.putBoolean("ultrawarm", isUltrawarm); - ret.putBoolean("has_ceiling", hasCeiling); - ret.putBoolean("has_skylight", hasSkylight); - ret.putBoolean("piglin_safe", isPiglinSafe); - ret.putBoolean("bed_works", doBedsWork); - ret.putBoolean("respawn_anchor_works", doRespawnAnchorsWork); - ret.putBoolean("has_raids", hasRaids); - ret.putInt("logical_height", logicalHeight); - ret.putString("infiniburn", burningBehaviourIdentifier); - if (fixedTime != null) { - ret.putLong("fixed_time", fixedTime); - } - if (createDragonFight != null) { - ret.putBoolean("has_enderdragon_fight", createDragonFight); - } - if (coordinateScale != null) { - ret.putDouble("coordinate_scale", coordinateScale); - } - if (effects != null) { - ret.putString("effects", effects); - } - if (minY != null) { - ret.putInt("min_y", minY); - } - if (height != null) { - ret.putInt("height", height); - } - if (monsterSpawnBlockLightLimit != null) { - ret.putInt("monster_spawn_block_light_limit", monsterSpawnBlockLightLimit); - } - if (monsterSpawnLightLevel != null) { - ret.putInt("monster_spawn_light_level", monsterSpawnLightLevel); - } - return ret.build(); - } -} diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/registry/DimensionRegistry.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/registry/DimensionRegistry.java deleted file mode 100644 index 29a6b8f97..000000000 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/registry/DimensionRegistry.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2020-2023 Velocity Contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.velocitypowered.proxy.connection.registry; - -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableSet; -import com.google.common.collect.Maps; -import com.velocitypowered.api.network.ProtocolVersion; -import java.util.Map; -import java.util.Set; -import net.kyori.adventure.nbt.BinaryTag; -import net.kyori.adventure.nbt.BinaryTagTypes; -import net.kyori.adventure.nbt.CompoundBinaryTag; -import net.kyori.adventure.nbt.ListBinaryTag; -import org.checkerframework.checker.nullness.qual.Nullable; - -/** - * Represents a registry of dimensions sent to the client by the server. - */ -public final class DimensionRegistry { - - private final Map registeredDimensions; - private final ImmutableSet levelNames; - - /** - * Initializes a new {@link DimensionRegistry} instance. This registry is required for 1.16+ - * clients/servers to communicate, it constrains the dimension types and names the client can be - * sent in a Respawn action (dimension change). This WILL raise an IllegalArgumentException if the - * following is not met: - At least one valid DimensionData instance is provided - At least one - * valid world name is provided - * - * @param registeredDimensions a populated {@link ImmutableSet} containing dimension data types - * @param levelNames a populated {@link ImmutableSet} of the level (world) names the - * server offers - */ - public DimensionRegistry(ImmutableSet registeredDimensions, - ImmutableSet levelNames) { - Preconditions.checkNotNull(registeredDimensions, - "registeredDimensions cannot be null"); - Preconditions.checkNotNull(levelNames, - "levelNames cannot be null"); - Preconditions.checkArgument(registeredDimensions.size() > 0, - "registeredDimensions needs to be populated"); - Preconditions.checkArgument(levelNames.size() > 0, - "levelNames needs to populated"); - this.registeredDimensions = Maps.uniqueIndex( - registeredDimensions, DimensionData::getRegistryIdentifier); - this.levelNames = levelNames; - } - - public Map getRegisteredDimensions() { - return registeredDimensions; - } - - public Set getLevelNames() { - return levelNames; - } - - /** - * Returns the internal dimension data type as used by the game. - * - * @param dimensionIdentifier how the dimension is identified by the connection - * @return game dimension data or null if not registered - */ - public @Nullable DimensionData getDimensionData(String dimensionIdentifier) { - return registeredDimensions.get(dimensionIdentifier); - } - - /** - * Checks a {@link DimensionInfo} against this registry. - * - * @param toValidate the {@link DimensionInfo} to validate - * @return true: the dimension information is valid for this registry - */ - public boolean isValidFor(DimensionInfo toValidate) { - if (toValidate == null) { - return false; - } - return registeredDimensions.containsKey(toValidate.getRegistryIdentifier()) - && levelNames.contains(toValidate.getLevelName()); - } - - /** - * Encodes the stored Dimension registry as CompoundTag. - * - * @return the CompoundTag containing identifier:type mappings - */ - public ListBinaryTag encodeRegistry(ProtocolVersion version) { - ListBinaryTag.Builder listBuilder = ListBinaryTag - .builder(BinaryTagTypes.COMPOUND); - for (DimensionData iter : registeredDimensions.values()) { - listBuilder.add(iter.encodeAsCompoundTag(version)); - } - return listBuilder.build(); - } - - /** - * Decodes a CompoundTag storing a dimension registry. - * - * @param toParse CompoundTag containing a dimension registry - */ - public static ImmutableSet fromGameData(ListBinaryTag toParse, - ProtocolVersion version) { - Preconditions.checkNotNull(toParse, "ListTag cannot be null"); - ImmutableSet.Builder mappings = ImmutableSet.builder(); - for (BinaryTag iter : toParse) { - if (iter instanceof CompoundBinaryTag) { - mappings.add(DimensionData.decodeRegistryEntry((CompoundBinaryTag) iter, version)); - } - } - return mappings.build(); - } -} diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/JoinGame.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/JoinGame.java index 85a61ef4f..90320f948 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/JoinGame.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/JoinGame.java @@ -20,16 +20,12 @@ package com.velocitypowered.proxy.protocol.packet; import com.google.common.collect.ImmutableSet; import com.velocitypowered.api.network.ProtocolVersion; import com.velocitypowered.proxy.connection.MinecraftSessionHandler; -import com.velocitypowered.proxy.connection.registry.DimensionData; import com.velocitypowered.proxy.connection.registry.DimensionInfo; -import com.velocitypowered.proxy.connection.registry.DimensionRegistry; import com.velocitypowered.proxy.protocol.*; import io.netty.buffer.ByteBuf; import it.unimi.dsi.fastutil.Pair; import net.kyori.adventure.nbt.BinaryTagIO; -import net.kyori.adventure.nbt.BinaryTagTypes; import net.kyori.adventure.nbt.CompoundBinaryTag; -import net.kyori.adventure.nbt.ListBinaryTag; import org.checkerframework.checker.nullness.qual.Nullable; public class JoinGame implements MinecraftPacket { @@ -46,15 +42,13 @@ public class JoinGame implements MinecraftPacket { private int viewDistance; // 1.14+ private boolean reducedDebugInfo; private boolean showRespawnScreen; - private DimensionRegistry dimensionRegistry; // 1.16+ + private ImmutableSet levelNames; // 1.16+ + private CompoundBinaryTag registry; // 1.16+ private DimensionInfo dimensionInfo; // 1.16+ - private DimensionData currentDimensionData; // 1.16.2+ + private CompoundBinaryTag currentDimensionData; // 1.16.2+ private short previousGamemode; // 1.16+ - private CompoundBinaryTag biomeRegistry; // 1.16.2+ private int simulationDistance; // 1.18+ - private @Nullable Pair lastDeathPosition; - private CompoundBinaryTag chatTypeRegistry; // placeholder, 1.19+ - private @Nullable CompoundBinaryTag originalRegistryContainerTag; + private @Nullable Pair lastDeathPosition; // 1.19+ public int getEntityId() { return entityId; @@ -132,14 +126,6 @@ public class JoinGame implements MinecraftPacket { this.dimensionInfo = dimensionInfo; } - public DimensionRegistry getDimensionRegistry() { - return dimensionRegistry; - } - - public void setDimensionRegistry(DimensionRegistry dimensionRegistry) { - this.dimensionRegistry = dimensionRegistry; - } - public short getPreviousGamemode() { return previousGamemode; } @@ -156,15 +142,7 @@ public class JoinGame implements MinecraftPacket { this.isHardcore = isHardcore; } - public CompoundBinaryTag getBiomeRegistry() { - return biomeRegistry; - } - - public void setBiomeRegistry(CompoundBinaryTag biomeRegistry) { - this.biomeRegistry = biomeRegistry; - } - - public DimensionData getCurrentDimensionData() { + public CompoundBinaryTag getCurrentDimensionData() { return currentDimensionData; } @@ -184,12 +162,8 @@ public class JoinGame implements MinecraftPacket { this.lastDeathPosition = lastDeathPosition; } - public CompoundBinaryTag getChatTypeRegistry() { - return chatTypeRegistry; - } - - public void setChatTypeRegistry(CompoundBinaryTag chatTypeRegistry) { - this.chatTypeRegistry = chatTypeRegistry; + public CompoundBinaryTag getRegistry() { + return registry; } @Override @@ -200,12 +174,16 @@ public class JoinGame implements MinecraftPacket { + ", dimension=" + dimension + ", partialHashedSeed=" + partialHashedSeed + ", difficulty=" + difficulty + + ", isHardcore=" + isHardcore + ", maxPlayers=" + maxPlayers + ", levelType='" + levelType + '\'' + ", viewDistance=" + viewDistance + ", reducedDebugInfo=" + reducedDebugInfo - + ", dimensionRegistry='" + dimensionRegistry + '\'' + + ", showRespawnScreen=" + showRespawnScreen + + ", levelNames=" + levelNames + + ", registry='" + registry + '\'' + ", dimensionInfo='" + dimensionInfo + '\'' + + ", currentDimensionData='" + currentDimensionData + '\'' + ", previousGamemode=" + previousGamemode + ", simulationDistance=" + simulationDistance + ", lastDeathPosition='" + lastDeathPosition + '\'' @@ -263,39 +241,16 @@ public class JoinGame implements MinecraftPacket { this.isHardcore = (this.gamemode & 0x08) != 0; this.gamemode &= ~0x08; } - this.previousGamemode = buf.readByte(); - ImmutableSet levelNames = ImmutableSet.copyOf(ProtocolUtils.readStringArray(buf)); - - CompoundBinaryTag registryContainer = ProtocolUtils.readCompoundTag(buf, JOINGAME_READER); - ListBinaryTag dimensionRegistryContainer; - if (version.compareTo(ProtocolVersion.MINECRAFT_1_16_2) >= 0) { - dimensionRegistryContainer = registryContainer.getCompound("minecraft:dimension_type") - .getList("value", BinaryTagTypes.COMPOUND); - this.biomeRegistry = registryContainer.getCompound("minecraft:worldgen/biome"); - if (version.compareTo(ProtocolVersion.MINECRAFT_1_19) >= 0) { - this.chatTypeRegistry = registryContainer.getCompound("minecraft:chat_type"); - } else { - this.chatTypeRegistry = CompoundBinaryTag.empty(); - } - } else { - dimensionRegistryContainer = registryContainer.getList("dimension", - BinaryTagTypes.COMPOUND); - } - ImmutableSet readData = - DimensionRegistry.fromGameData(dimensionRegistryContainer, version); - this.dimensionRegistry = new DimensionRegistry(readData, levelNames); - this.originalRegistryContainerTag = registryContainer; - + this.levelNames = ImmutableSet.copyOf(ProtocolUtils.readStringArray(buf)); + this.registry = ProtocolUtils.readCompoundTag(buf, JOINGAME_READER); String dimensionIdentifier; String levelName = null; if (version.compareTo(ProtocolVersion.MINECRAFT_1_16_2) >= 0 && version.compareTo(ProtocolVersion.MINECRAFT_1_19) < 0) { - CompoundBinaryTag currentDimDataTag = ProtocolUtils.readCompoundTag(buf, JOINGAME_READER); + this.currentDimensionData = ProtocolUtils.readCompoundTag(buf, JOINGAME_READER); dimensionIdentifier = ProtocolUtils.readString(buf); - this.currentDimensionData = DimensionData.decodeBaseCompoundTag(currentDimDataTag, version) - .annotateWith(dimensionIdentifier, null); } else { dimensionIdentifier = ProtocolUtils.readString(buf); levelName = ProtocolUtils.readString(buf); @@ -315,9 +270,11 @@ public class JoinGame implements MinecraftPacket { this.reducedDebugInfo = buf.readBoolean(); this.showRespawnScreen = buf.readBoolean(); + boolean isDebug = buf.readBoolean(); boolean isFlat = buf.readBoolean(); this.dimensionInfo = new DimensionInfo(dimensionIdentifier, levelName, isFlat, isDebug); + // optional death location if (version.compareTo(ProtocolVersion.MINECRAFT_1_19) >= 0 && buf.readBoolean()) { this.lastDeathPosition = Pair.of(ProtocolUtils.readString(buf), buf.readLong()); @@ -379,40 +336,25 @@ public class JoinGame implements MinecraftPacket { buf.writeByte(isHardcore ? gamemode | 0x8 : gamemode); } buf.writeByte(previousGamemode); - ProtocolUtils.writeStringArray(buf, dimensionRegistry.getLevelNames().toArray(new String[0])); - if (this.originalRegistryContainerTag != null) { - ProtocolUtils.writeCompoundTag(buf, this.originalRegistryContainerTag); - } else { - CompoundBinaryTag.Builder registryContainer = CompoundBinaryTag.builder(); - ListBinaryTag encodedDimensionRegistry = dimensionRegistry.encodeRegistry(version); - if (version.compareTo(ProtocolVersion.MINECRAFT_1_16_2) >= 0) { - CompoundBinaryTag.Builder dimensionRegistryEntry = CompoundBinaryTag.builder(); - dimensionRegistryEntry.putString("type", "minecraft:dimension_type"); - dimensionRegistryEntry.put("value", encodedDimensionRegistry); - registryContainer.put("minecraft:dimension_type", dimensionRegistryEntry.build()); - registryContainer.put("minecraft:worldgen/biome", biomeRegistry); - if (version.compareTo(ProtocolVersion.MINECRAFT_1_19) >= 0) { - registryContainer.put("minecraft:chat_type", chatTypeRegistry); - } - } else { - registryContainer.put("dimension", encodedDimensionRegistry); - } - ProtocolUtils.writeCompoundTag(buf, registryContainer.build()); - } + + ProtocolUtils.writeStringArray(buf, levelNames.toArray(String[]::new)); + ProtocolUtils.writeCompoundTag(buf, this.registry); if (version.compareTo(ProtocolVersion.MINECRAFT_1_16_2) >= 0 && version.compareTo(ProtocolVersion.MINECRAFT_1_19) < 0) { - ProtocolUtils.writeCompoundTag(buf, currentDimensionData.serializeDimensionDetails()); + ProtocolUtils.writeCompoundTag(buf, currentDimensionData); ProtocolUtils.writeString(buf, dimensionInfo.getRegistryIdentifier()); } else { ProtocolUtils.writeString(buf, dimensionInfo.getRegistryIdentifier()); ProtocolUtils.writeString(buf, dimensionInfo.getLevelName()); } + buf.writeLong(partialHashedSeed); if (version.compareTo(ProtocolVersion.MINECRAFT_1_16_2) >= 0) { ProtocolUtils.writeVarInt(buf, maxPlayers); } else { buf.writeByte(maxPlayers); } + ProtocolUtils.writeVarInt(buf, viewDistance); if (version.compareTo(ProtocolVersion.MINECRAFT_1_18) >= 0) { ProtocolUtils.writeVarInt(buf, simulationDistance); @@ -420,6 +362,7 @@ public class JoinGame implements MinecraftPacket { buf.writeBoolean(reducedDebugInfo); buf.writeBoolean(showRespawnScreen); + buf.writeBoolean(dimensionInfo.isDebugType()); buf.writeBoolean(dimensionInfo.isFlat()); diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/Respawn.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/Respawn.java index d75de12b2..11d543c89 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/Respawn.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/Respawn.java @@ -19,7 +19,6 @@ package com.velocitypowered.proxy.protocol.packet; import com.velocitypowered.api.network.ProtocolVersion; import com.velocitypowered.proxy.connection.MinecraftSessionHandler; -import com.velocitypowered.proxy.connection.registry.DimensionData; import com.velocitypowered.proxy.connection.registry.DimensionInfo; import com.velocitypowered.proxy.protocol.MinecraftPacket; import com.velocitypowered.proxy.protocol.ProtocolUtils; @@ -39,7 +38,7 @@ public class Respawn implements MinecraftPacket { private byte dataToKeep; // 1.16+ private DimensionInfo dimensionInfo; // 1.16-1.16.1 private short previousGamemode; // 1.16+ - private DimensionData currentDimensionData; // 1.16.2+ + private CompoundBinaryTag currentDimensionData; // 1.16.2+ private @Nullable Pair lastDeathPosition; // 1.19+ public Respawn() { @@ -47,7 +46,7 @@ public class Respawn implements MinecraftPacket { public Respawn(int dimension, long partialHashedSeed, short difficulty, short gamemode, String levelType, byte dataToKeep, DimensionInfo dimensionInfo, - short previousGamemode, DimensionData currentDimensionData, + short previousGamemode, CompoundBinaryTag currentDimensionData, @Nullable Pair lastDeathPosition) { this.dimension = dimension; this.partialHashedSeed = partialHashedSeed; @@ -155,10 +154,8 @@ public class Respawn implements MinecraftPacket { if (version.compareTo(ProtocolVersion.MINECRAFT_1_16) >= 0) { if (version.compareTo(ProtocolVersion.MINECRAFT_1_16_2) >= 0 && version.compareTo(ProtocolVersion.MINECRAFT_1_19) < 0) { - CompoundBinaryTag dimDataTag = ProtocolUtils.readCompoundTag(buf, BinaryTagIO.reader()); + this.currentDimensionData = ProtocolUtils.readCompoundTag(buf, BinaryTagIO.reader()); dimensionIdentifier = ProtocolUtils.readString(buf); - this.currentDimensionData = DimensionData.decodeBaseCompoundTag(dimDataTag, version) - .annotateWith(dimensionIdentifier, null); } else { dimensionIdentifier = ProtocolUtils.readString(buf); levelName = ProtocolUtils.readString(buf); @@ -198,7 +195,7 @@ public class Respawn implements MinecraftPacket { if (version.compareTo(ProtocolVersion.MINECRAFT_1_16) >= 0) { if (version.compareTo(ProtocolVersion.MINECRAFT_1_16_2) >= 0 && version.compareTo(ProtocolVersion.MINECRAFT_1_19) < 0) { - ProtocolUtils.writeCompoundTag(buf, currentDimensionData.serializeDimensionDetails()); + ProtocolUtils.writeCompoundTag(buf, currentDimensionData); ProtocolUtils.writeString(buf, dimensionInfo.getRegistryIdentifier()); } else { ProtocolUtils.writeString(buf, dimensionInfo.getRegistryIdentifier()); From 6a125bd08b8d824d927743213b9c979dfc4decbc Mon Sep 17 00:00:00 2001 From: Fejby <73366988+Fejby@users.noreply.github.com> Date: Fri, 31 Mar 2023 21:05:53 +0200 Subject: [PATCH 10/15] [ci skip] Update README.md (#990) Edit Velocity download link --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e4701ac2b..5de7436fd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Velocity -[![Build Status](https://img.shields.io/github/actions/workflow/status/PaperMC/Velocity/gradle.yml)](https://papermc.io/downloads#Velocity) +[![Build Status](https://img.shields.io/github/actions/workflow/status/PaperMC/Velocity/gradle.yml)](https://papermc.io/downloads/velocity) [![Join our Discord](https://img.shields.io/discord/289587909051416579.svg?logo=discord&label=)](https://discord.gg/papermc) A Minecraft server proxy with unparalleled server support, scalability, @@ -32,5 +32,5 @@ Once you've built Velocity, you can copy and run the `-all` JAR from `proxy/build/libs`. Velocity will generate a default configuration file and you can configure it from there. -Alternatively, you can get the proxy JAR from the [downloads](https://papermc.io/downloads#Velocity) +Alternatively, you can get the proxy JAR from the [downloads](https://papermc.io/downloads/velocity) page. From 2fa9f3748194fbaa237c94184ac1e166792a247b Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Sun, 9 Apr 2023 12:18:02 -0400 Subject: [PATCH 11/15] Delete copying temporary version of config.toml into temporary files Fixes #999 --- .../proxy/config/VelocityConfiguration.java | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java b/proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java index 9bc352ff6..cf91b21b4 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java @@ -451,17 +451,6 @@ public class VelocityConfiguration implements ProxyConfig { .build(); config.load(); - // Create temporary default configuration - File tmpFile = File.createTempFile("default-config", null); - tmpFile.deleteOnExit(); - - // Copy over default file to tmp location - try (InputStream in = defaultConfigLocation.openStream()) { - Files.copy(in, tmpFile.toPath(), StandardCopyOption.REPLACE_EXISTING); - } - CommentedFileConfig defaultConfig = CommentedFileConfig.of(tmpFile, TomlFormat.instance()); - defaultConfig.load(); - // TODO: migrate this on Velocity Polymer double configVersion; try { From d438422d52ca0d3ac55a3523aa99b45f0b31de61 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Sun, 9 Apr 2023 12:19:50 -0400 Subject: [PATCH 12/15] Get a bit more spotless --- .gitignore | 1 + .../velocitypowered/proxy/config/VelocityConfiguration.java | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index ad9eb5909..f90c93da9 100644 --- a/.gitignore +++ b/.gitignore @@ -82,6 +82,7 @@ gradle-app.setting ### Other trash ### logs/ /velocity.toml +/forwarding.secret server-icon.png /bin/ run/ diff --git a/proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java b/proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java index cf91b21b4..3afd9fc10 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/config/VelocityConfiguration.java @@ -20,7 +20,6 @@ package com.velocitypowered.proxy.config; import com.electronwill.nightconfig.core.CommentedConfig; import com.electronwill.nightconfig.core.UnmodifiableConfig; import com.electronwill.nightconfig.core.file.CommentedFileConfig; -import com.electronwill.nightconfig.toml.TomlFormat; import com.google.common.base.MoreObjects; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; @@ -29,15 +28,12 @@ import com.velocitypowered.api.proxy.config.ProxyConfig; import com.velocitypowered.api.util.Favicon; import com.velocitypowered.proxy.util.AddressUtil; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import java.io.File; import java.io.IOException; -import java.io.InputStream; import java.net.InetSocketAddress; import java.net.URL; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.StandardCopyOption; import java.security.SecureRandom; import java.util.HashMap; import java.util.List; From e364e2c7d1918ec7c20986fb640f3f6a64127bb0 Mon Sep 17 00:00:00 2001 From: Adrian <68704415+4drian3d@users.noreply.github.com> Date: Sun, 9 Apr 2023 11:23:39 -0500 Subject: [PATCH 13/15] feat: Warn if an attempt is made to register a command with multiple interfaces implemented instead of just ignoring it (#1000) --- .../proxy/command/VelocityCommandManager.java | 45 ++++++++++++------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommandManager.java b/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommandManager.java index 8e3e20f27..c4cacaf5f 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommandManager.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommandManager.java @@ -39,6 +39,7 @@ import com.velocitypowered.proxy.command.registrar.CommandRegistrar; import com.velocitypowered.proxy.command.registrar.RawCommandRegistrar; import com.velocitypowered.proxy.command.registrar.SimpleCommandRegistrar; import com.velocitypowered.proxy.event.VelocityEventManager; +import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Locale; @@ -47,7 +48,7 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; -import net.kyori.adventure.identity.Identity; +import java.util.stream.Collectors; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.format.NamedTextColor; import org.checkerframework.checker.lock.qual.GuardedBy; @@ -114,14 +115,21 @@ public class VelocityCommandManager implements CommandManager { Preconditions.checkNotNull(meta, "meta"); Preconditions.checkNotNull(command, "command"); - // TODO Warn if command implements multiple registrable interfaces? - for (final CommandRegistrar registrar : this.registrars) { - if (this.tryRegister(registrar, command, meta)) { - return; // success - } + final List> commandRegistrars = this.implementedRegistrars(command); + if (commandRegistrars.isEmpty()) { + throw new IllegalArgumentException( + command + " does not implement a registrable Command subinterface"); + } else if (commandRegistrars.size() > 1) { + final String implementedInterfaces = commandRegistrars.stream() + .map(CommandRegistrar::registrableSuperInterface) + .map(Class::getSimpleName) + .collect(Collectors.joining(", ")); + throw new IllegalArgumentException( + command + " implements multiple registrable Command subinterfaces: " + + implementedInterfaces); + } else { + this.internalRegister(commandRegistrars.get(0), command, meta); } - throw new IllegalArgumentException( - command + " does not implement a registrable Command subinterface"); } /** @@ -133,21 +141,26 @@ public class VelocityCommandManager implements CommandManager { * @param command the command to register * @param meta the command metadata * @param the type of the command - * @return true if the command implements the registrable superinterface of the registrar; false - * otherwise. * @throws IllegalArgumentException if the registrar cannot register the command */ - private boolean tryRegister(final CommandRegistrar registrar, + private void internalRegister(final CommandRegistrar registrar, final Command command, final CommandMeta meta) { final Class superInterface = registrar.registrableSuperInterface(); - if (!superInterface.isInstance(command)) { - return false; - } registrar.register(meta, superInterface.cast(command)); for (String alias : meta.getAliases()) { commandMetas.put(alias, meta); } - return true; + } + + private List> implementedRegistrars(final Command command) { + final List> registrarsFound = new ArrayList<>(2); + for (final CommandRegistrar registrar : this.registrars) { + final Class superInterface = registrar.registrableSuperInterface(); + if (superInterface.isInstance(command)) { + registrarsFound.add(registrar); + } + } + return registrarsFound; } @Override @@ -215,7 +228,7 @@ public class VelocityCommandManager implements CommandManager { boolean isSyntaxError = !e.getType().equals( CommandSyntaxException.BUILT_IN_EXCEPTIONS.dispatcherUnknownCommand()); if (isSyntaxError) { - source.sendMessage(Identity.nil(), Component.text(e.getMessage(), NamedTextColor.RED)); + source.sendMessage(Component.text(e.getMessage(), NamedTextColor.RED)); // This is, of course, a lie, but the API will need to change... return true; } else { From 1161482fcea831037383be9125927aa9e2246954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20St=C3=A4ding?= Date: Wed, 19 Apr 2023 23:43:25 +0200 Subject: [PATCH 14/15] Upgradle to v8.1 and remove now-redundant warnings (#1001) --- buildSrc/build.gradle.kts | 1 - gradle/wrapper/gradle-wrapper.properties | 2 +- proxy/build.gradle.kts | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 95806a655..e65c26037 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -1,4 +1,3 @@ -@Suppress("DSL_SCOPE_VIOLATION") // fixed in Gradle 8.1 plugins { `kotlin-dsl` checkstyle diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index bdc9a83b1..0c85a1f75 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/proxy/build.gradle.kts b/proxy/build.gradle.kts index 486e1f7bd..997ddd467 100644 --- a/proxy/build.gradle.kts +++ b/proxy/build.gradle.kts @@ -1,6 +1,5 @@ import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer -@Suppress("DSL_SCOPE_VIOLATION") // fixed in Gradle 8.1 plugins { application `set-manifest-impl-version` From 7f776abf550001186a1f11f4e5ff760dd66e3b04 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Wed, 19 Apr 2023 23:22:14 -0400 Subject: [PATCH 15/15] Upgrade Adventure --- gradle/libs.versions.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 1d3ff2154..e2e762c01 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -10,8 +10,8 @@ shadow = "com.github.johnrengelman.shadow:8.1.0" spotless = "com.diffplug.spotless:6.12.0" [libraries] -adventure-bom = "net.kyori:adventure-bom:4.12.0" -adventure-facet = "net.kyori:adventure-platform-facet:4.2.0" +adventure-bom = "net.kyori:adventure-bom:4.13.1" +adventure-facet = "net.kyori:adventure-platform-facet:4.3.0" asynchttpclient = "org.asynchttpclient:async-http-client:2.12.3" brigadier = "com.velocitypowered:velocity-brigadier:1.0.0-SNAPSHOT" bstats = "org.bstats:bstats-base:3.0.1"