Skip to content

Commit 4a32358

Browse files
Merge branch 'dev/3.0.0' into ping-passthrough-dev
2 parents 2c41819 + 54bf6b3 commit 4a32358

Some content is hidden

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

41 files changed

+685
-200
lines changed

.github/workflows/gradle.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
persist-credentials: false
1515
- name: Set up Gradle
1616
uses: gradle/actions/setup-gradle@v4
17-
- name: Set up JDK 17
17+
- name: Set up JDK 21
1818
uses: actions/setup-java@v4
1919
with:
20-
java-version: 17
21-
distribution: 'temurin'
20+
java-version: 21
21+
distribution: 'zulu'
2222
- name: Build with Gradle
2323
run: ./gradlew build

api/src/main/java/com/velocitypowered/api/command/CommandManager.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77

88
package com.velocitypowered.api.command;
99

10+
import com.mojang.brigadier.suggestion.Suggestions;
1011
import com.velocitypowered.api.event.command.CommandExecuteEvent;
1112
import java.util.Collection;
13+
import java.util.List;
1214
import java.util.concurrent.CompletableFuture;
1315
import java.util.function.Predicate;
1416
import org.checkerframework.checker.nullness.qual.Nullable;
@@ -116,6 +118,27 @@ default void register(String alias, Command command, String... otherAliases) {
116118
*/
117119
CompletableFuture<Boolean> executeImmediatelyAsync(CommandSource source, String cmdLine);
118120

121+
/**
122+
* Asynchronously collects suggestions to fill in the given command {@code cmdLine}.
123+
* Returns only the raw completion suggestions without tooltips.
124+
*
125+
* @param source the source to execute the command for
126+
* @param cmdLine the partially completed command
127+
* @return a {@link CompletableFuture} eventually completed with a {@link List}, possibly empty
128+
*/
129+
CompletableFuture<List<String>> offerSuggestions(CommandSource source, String cmdLine);
130+
131+
/**
132+
* Asynchronously collects suggestions to fill in the given command {@code cmdLine}.
133+
* Returns the brigadier {@link Suggestions} with tooltips for each result.
134+
*
135+
* @param source the source to execute the command for
136+
* @param cmdLine the partially completed command
137+
* @return a {@link CompletableFuture} eventually completed with {@link Suggestions}, possibly
138+
* empty
139+
*/
140+
CompletableFuture<Suggestions> offerBrigadierSuggestions(CommandSource source, String cmdLine);
141+
119142
/**
120143
* Returns an immutable collection of the case-insensitive aliases registered
121144
* on this manager.

api/src/main/java/com/velocitypowered/api/network/ProtocolVersion.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ public boolean isSupported() {
9090
MINECRAFT_1_21(767, "1.21", "1.21.1"),
9191
MINECRAFT_1_21_2(768, "1.21.2", "1.21.3"),
9292
MINECRAFT_1_21_4(769, "1.21.4"),
93-
MINECRAFT_1_21_5(770, /*1073742067,*/ "1.21.5");
93+
MINECRAFT_1_21_5(770, "1.21.5"),
94+
MINECRAFT_1_21_6(771, "1.21.6"),
95+
MINECRAFT_1_21_7(772, "1.21.7", "1.21.8");
9496

9597
private static final int SNAPSHOT_BIT = 30;
9698

build-logic/src/main/kotlin/velocity-init-manifest.gradle.kts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,15 @@ import org.gradle.jvm.tasks.Jar
22
import org.gradle.kotlin.dsl.withType
33
import java.io.ByteArrayOutputStream
44

5+
// This interface is needed as a workaround to get an instance of ExecOperations
6+
interface Injected {
7+
@get:Inject
8+
val execOps: ExecOperations
9+
}
10+
511
val currentShortRevision = ByteArrayOutputStream().use {
6-
exec {
12+
val execOps = objects.newInstance<Injected>().execOps
13+
execOps.exec {
714
executable = "git"
815
args = listOf("rev-parse", "HEAD")
916
standardOutput = it

build-logic/src/main/kotlin/velocity-publish.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ extensions.configure<PublishingExtension> {
88
maven {
99
credentials(PasswordCredentials::class.java)
1010

11-
name = "paper"
11+
name = if (version.toString().endsWith("SNAPSHOT")) "paperSnapshots" else "paper" // "paper" is seemingly not defined
1212
val base = "https://repo.papermc.io/repository/maven"
1313
val releasesRepoUrl = "$base-releases/"
1414
val snapshotsRepoUrl = "$base-snapshots/"

build.gradle.kts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ subprojects {
2020
testImplementation(rootProject.libs.junit)
2121
}
2222

23-
tasks {
24-
test {
25-
useJUnitPlatform()
26-
reports {
27-
junitXml.required.set(true)
23+
testing.suites.named<JvmTestSuite>("test") {
24+
useJUnitJupiter()
25+
targets.all {
26+
testTask.configure {
27+
reports.junitXml.required = true
2828
}
2929
}
3030
}

gradle/libs.versions.toml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,20 @@
22
configurate3 = "3.7.3"
33
configurate4 = "4.1.2"
44
flare = "2.0.1"
5-
log4j = "2.24.1"
6-
netty = "4.2.0.Final"
5+
log4j = "2.24.3"
6+
netty = "4.2.4.Final"
77

88
[plugins]
9+
fill = "io.papermc.fill.gradle:1.0.3"
910
indra-publishing = "net.kyori.indra.publishing:2.0.6"
10-
shadow = "io.github.goooler.shadow:8.1.5"
11+
shadow = "com.gradleup.shadow:8.3.6"
1112
spotless = "com.diffplug.spotless:6.25.0"
1213

1314
[libraries]
14-
adventure-bom = "net.kyori:adventure-bom:4.19.0"
15-
adventure-text-serializer-json-legacy-impl = "net.kyori:adventure-text-serializer-json-legacy-impl:4.19.0"
15+
adventure-bom = "net.kyori:adventure-bom:4.24.0"
16+
adventure-text-serializer-json-legacy-impl = "net.kyori:adventure-text-serializer-json-legacy-impl:4.24.0"
1617
adventure-facet = "net.kyori:adventure-platform-facet:4.3.4"
17-
asm = "org.ow2.asm:asm:9.7.1"
18+
asm = "org.ow2.asm:asm:9.8"
1819
auto-service = "com.google.auto.service:auto-service:1.0.1"
1920
auto-service-annotations = "com.google.auto.service:auto-service-annotations:1.0.1"
2021
brigadier = "com.velocitypowered:velocity-brigadier:1.0.0-SNAPSHOT"
@@ -33,7 +34,7 @@ disruptor = "com.lmax:disruptor:4.0.0"
3334
fastutil = "it.unimi.dsi:fastutil:8.5.15"
3435
flare-core = { module = "space.vectrix.flare:flare", version.ref = "flare" }
3536
flare-fastutil = { module = "space.vectrix.flare:flare-fastutil", version.ref = "flare" }
36-
jline = "org.jline:jline-terminal-jansi:3.27.1"
37+
jline = "org.jline:jline-terminal-jansi:3.30.2"
3738
jopt = "net.sf.jopt-simple:jopt-simple:5.0.4"
3839
junit = "org.junit.jupiter:junit-jupiter:5.10.2"
3940
jspecify = "org.jspecify:jspecify:0.3.0"
@@ -56,7 +57,7 @@ netty-transport-native-epoll = { module = "io.netty:netty-transport-native-epoll
5657
netty-transport-native-kqueue = { module = "io.netty:netty-transport-native-kqueue", version.ref = "netty" }
5758
netty-transport-native-iouring = { module = "io.netty:netty-transport-native-io_uring", version.ref = "netty" }
5859
nightconfig = "com.electronwill.night-config:toml:3.6.7"
59-
slf4j = "org.slf4j:slf4j-api:2.0.12"
60+
slf4j = "org.slf4j:slf4j-api:2.0.17"
6061
snakeyaml = "org.yaml:snakeyaml:1.33"
6162
spotbugs-annotations = "com.github.spotbugs:spotbugs-annotations:4.7.3"
6263
terminalconsoleappender = "net.minecrell:terminalconsoleappender:1.3.0"

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.11.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

proxy/build.gradle.kts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer
2+
import io.papermc.fill.model.BuildChannel
23

34
plugins {
45
application
56
id("velocity-init-manifest")
67
alias(libs.plugins.shadow)
8+
alias(libs.plugins.fill)
79
}
810

911
application {
@@ -100,13 +102,32 @@ tasks {
100102
runShadow {
101103
workingDir = file("run").also(File::mkdirs)
102104
standardInput = System.`in`
105+
jvmArgs("-Dvelocity.packet-decode-logging=true")
103106
}
104107
named<JavaExec>("run") {
105108
workingDir = file("run").also(File::mkdirs)
106109
standardInput = System.`in` // Doesn't work?
107110
}
108111
}
109112

113+
val projectVersion = version as String
114+
fill {
115+
project("velocity")
116+
117+
build {
118+
channel = BuildChannel.STABLE
119+
versionFamily("3.0.0")
120+
version(projectVersion)
121+
122+
downloads {
123+
register("server:default") {
124+
file = tasks.shadowJar.flatMap { it.archiveFile }
125+
nameResolver.set { project, _, version, build -> "$project-$version-$build.jar" }
126+
}
127+
}
128+
}
129+
}
130+
110131
dependencies {
111132
implementation(project(":velocity-api"))
112133
implementation(project(":velocity-native"))

proxy/src/main/java/com/velocitypowered/proxy/Velocity.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ public class Velocity {
4747
System.setProperty("io.netty.native.workdir", System.getProperty("velocity.natives-tmpdir"));
4848
}
4949

50+
// Restore allocator used before Netty 4.2 due to oom issues with the adaptive allocator
51+
if (System.getProperty("io.netty.allocator.type") == null) {
52+
System.setProperty("io.netty.allocator.type", "pooled");
53+
}
54+
5055
// Disable the resource leak detector by default as it reduces performance. Allow the user to
5156
// override this if desired.
5257
if (!VelocityProperties.hasProperty("io.netty.leakDetection.level")) {

0 commit comments

Comments
 (0)