Fix Paper 26.2 explosion restoration stall
This commit is contained in:
+34
-6
@@ -1,31 +1,36 @@
|
||||
plugins {
|
||||
id("java-library")
|
||||
id("com.github.johnrengelman.shadow") version "8.1.1"
|
||||
id("com.gradleup.shadow") version "9.6.1"
|
||||
}
|
||||
|
||||
group = "com.garbagemule"
|
||||
version = "0.109"
|
||||
version = "0.109.1-tss3"
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
|
||||
maven("https://repo.papermc.io/repository/maven-public/")
|
||||
maven("https://jitpack.io")
|
||||
maven("https://repo.maven.apache.org/maven2/")
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("org.spigotmc:spigot-api:1.19-R0.1-SNAPSHOT")
|
||||
compileOnly("io.papermc.paper:paper-api:26.2.build.84-stable")
|
||||
compileOnly("com.github.MilkBowl:VaultAPI:1.7.1")
|
||||
api("org.bstats:bstats-bukkit:2.2.1")
|
||||
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
testImplementation("org.hamcrest:hamcrest-all:1.3")
|
||||
testImplementation("org.mockito:mockito-core:3.12.4")
|
||||
testImplementation("org.mockito:mockito-core:5.23.0")
|
||||
testImplementation("org.mockbukkit.mockbukkit:mockbukkit-v26.1.2:4.113.2")
|
||||
}
|
||||
|
||||
// Tests use MockBukkit's exact Paper API build because 26.2 registries are not modeled yet.
|
||||
configurations.matching { it.name.startsWith("test") }.configureEach {
|
||||
resolutionStrategy.force("io.papermc.paper:paper-api:26.1.2.build.57-stable")
|
||||
}
|
||||
java {
|
||||
toolchain {
|
||||
languageVersion.set(JavaLanguageVersion.of(8))
|
||||
languageVersion.set(JavaLanguageVersion.of(25))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,3 +71,26 @@ tasks {
|
||||
// Let the build task produce the final artifact.
|
||||
build { dependsOn(shadowJar) }
|
||||
}
|
||||
val checkNoLegacyMaterialApi = tasks.register("checkNoLegacyMaterialApi") {
|
||||
group = "verification"
|
||||
description = "Fails if legacy Bukkit material access returns to production sources."
|
||||
val sources = fileTree("src/main/java") { include("**/*.java") }
|
||||
inputs.files(sources)
|
||||
|
||||
doLast {
|
||||
val violations = sources.files.flatMap { file ->
|
||||
file.readLines().mapIndexedNotNull { index, line ->
|
||||
if ("org.bukkit.material" in line || "state.getData()" in line) {
|
||||
"${file.relativeTo(projectDir)}:${index + 1}"
|
||||
} else null
|
||||
}
|
||||
}
|
||||
check(violations.isEmpty()) {
|
||||
"Legacy Bukkit material API usage found:\n${violations.joinToString("\n")}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
tasks.named("check") {
|
||||
dependsOn(checkNoLegacyMaterialApi)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user