From 7665ae86d65b964822b307c085fc86c0fcc442f2 Mon Sep 17 00:00:00 2001 From: Jason Penilla <11360596+jpenilla@users.noreply.github.com> Date: Tue, 23 Nov 2021 17:09:12 -0800 Subject: [PATCH] Update runServer gradle properties --- ...ptimize-IntIdentityHashBiMiap-nextId.patch | 4 +-- .../server/0001-Setup-Gradle-project.patch | 26 ++++++++++++------- settings.gradle.kts | 2 +- 3 files changed, 20 insertions(+), 12 deletions(-) rename patches/removed/1.18/{ => No longer needed}/0228-Optimize-IntIdentityHashBiMiap-nextId.patch (94%) diff --git a/patches/removed/1.18/0228-Optimize-IntIdentityHashBiMiap-nextId.patch b/patches/removed/1.18/No longer needed/0228-Optimize-IntIdentityHashBiMiap-nextId.patch similarity index 94% rename from patches/removed/1.18/0228-Optimize-IntIdentityHashBiMiap-nextId.patch rename to patches/removed/1.18/No longer needed/0228-Optimize-IntIdentityHashBiMiap-nextId.patch index ae4e49590..f1447869e 100644 --- a/patches/removed/1.18/0228-Optimize-IntIdentityHashBiMiap-nextId.patch +++ b/patches/removed/1.18/No longer needed/0228-Optimize-IntIdentityHashBiMiap-nextId.patch @@ -7,8 +7,8 @@ Optimizes CrudeIncrementalIntIdentityHashBiMap#nextId() This is a frequent hotspot for world loading/saving. -1.18 todo: seems like the bitset is too small now? removing this patch fixed -lots of issues related to synchedentitydata and structure gen +1.18 note: seems like the bitset is too small now? removing this patch fixed +lots of issues related to synchedentitydata and structure gen. when asked, Tux said "nuke it" diff --git a/src/main/java/net/minecraft/util/CrudeIncrementalIntIdentityHashBiMap.java b/src/main/java/net/minecraft/util/CrudeIncrementalIntIdentityHashBiMap.java index dc7528b41aa9a55807a2b3e33d5668e1be681e79..a002218caed08bf4a4072d934e1094c22ee35534 100644 diff --git a/patches/server/0001-Setup-Gradle-project.patch b/patches/server/0001-Setup-Gradle-project.patch index a96e2dec2..3474cc080 100644 --- a/patches/server/0001-Setup-Gradle-project.patch +++ b/patches/server/0001-Setup-Gradle-project.patch @@ -28,10 +28,10 @@ index 67fb370cad6924895a6b27052dbd5c1767e3f0c9..bb338269c9e3bef4c274157c490d8b8f +/.factorypath diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 -index 0000000000000000000000000000000000000000..273746fe476a9a09ebca01c6ecd814b70fe1b4c2 +index 0000000000000000000000000000000000000000..a19e05379d81e6f0bb0a78bc734a1cfdd355dc74 --- /dev/null +++ b/build.gradle.kts -@@ -0,0 +1,145 @@ +@@ -0,0 +1,153 @@ +import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer +import com.github.jengelman.gradle.plugins.shadow.transformers.Transformer +import io.papermc.paperweight.util.* @@ -130,29 +130,37 @@ index 0000000000000000000000000000000000000000..273746fe476a9a09ebca01c6ecd814b7 +} + +fun TaskContainer.registerRunTask( -+ name: String, block: JavaExec.() -> Unit ++ name: String, ++ block: JavaExec.() -> Unit +): TaskProvider = register(name) { + group = "paper" + standardInput = System.`in` -+ workingDir = rootProject.layout.projectDirectory.dir( -+ providers.gradleProperty("runWorkDir").forUseAtConfigurationTime().orElse("run") -+ ).get().asFile ++ workingDir = rootProject.layout.projectDirectory ++ .dir(providers.gradleProperty("paper.runWorkDir").forUseAtConfigurationTime().getOrElse("run")) ++ .asFile ++ javaLauncher.set(project.javaToolchains.defaultJavaLauncher(project)) + + if (rootProject.childProjects["test-plugin"] != null) { + val testPluginJar = rootProject.project(":test-plugin").tasks.jar.flatMap { it.archiveFile } + inputs.file(testPluginJar) -+ // args("-add-plugin=${testPluginJar.get().asFile.absolutePath}") // todo - uncomment ++ args("-add-plugin=${testPluginJar.get().asFile.absolutePath}") + } + + args("--nogui") + systemProperty("net.kyori.adventure.text.warnWhenLegacyFormattingDetected", true) -+ if (project.hasProperty("disableWatchdog")) { ++ if (providers.gradleProperty("paper.runDisableWatchdog").getOrElse("false") == "true") { + systemProperty("disable.watchdog", true) + } ++ ++ val memoryGb = providers.gradleProperty("paper.runMemoryGb").forUseAtConfigurationTime().getOrElse("2") ++ val modifiedJvmArgs = jvmArgs ?: arrayListOf() ++ modifiedJvmArgs.addAll(listOf("-Xms${memoryGb}G", "-Xmx${memoryGb}G")) ++ jvmArgs = modifiedJvmArgs ++ + doFirst { + workingDir.mkdirs() + } -+ javaLauncher.set(project.javaToolchains.defaultJavaLauncher(project)) ++ + block(this) +} + diff --git a/settings.gradle.kts b/settings.gradle.kts index 9afad2ea0..de13572ae 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -10,7 +10,7 @@ rootProject.name = "Paper" include( "Paper-API", "Paper-Server", - "Paper-MojangAPI", + "Paper-MojangAPI", ) val testPlugin = file("test-plugin.settings.gradle.kts")