Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v5
with:
java-version: 21
java-version: 25
distribution: 'temurin'

- name: Setup Gradle
Expand Down
13 changes: 13 additions & 0 deletions build-logic/src/main/kotlin/buildlogic.adapter.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,19 @@ plugins {
id("io.papermc.paperweight.userdev")
}

java {
// Required when we de-sync release option and declared Java versions.
disableAutoTargetJvm()
}

tasks
.withType<JavaCompile>()
.matching { it.name == "compileJava" || it.name == "compileTestJava" }
.configureEach {
// We use Java 21 for most of the pre-existing adapters.
options.release.set(21)
}

repositories {
maven {
name = "Minecraft Libraries"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ tasks
val disabledLint = listOf(
"processing", "path", "fallthrough", "serial", "overloads", "this-escape",
)
options.release.set(21)
options.release.set(25)
options.compilerArgs.addAll(listOf("-Xlint:all") + disabledLint.map { "-Xlint:-$it" })
options.isDeprecation = true
options.encoding = "UTF-8"
Expand Down
2 changes: 1 addition & 1 deletion build-logic/src/main/kotlin/buildlogic.common.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ configurations.all {

plugins.withId("java") {
the<JavaPluginExtension>().toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
languageVersion.set(JavaLanguageVersion.of(25))
}
}

Expand Down
50 changes: 50 additions & 0 deletions build-logic/src/main/kotlin/buildlogic/cuiProtocolRules.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package buildlogic

import org.gradle.api.Project
import org.gradle.api.artifacts.CacheableRule
import org.gradle.api.artifacts.ComponentMetadataContext
import org.gradle.api.artifacts.ComponentMetadataRule
import org.gradle.api.artifacts.ModuleIdentifier
import org.gradle.kotlin.dsl.withModule
import javax.inject.Inject

/**
* CUI protocol jars depend on the common protocol jar, but currently don't declare that properly.
* This rule adds the common protocol as a dependency to all CUI protocol variants, so that Gradle can properly resolve
* it.
*/
@CacheableRule
abstract class CuiProtocolDependsOnCommonRule @Inject constructor(val cuiProtocolCommonDependency: String) : ComponentMetadataRule {
override fun execute(context: ComponentMetadataContext) {
context.details.allVariants {
withDependencies {
add(cuiProtocolCommonDependency)
}
}
}
}

/**
* The common CUI protocol jar has a fabric-loader dependency, for whatever reason.
* This rule removes it because the common protocol should be platform-agnostic and not depend on a specific loader.
*/
@CacheableRule
abstract class CuiProtocolCommonIsNotFabricSpecificRule @Inject constructor() : ComponentMetadataRule {
override fun execute(context: ComponentMetadataContext) {
context.details.allVariants {
withDependencies {
removeIf { it.group == "net.fabricmc" && it.name == "fabric-loader" }
}
}
}
}

fun Project.withCuiProtocolDependsOnCommonRule(module: ModuleIdentifier) {
dependencies.components {
val cuiProtoCommon = stringyLibs.getLibrary("cuiProtocol-common").get()
withModule<CuiProtocolDependsOnCommonRule>(module) {
params(cuiProtoCommon.toString())
}
withModule<CuiProtocolCommonIsNotFabricSpecificRule>(cuiProtoCommon.module)
}
}
2 changes: 1 addition & 1 deletion gradle/gradle-daemon-jvm.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#This file is generated by updateDaemonJvm
toolchainVersion=21
toolchainVersion=25
39 changes: 20 additions & 19 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,28 @@
neogradle-userdev = { id = "net.neoforged.gradle.userdev", version.ref = "neogradle" }
sponge-spongegradle = "org.spongepowered.gradle.plugin:2.3.0"
sponge-vanillagradle = { id = "org.spongepowered.gradle.vanilla", version.ref = "sponge-vanillagradle" }
fabric-loom = "net.fabricmc.fabric-loom:1.15.5"

[versions]
kyoriText = "3.0.4"
piston = "0.5.11"
autoValue = "1.10.4"
antlr = "4.13.2"
cuiProtocol = "4.0.2"
cuiProtocol = "4.0.3"

errorprone = "2.48.0"

fabric-api = "0.141.3+1.21.11"
fabric-api = "0.144.0+26.1"

neogradle = "7.1.20"
neoforge-minecraft = "1.21.11"
neogradle = "7.1.21"
neoforge-minecraft = "26.1"

sponge-minecraft = "1.21.11"
sponge-minecraft = "26.1"
# https://repo.spongepowered.org/service/rest/repository/browse/maven-public/org/spongepowered/spongeapi/
sponge-api = "18.0.0-20260220.200840-5"
sponge-api-major = "18"
sponge-api = "19.0.0-20260328.013918-1"
sponge-api-major = "19"

# https://parchmentmc.org/docs/getting-started; note that we use older MC versions some times which is OK
parchment-minecraft = "1.21.11"
parchment-mappings = "2025.12.20"

sponge-vanillagradle = "0.2.2"
sponge-vanillagradle = "0.3.2"

# Minimum versions we apply to make dependencies support newer Java
minimumAsm = "9.7"
Expand Down Expand Up @@ -74,7 +71,7 @@ junit-platform-launcher.module = "org.junit.platform:junit-platform-launcher"

jqwik = "net.jqwik:jqwik:1.9.0"

mockito-bom = "org.mockito:mockito-bom:5.11.0"
mockito-bom = "org.mockito:mockito-bom:5.22.0"
mockito-core.module = "org.mockito:mockito-core"
mockito-junit-jupiter.module = "org.mockito:mockito-junit-jupiter"

Expand All @@ -93,15 +90,15 @@ rhino = "org.mozilla:rhino-runtime:1.7.13"
jchronic = "com.sk89q:jchronic:0.2.4a"
jlibnoise = "com.sk89q.lib:jlibnoise:1.0.0"

fabric-minecraft = "com.mojang:minecraft:1.21.11"
fabric-minecraft = "com.mojang:minecraft:26.1"
fabric-loader = "net.fabricmc:fabric-loader:0.18.4"
fabric-permissions-api = "me.lucko:fabric-permissions-api:0.6.1"
fabric-permissions-api = "me.lucko:fabric-permissions-api:0.7.0"

neoforge = "net.neoforged:neoforge:21.11.38-beta"
neoforge = "net.neoforged:neoforge:26.1.0.1-beta"

# Mojang-provided libraries, CHECK AGAINST MINECRAFT for versions
guava = "com.google.guava:guava:33.5.0-jre!!"
log4j-bom = "org.apache.logging.log4j:log4j-bom:2.24.1!!"
log4j-bom = "org.apache.logging.log4j:log4j-bom:2.25.2!!"
log4j-api.module = "org.apache.logging.log4j:log4j-api"
log4j-core.module = "org.apache.logging.log4j:log4j-core"
gson = "com.google.code.gson:gson:2.13.2!!"
Expand Down Expand Up @@ -167,10 +164,14 @@ version.ref = "antlr"
[libraries.antlr4-runtime]
module = "org.antlr:antlr4-runtime"

[libraries.cuiProtocol-common]
module = "org.enginehub.worldeditcui-protocol:worldeditcui-protocol-common-mc26.1"
version.ref = "cuiProtocol"

[libraries.cuiProtocol-fabric]
module = "org.enginehub.worldeditcui-protocol:worldeditcui-protocol-fabric-mc1.21.11"
module = "org.enginehub.worldeditcui-protocol:worldeditcui-protocol-fabric-mc26.1"
version.ref = "cuiProtocol"

[libraries.cuiProtocol-neoforge]
module = "org.enginehub.worldeditcui-protocol:worldeditcui-protocol-neoforge-mc1.21.11"
module = "org.enginehub.worldeditcui-protocol:worldeditcui-protocol-neoforge-mc26.1"
version.ref = "cuiProtocol"
11 changes: 6 additions & 5 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,9 @@ pluginManagement {
}
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
id("fabric-loom") version "1.15.4"
}
dependencyResolutionManagement {
repositories {
maven {
name = "ParchmentMC"
url = uri("https://maven.parchmentmc.org/")
}
maven {
name = "PaperMC"
url = uri("https://repo.papermc.io/repository/maven-public/")
Expand All @@ -41,6 +36,7 @@ dependencyResolutionManagement {
name = "EngineHub (Non-Mirrored)"
url = URI.create("https://repo.enginehub.org/libs-release/")
metadataSources {
gradleMetadata()
mavenPom()
artifact()
}
Expand All @@ -59,6 +55,11 @@ dependencyResolutionManagement {
includeModuleByRegex(".*", "worldedit-lang")
}
}
mavenCentral()
maven {
name = "Minecraft Libraries"
url = uri("https://libraries.minecraft.net/")
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,8 @@ public boolean isActive() {
updateActive();
} else {
// we should update it eventually
// Suppress FutureReturnValueIgnored: We handle it in the block.
@SuppressWarnings({"FutureReturnValueIgnored", "unused"})
var unused = Bukkit.getScheduler().callSyncMethod(plugin, () -> {
// We don't need the future as we handle exceptions in `updateActive`
var _ = Bukkit.getScheduler().callSyncMethod(plugin, () -> {
updateActive();
return null;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public boolean setLocation(Location location) {
org.bukkit.entity.Entity entity = entityRef.get();
if (entity != null) {
if (WorldEditPlugin.getInstance().isFolia()) {
var unused = PaperLib.teleportAsync(entity, BukkitAdapter.adapt(location));
var _ = PaperLib.teleportAsync(entity, BukkitAdapter.adapt(location));
return true;
} else {
return entity.teleport(BukkitAdapter.adapt(location));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public boolean trySetPosition(Vector3 pos, float pitch, float yaw) {
Location location = new Location(player.getWorld(), pos.x(), pos.y(),
pos.z(), yaw, pitch);
if (WorldEditPlugin.getInstance().isFolia()) {
var unused = PaperLib.teleportAsync(player, location);
var _ = PaperLib.teleportAsync(player, location);
return true;
} else {
return player.teleport(location);
Expand Down Expand Up @@ -232,7 +232,7 @@ public com.sk89q.worldedit.util.Location getLocation() {
@Override
public boolean setLocation(com.sk89q.worldedit.util.Location location) {
if (WorldEditPlugin.getInstance().isFolia()) {
var unused = PaperLib.teleportAsync(player, BukkitAdapter.adapt(location));
var _ = PaperLib.teleportAsync(player, BukkitAdapter.adapt(location));
return true;
} else {
return player.teleport(BukkitAdapter.adapt(location));
Expand Down
2 changes: 1 addition & 1 deletion worldedit-core/doctools/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
kotlin("jvm") version "2.2.21"
kotlin("jvm") version "2.3.10"
application
id("buildlogic.common")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,13 @@ public ListenableFuture<T> buildAndExec(ListeningExecutorService executor) {
return future;
}

// Suppress FutureReturnValueIgnored: We handle the future internally
@SuppressWarnings("FutureReturnValueIgnored")
/**
* Like {@link #buildAndExec(ListeningExecutorService)}, but ignores the return value of the task.
*
* @param executor the executor to run the task on
*/
public void buildAndExecNoReturnValue(ListeningExecutorService executor) {
buildAndExec(executor);
var _ = buildAndExec(executor);
}

@SuppressWarnings("deprecation")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ protected Context makeContext() {
RhinoContext cx = new RhinoContext(this);
try {
// Try to set ES6 compat flag (since 1.7.7)
@SuppressWarnings("unused")
var unused = Context.class.getDeclaredField("VERSION_ES6");
var _ = Context.class.getDeclaredField("VERSION_ES6");
cx.setLanguageVersion(RhinoContext.VERSION_ES6);
} catch (NoSuchFieldException e) {
// best we can do, compatible with 1.7R2 that many people probably use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public synchronized void close() throws SecurityException {
}

@Override
public void setEncoding(@Nullable String encoding) throws SecurityException, UnsupportedEncodingException {
public synchronized void setEncoding(@Nullable String encoding) throws SecurityException, UnsupportedEncodingException {
StreamHandler handler = this.handler;
this.encoding = encoding;
if (handler != null) {
Expand All @@ -117,7 +117,7 @@ public synchronized void flush() {
}

@Override
public void setFormatter(@Nullable Formatter newFormatter) throws SecurityException {
public synchronized void setFormatter(@Nullable Formatter newFormatter) throws SecurityException {
StreamHandler handler = this.handler;
this.formatter = newFormatter;
if (handler != null) {
Expand Down Expand Up @@ -150,7 +150,7 @@ public String getEncoding() {
}

@Override
public void setFilter(@Nullable Filter newFilter) throws SecurityException {
public synchronized void setFilter(@Nullable Filter newFilter) throws SecurityException {
StreamHandler handler = this.handler;
this.filter = newFilter;
if (handler != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public LogFormat(String format) {
try {
// Validate format:
@SuppressWarnings("unused")
var unused = String.format(format, currentDateTime, "", "", "", "", "");
var _ = String.format(format, currentDateTime, "", "", "", "", "");
} catch (IllegalArgumentException var3) {
format = DEFAULT_FORMAT;
}
Expand Down
Loading