diff --git a/buildSrc/src/main/kotlin/AdapterConfig.kt b/buildSrc/src/main/kotlin/AdapterConfig.kt index 6cad58e3b8..60f9a5733f 100644 --- a/buildSrc/src/main/kotlin/AdapterConfig.kt +++ b/buildSrc/src/main/kotlin/AdapterConfig.kt @@ -15,7 +15,6 @@ fun Project.applyPaperweightAdapterConfiguration() { dependencies { "implementation"(project(":worldedit-bukkit")) - "implementation"(platform("com.intellectualsites.bom:bom-newest:1.33")) } tasks.named("assemble") { diff --git a/buildSrc/src/main/kotlin/CommonJavaConfig.kt b/buildSrc/src/main/kotlin/CommonJavaConfig.kt index 73389ce835..549a260370 100644 --- a/buildSrc/src/main/kotlin/CommonJavaConfig.kt +++ b/buildSrc/src/main/kotlin/CommonJavaConfig.kt @@ -40,12 +40,11 @@ fun Project.applyCommonJavaConfiguration(sourcesJar: Boolean, banSlf4j: Boolean dependencies { "compileOnly"("com.google.code.findbugs:jsr305:3.0.2") - "testImplementation"("org.junit.jupiter:junit-jupiter-api:5.9.2") - "testImplementation"("org.junit.jupiter:junit-jupiter-params:5.9.2") - "testImplementation"("org.mockito:mockito-core:5.1.1") - "testImplementation"("org.mockito:mockito-junit-jupiter:5.1.1") - "testRuntimeOnly"("org.junit.jupiter:junit-jupiter-engine:5.9.2") - "implementation"(platform("com.intellectualsites.bom:bom-newest:1.33")) + "testImplementation"("org.junit.jupiter:junit-jupiter-api:5.10.0") + "testImplementation"("org.junit.jupiter:junit-jupiter-params:5.10.0") + "testImplementation"("org.mockito:mockito-core:5.4.0") + "testImplementation"("org.mockito:mockito-junit-jupiter:5.4.0") + "testRuntimeOnly"("org.junit.jupiter:junit-jupiter-engine:5.10.0") } // Java 8 turns on doclint which we fail diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3f463bc9c4..e694c8c8dc 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,8 +1,11 @@ [versions] # Minecraft expectations +paper = "1.20.1-R0.1-SNAPSHOT" fastutil = "8.5.9" guava = "31.1-jre" log4j = "2.19.0" +gson = "2.10" +snakeyaml = "2.0" # Plugins dummypermscompat = "1.10" @@ -12,12 +15,15 @@ griefprevention = "16.18.1" griefdefender = "2.1.0-SNAPSHOT" residence = "4.5._13.1" towny = "0.99.5.7" +plotsquared = "7.0.0-rc.4" # Third party bstats = "3.0.2" sparsebitset = "1.2" parallelgzip = "1.0.5" adventure = "4.14.0" +adventure-bukkit = "4.3.0" +checkerqual = "3.37.0" truezip = "6.8.4" auto-value = "1.10.2" findbugs = "3.0.2" @@ -29,6 +35,11 @@ jlibnoise = "1.0.0" jchronic = "0.2.4a" lz4-java = "1.8.0" lz4-stream = "1.0.0" +commons-cli = "1.5.0" +paperlib = "1.0.8" +paster = "1.1.5" +vault = "1.7.1" +serverlib = "2.3.1" ## Internal text-adapter = "3.0.6" text = "3.0.4" @@ -39,12 +50,17 @@ mockito = "5.4.0" # Gradle plugins pluginyml = "0.6.0" +minotaur = "2.8.3" [libraries] # Minecraft expectations +paper = { group = "io.papermc.paper", name = "paper-api", version.ref = "paper" } fastutil = { group = "it.unimi.dsi", name = "fastutil", version.ref = "fastutil" } log4jBom = { group = "org.apache.logging.log4j", name = "log4j-bom", version.ref = "log4j" } +log4jApi = { group = "org.apache.logging.log4j", name = "log4j-api", version.ref = "log4j" } guava = { group = "com.google.guava", name = "guava", version.ref = "guava" } +gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" } +snakeyaml = { group = "org.yaml", name = "snakeyaml", version.ref = "snakeyaml" } # Plugins dummypermscompat = { group = "com.sk89q", name = "dummypermscompat", version.ref = "dummypermscompat" } @@ -54,9 +70,12 @@ griefprevention = { group = "com.github.TechFortress", name = "GriefPrevention", griefdefender = { group = "com.griefdefender", name = "api", version.ref = "griefdefender" } residence = { group = "com.bekvon.bukkit.residence", name = "Residence", version.ref = "residence" } towny = { group = "com.palmergames.bukkit.towny", name = "towny", version.ref = "towny" } +plotSquaredCore = { group = "com.intellectualsites.plotsquared", name = "plotsquared-core", version.ref = "plotsquared" } +plotSquaredBukkit = { group = "com.intellectualsites.plotsquared", name = "plotsquared-bukkit", version.ref = "plotsquared" } # Third Party bstatsBase = { group = "org.bstats", name = "bstats-base", version.ref = "bstats" } +bstatsBukkit = { group = "org.bstats", name = "bstats-bukkit", version.ref = "bstats" } sparsebitset = { group = "com.zaxxer", name = "SparseBitSet", version.ref = "sparsebitset" } parallelgzip = { group = "org.anarres", name = "parallelgzip", version.ref = "parallelgzip" } adventureNbt = { group = "net.kyori", name = "adventure-nbt", version.ref = "adventure" } @@ -73,6 +92,15 @@ jlibnoise = { group = "com.sk89q.lib", name = "jlibnoise", version.ref = "jlibno jchronic = { group = "com.sk89q", name = "jchronic", version.ref = "jchronic" } lz4Java = { group = "org.lz4", name = "lz4-java", version.ref = "lz4-java" } lz4JavaStream = { group = "net.jpountz", name = "lz4-java-stream", version.ref = "lz4-stream" } +commonsCli = { group = "commons-cli", name = "commons-cli", version.ref = "commons-cli" } +paperlib = { group = "io.papermc", name = "paperlib", version.ref = "paperlib" } +adventureApi = { group = "net.kyori", name = "adventure-api", version.ref = "adventure" } +adventureMiniMessage = { group = "net.kyori", name = "adventure-text-minimessage", version.ref = "adventure" } +adventureBukkit = { group = "net.kyori", name = "adventure-platform-bukkit", version.ref = "adventure-bukkit" } +paster = { group = "com.intellectualsites.paster", name = "Paster", version.ref = "paster" } +vault = { group = "com.github.MilkBowl", name = "VaultAPI", version.ref = "vault" } +serverlib = { group = "dev.notmyfault.serverlib", name = "ServerLib", version.ref = "serverlib" } +checkerqual = { group = "org.checkerframework", name = "checker-qual", version.ref = "checkerqual" } # Internal ## Text @@ -94,3 +122,4 @@ log4jCore = { group = "org.apache.logging.log4j", name = "log4j-core", version.r [plugins] pluginyml = { id = "net.minecrell.plugin-yml.bukkit", version.ref = "pluginyml" } +minotaur = { id = "com.modrinth.minotaur", version.ref = "minotaur" } diff --git a/worldedit-bukkit/adapters/adapter-1_17_1/build.gradle.kts b/worldedit-bukkit/adapters/adapter-1_17_1/build.gradle.kts index 940dfcb0b5..24c121c3f8 100644 --- a/worldedit-bukkit/adapters/adapter-1_17_1/build.gradle.kts +++ b/worldedit-bukkit/adapters/adapter-1_17_1/build.gradle.kts @@ -22,5 +22,5 @@ configurations.all { dependencies { the().paperDevBundle("1.17.1-R0.1-20220414.034903-210") - compileOnly("io.papermc:paperlib") + compileOnly(libs.paperlib) } diff --git a/worldedit-bukkit/adapters/adapter-1_18_2/build.gradle.kts b/worldedit-bukkit/adapters/adapter-1_18_2/build.gradle.kts index aaa4643d24..f7f40ce664 100644 --- a/worldedit-bukkit/adapters/adapter-1_18_2/build.gradle.kts +++ b/worldedit-bukkit/adapters/adapter-1_18_2/build.gradle.kts @@ -13,5 +13,5 @@ repositories { dependencies { // https://papermc.io/repo/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/ the().paperDevBundle("1.18.2-R0.1-20220920.010157-167") - compileOnly("io.papermc:paperlib") + compileOnly(libs.paperlib) } diff --git a/worldedit-bukkit/adapters/adapter-1_19_4/build.gradle.kts b/worldedit-bukkit/adapters/adapter-1_19_4/build.gradle.kts index 5e1f312bca..df27ae5d62 100644 --- a/worldedit-bukkit/adapters/adapter-1_19_4/build.gradle.kts +++ b/worldedit-bukkit/adapters/adapter-1_19_4/build.gradle.kts @@ -12,5 +12,5 @@ repositories { dependencies { the().paperDevBundle("1.19.4-R0.1-20230608.201059-104") - compileOnly("io.papermc:paperlib") + compileOnly(libs.paperlib) } diff --git a/worldedit-bukkit/adapters/adapter-1_20/build.gradle.kts b/worldedit-bukkit/adapters/adapter-1_20/build.gradle.kts index cf13348ffa..8d116f3bc1 100644 --- a/worldedit-bukkit/adapters/adapter-1_20/build.gradle.kts +++ b/worldedit-bukkit/adapters/adapter-1_20/build.gradle.kts @@ -13,5 +13,5 @@ repositories { dependencies { // https://repo.papermc.io/service/rest/repository/browse/maven-public/io/papermc/paper/dev-bundle/ the().paperDevBundle("1.20.1-R0.1-20230623.105806-29") - compileOnly("io.papermc:paperlib") + compileOnly(libs.paperlib) } diff --git a/worldedit-bukkit/build.gradle.kts b/worldedit-bukkit/build.gradle.kts index 1e3bbf4a15..a6e853eefa 100644 --- a/worldedit-bukkit/build.gradle.kts +++ b/worldedit-bukkit/build.gradle.kts @@ -3,7 +3,7 @@ import io.papermc.paperweight.userdev.attribute.Obfuscation plugins { `java-library` - id("com.modrinth.minotaur") version "2.8.3" + alias(libs.plugins.minotaur) } project.description = "Bukkit" @@ -74,19 +74,19 @@ dependencies { implementation(libs.fastutil) // Platform expectations - compileOnly("io.papermc.paper:paper-api") { + compileOnly(libs.paper) { exclude("junit", "junit") exclude(group = "org.slf4j", module = "slf4j-api") } // Logging - localImplementation("org.apache.logging.log4j:log4j-api") + localImplementation(libs.log4jApi) localImplementation(libs.log4jBom) { because("Spigot provides Log4J (sort of, not in API, implicitly part of server)") } // Plugins - compileOnly("com.github.MilkBowl:VaultAPI") { isTransitive = false } + compileOnly(libs.vault) { isTransitive = false } compileOnly(libs.dummypermscompat) { exclude("com.github.MilkBowl", "VaultAPI") } @@ -101,26 +101,26 @@ dependencies { compileOnly(libs.griefdefender) { isTransitive = false } compileOnly(libs.residence) { isTransitive = false } compileOnly(libs.towny) { isTransitive = false } - compileOnly("com.intellectualsites.plotsquared:plotsquared-bukkit") { isTransitive = false } - compileOnly("com.intellectualsites.plotsquared:plotsquared-core") { isTransitive = false } + compileOnly(libs.plotSquaredBukkit) { isTransitive = false } + compileOnly(libs.plotSquaredCore) { isTransitive = false } // Third party - implementation("io.papermc:paperlib") - implementation("org.bstats:bstats-bukkit") { isTransitive = false } + implementation(libs.paperlib) + implementation(libs.bstatsBukkit) { isTransitive = false } implementation(libs.bstatsBase) { isTransitive = false } - implementation("dev.notmyfault.serverlib:ServerLib") - implementation("com.intellectualsites.paster:Paster") { isTransitive = false } + implementation(libs.serverlib) + implementation(libs.paster) { isTransitive = false } api(libs.lz4Java) { isTransitive = false } api(libs.sparsebitset) { isTransitive = false } api(libs.parallelgzip) { isTransitive = false } - compileOnly("net.kyori:adventure-api") - compileOnlyApi("org.checkerframework:checker-qual") + compileOnly(libs.adventureApi) + compileOnlyApi(libs.checkerqual) // Tests testImplementation(libs.mockito) - testImplementation("net.kyori:adventure-api") - testImplementation("org.checkerframework:checker-qual") - testImplementation("io.papermc.paper:paper-api") { isTransitive = true } + testImplementation(libs.adventureApi) + testImplementation(libs.checkerqual) + testImplementation(libs.paper) { isTransitive = true } } tasks.named("processResources") { diff --git a/worldedit-bukkit/src/test/java/com/sk89q/wepif/TestOfflinePermissible.java b/worldedit-bukkit/src/test/java/com/sk89q/wepif/TestOfflinePermissible.java index 981812e1b3..c63e986635 100644 --- a/worldedit-bukkit/src/test/java/com/sk89q/wepif/TestOfflinePermissible.java +++ b/worldedit-bukkit/src/test/java/com/sk89q/wepif/TestOfflinePermissible.java @@ -36,6 +36,8 @@ import org.jetbrains.annotations.Nullable; import javax.annotation.Nonnull; +import java.time.Duration; +import java.time.Instant; import java.util.Date; import java.util.HashMap; import java.util.HashSet; @@ -161,6 +163,24 @@ public boolean isBanned() { throw new UnsupportedOperationException("Not supported yet."); } + @Override + public > @Nullable E ban( + @Nullable final String reason, + @Nullable final Instant expires, + @Nullable final String source + ) { + return null; + } + + @Override + public > @Nullable E ban( + @Nullable final String reason, + @Nullable final Duration duration, + @Nullable final String source + ) { + return null; + } + @Override public @Nullable BanEntry ban( @Nullable final String reason, diff --git a/worldedit-cli/build.gradle.kts b/worldedit-cli/build.gradle.kts index ff0c9b5c13..6f0335e0e9 100644 --- a/worldedit-cli/build.gradle.kts +++ b/worldedit-cli/build.gradle.kts @@ -27,16 +27,16 @@ dependencies { // Minecraft expectations annotationProcessor(libs.guava) - implementation("com.google.guava:guava") - implementation("com.google.code.gson:gson") + implementation(libs.guava) + implementation(libs.gson) // Logging implementation(libs.log4jBom) { because("We control Log4J on this platform") } - implementation("org.apache.logging.log4j:log4j-api") + implementation(libs.log4jApi) implementation(libs.log4jCore) - implementation("commons-cli:commons-cli:1.5.0") + implementation(libs.commonsCli) api(libs.parallelgzip) { isTransitive = false } api(libs.lz4Java) } diff --git a/worldedit-core/build.gradle.kts b/worldedit-core/build.gradle.kts index 4e624bd3bd..a58230b2c5 100644 --- a/worldedit-core/build.gradle.kts +++ b/worldedit-core/build.gradle.kts @@ -11,7 +11,7 @@ applyPlatformAndCoreConfiguration() dependencies { constraints { - implementation("org.yaml:snakeyaml") { + implementation(libs.snakeyaml) { version { strictly("2.0") } because("Bukkit provides SnakeYaml") } @@ -24,17 +24,17 @@ dependencies { // Minecraft expectations implementation(libs.fastutil) - implementation("com.google.guava:guava") - implementation("com.google.code.gson:gson") + implementation(libs.guava) + implementation(libs.gson) // Platform expectations - implementation("org.yaml:snakeyaml") + implementation(libs.snakeyaml) // Logging - implementation("org.apache.logging.log4j:log4j-api") + implementation(libs.log4jApi) // Plugins - compileOnly("com.intellectualsites.plotsquared:plotsquared-core") { isTransitive = false } + compileOnly(libs.plotSquaredCore) { isTransitive = false } // ensure this is on the classpath for the AP annotationProcessor(libs.guava) @@ -45,11 +45,11 @@ dependencies { compileOnly(libs.truezip) implementation(libs.findbugs) implementation(libs.rhino) - compileOnly("net.kyori:adventure-api") + compileOnly(libs.adventureApi) compileOnlyApi(libs.adventureNbt) - compileOnlyApi("net.kyori:adventure-text-minimessage") + compileOnlyApi(libs.adventureMiniMessage) implementation(libs.zstd) { isTransitive = false } - compileOnly("com.intellectualsites.paster:Paster") + compileOnly(libs.paster) compileOnly(libs.lz4Java) { isTransitive = false } compileOnly(libs.sparsebitset) compileOnly(libs.parallelgzip) { isTransitive = false }