diff --git a/build.gradle.kts b/build.gradle.kts index 5341c25fb..a96c6273f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ plugins { java `maven-publish` id("com.github.johnrengelman.shadow") version "7.1.2" apply false - id("io.papermc.paperweight.core") version "1.3.8" + id("io.papermc.paperweight.core") version "1.3.9" } allprojects { @@ -62,7 +62,7 @@ repositories { dependencies { paramMappings("net.fabricmc:yarn:1.19.2+build.1:mergedv2") - remapper("net.fabricmc:tiny-remapper:0.8.2:fat") + remapper("net.fabricmc:tiny-remapper:0.8.6:fat") decompiler("net.minecraftforge:forgeflower:1.5.605.7") spigotDecompiler("io.papermc:patched-spigot-fernflower:0.1+build.6") paperclip("io.papermc:paperclip:3.0.2") diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 41d9927a4..249e5832f 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index aa991fcea..ae04661ee 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 1b6c78733..a69d9cb6c 100755 --- a/gradlew +++ b/gradlew @@ -205,6 +205,12 @@ set -- \ org.gradle.wrapper.GradleWrapperMain \ "$@" +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + # Use "xargs" to parse quoted args. # # With -n1 it outputs one arg per line, with the quotes and backslashes removed. diff --git a/gradlew.bat b/gradlew.bat index 107acd32c..f127cfd49 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -14,7 +14,7 @@ @rem limitations under the License. @rem -@if "%DEBUG%" == "" @echo off +@if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem @rem Gradle startup script for Windows @@ -25,7 +25,7 @@ if "%OS%"=="Windows_NT" setlocal set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. +if "%DIRNAME%"=="" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute +if %ERRORLEVEL% equ 0 goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar :end @rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd +if %ERRORLEVEL% equ 0 goto mainEnd :fail rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 +set EXIT_CODE=%ERRORLEVEL% +if %EXIT_CODE% equ 0 set EXIT_CODE=1 +if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% +exit /b %EXIT_CODE% :mainEnd if "%OS%"=="Windows_NT" endlocal diff --git a/patches/server/0400-Deobfuscate-stacktraces-in-log-messages-crash-report.patch b/patches/server/0400-Deobfuscate-stacktraces-in-log-messages-crash-report.patch index 62c3d9a36..f26b65a23 100644 --- a/patches/server/0400-Deobfuscate-stacktraces-in-log-messages-crash-report.patch +++ b/patches/server/0400-Deobfuscate-stacktraces-in-log-messages-crash-report.patch @@ -6,17 +6,10 @@ Subject: [PATCH] Deobfuscate stacktraces in log messages, crash reports, and diff --git a/build.gradle.kts b/build.gradle.kts -index e260462933a9f7065b2360e6bf9e4ee56069a705..a1a8c4778742584125d6084fa761b1bc86f6a842 100644 +index e260462933a9f7065b2360e6bf9e4ee56069a705..2ff278cdc3dfef4644b12755be2e3a69a43e1f07 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -1,4 +1,6 @@ -+import io.papermc.paperweight.tasks.BaseTask - import io.papermc.paperweight.util.* -+import java.nio.file.Files - - plugins { - java -@@ -19,12 +21,14 @@ dependencies { +@@ -19,12 +19,14 @@ dependencies { Scanning takes about 1-2 seconds so adding this speeds up the server start. */ implementation("org.apache.logging.log4j:log4j-core:2.14.1") // Paper - implementation @@ -31,42 +24,15 @@ index e260462933a9f7065b2360e6bf9e4ee56069a705..a1a8c4778742584125d6084fa761b1bc runtimeOnly("org.xerial:sqlite-jdbc:3.36.0.3") runtimeOnly("mysql:mysql-connector-java:8.0.29") runtimeOnly("com.lmax:disruptor:3.4.4") // Paper -@@ -104,6 +108,45 @@ tasks.check { +@@ -104,6 +106,18 @@ tasks.check { } // Paper end +// Paper start - include reobf mappings in jar for stacktrace deobfuscation -+abstract class IncludeMappings : BaseTask() { -+ @get:InputFile -+ abstract val inputJar: RegularFileProperty -+ -+ @get:InputFile -+ abstract val mappings: RegularFileProperty -+ -+ @get:OutputFile -+ abstract val outputJar: RegularFileProperty -+ -+ override fun init() { -+ super.init() -+ outputJar.convention(defaultOutput()) -+ } -+ -+ @TaskAction -+ private fun addMappings() { -+ outputJar.get().asFile.parentFile.mkdirs() -+ inputJar.get().asFile.copyTo(outputJar.get().asFile, overwrite = true) -+ outputJar.get().path.openZip().use { fs -> -+ val dir = fs.getPath("META-INF/mappings/") -+ Files.createDirectories(dir) -+ val target = dir.resolve("reobf.tiny") -+ Files.copy(mappings.path, target) -+ } -+ } -+} -+ -+val includeMappings = tasks.register("includeMappings") { ++val includeMappings = tasks.register("includeMappings") { + inputJar.set(tasks.fixJarForReobf.flatMap { it.outputJar }) + mappings.set(tasks.reobfJar.flatMap { it.mappingsFile }) ++ mappingsDest.set("META-INF/mappings/reobf.tiny") +} + +tasks.reobfJar { diff --git a/patches/server/0401-Implement-Mob-Goal-API.patch b/patches/server/0401-Implement-Mob-Goal-API.patch index 35ff8b0f2..3c03234e3 100644 --- a/patches/server/0401-Implement-Mob-Goal-API.patch +++ b/patches/server/0401-Implement-Mob-Goal-API.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Implement Mob Goal API diff --git a/build.gradle.kts b/build.gradle.kts -index a1a8c4778742584125d6084fa761b1bc86f6a842..a02f53c6ee0111e07d78a718a6ca0ec708f70cfc 100644 +index 2ff278cdc3dfef4644b12755be2e3a69a43e1f07..2d1e639bd2880469d849ca1242184b0af1f6903c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -37,6 +37,7 @@ dependencies { +@@ -35,6 +35,7 @@ dependencies { runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3") runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3") @@ -789,7 +789,7 @@ index 4379b9948f1eecfe6fd7dea98e298ad5f761019a..3f081183521603824430709886a9cc31 LOOK, JUMP, diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index 9cf007fae9aa21897a06de783357f5e14f6004a0..547bb2aab1c31cbd2d571a995c1014726993b39f 100644 +index 8d4388df7e62016df262e377e5f75cc44e17e284..f1134bce181e8ea5eebb241e3af9691390cd2533 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -2691,5 +2691,11 @@ public final class CraftServer implements Server { diff --git a/patches/server/0735-Use-Velocity-compression-and-cipher-natives.patch b/patches/server/0735-Use-Velocity-compression-and-cipher-natives.patch index 25741b15d..41c87a214 100644 --- a/patches/server/0735-Use-Velocity-compression-and-cipher-natives.patch +++ b/patches/server/0735-Use-Velocity-compression-and-cipher-natives.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Use Velocity compression and cipher natives diff --git a/build.gradle.kts b/build.gradle.kts -index a02f53c6ee0111e07d78a718a6ca0ec708f70cfc..30a600ef1dfedc1a050268af593074659382bc36 100644 +index 2d1e639bd2880469d849ca1242184b0af1f6903c..88000dae363f55044f86e72e9f6fb0214cd320bc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -29,6 +29,11 @@ dependencies { +@@ -27,6 +27,11 @@ dependencies { implementation("org.spongepowered:configurate-yaml:4.1.2") // Paper - config files implementation("commons-lang:commons-lang:2.6") implementation("net.fabricmc:mapping-io:0.3.0") // Paper - needed to read mappings for stacktrace deobfuscation diff --git a/patches/server/0774-Update-Log4j.patch b/patches/server/0774-Update-Log4j.patch index 48d47942a..a37693cff 100644 --- a/patches/server/0774-Update-Log4j.patch +++ b/patches/server/0774-Update-Log4j.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Update Log4j diff --git a/build.gradle.kts b/build.gradle.kts -index 30a600ef1dfedc1a050268af593074659382bc36..039891cc7ffd355f2d4c1cd202a042bf061ddfa8 100644 +index 88000dae363f55044f86e72e9f6fb0214cd320bc..ea1faaf4820059b4a67dbd229a90bc6b78b861bc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -20,10 +20,11 @@ dependencies { +@@ -18,10 +18,11 @@ dependencies { all its classes to check if they are plugins. Scanning takes about 1-2 seconds so adding this speeds up the server start. */ diff --git a/patches/server/0859-Add-support-for-Proxy-Protocol.patch b/patches/server/0859-Add-support-for-Proxy-Protocol.patch index 51687b36e..031bd5659 100644 --- a/patches/server/0859-Add-support-for-Proxy-Protocol.patch +++ b/patches/server/0859-Add-support-for-Proxy-Protocol.patch @@ -5,10 +5,10 @@ Subject: [PATCH] Add support for Proxy Protocol diff --git a/build.gradle.kts b/build.gradle.kts -index 039891cc7ffd355f2d4c1cd202a042bf061ddfa8..44e0f265432487fe5c3c00c5245041298ade16a0 100644 +index ea1faaf4820059b4a67dbd229a90bc6b78b861bc..b0e4f11e8af4b909a56bb5576d05ef0537fb25f7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts -@@ -22,6 +22,7 @@ dependencies { +@@ -20,6 +20,7 @@ dependencies { */ implementation("org.apache.logging.log4j:log4j-core:2.17.1") // Paper - implementation annotationProcessor("org.apache.logging.log4j:log4j-core:2.17.1") // Paper - Needed to generate meta for our Log4j plugins