1515 * along with this program. If not, see <https://www.gnu.org/licenses/>.
1616 */
1717
18+ import xyz.jpenilla.runpaper.task.RunServer
19+
1820plugins {
1921 id ' java'
2022 id ' java-library'
2123 id " io.freefair.lombok" version " 6.3.0"
2224 id " com.github.johnrengelman.shadow" version " 7.1.2"
2325 id " org.jetbrains.gradle.plugin.idea-ext" version " 1.1.9"
26+ id " xyz.jpenilla.run-paper" version " 2.3.1"
2427}
2528
26- version ' 1.16.9-1.19.2-1.21.4 '
29+ version ' 1.16.9-1.19.2-1.21.5 '
2730def apiVersion = ' 1.19'
2831def name = getRootProject(). getName() // Defined in settings.gradle
2932def main = ' com.volmit.adapt.Adapt'
@@ -51,6 +54,13 @@ def VERSIONS = Map.of(
5154 " v1_20_4" , " 1.20.4-R0.1-SNAPSHOT" ,
5255 " v1_19_2" , " 1.19.2-R0.1-SNAPSHOT"
5356)
57+ def SUPPORTED = [" 1.19.1" , " 1.19.2" , " 1.19.3" , " 1.19.4" , " 1.20.1" , " 1.20.2" , " 1.20.4" , " 1.20.6" , " 1.21.1" , " 1.21.3" , " 1.21.4" , " 1.21.5" ]
58+ def jdk = [" 1.20.6" , " 1.21.1" , " 1.21.3" , " 1.21.4" , " 1.21.5" ]
59+
60+ def MIN_HEAP_SIZE = " 2G"
61+ def MAX_HEAP_SIZE = " 8G"
62+ // Valid values are: none, truecolor, indexed256, indexed16, indexed8
63+ def COLOR = " truecolor"
5464
5565VERSIONS . each {
5666 def key = it. key
@@ -65,6 +75,23 @@ VERSIONS.each {
6575 }
6676 }
6777}
78+ SUPPORTED . forEach { version ->
79+ tasks. register(" runServer-$version " , RunServer ) {
80+ group(" servers" )
81+ minecraftVersion(version)
82+ minHeapSize(MIN_HEAP_SIZE )
83+ maxHeapSize(MAX_HEAP_SIZE )
84+ systemProperty(" disable.watchdog" , " " )
85+ systemProperty(" net.kyori.ansi.colorLevel" , COLOR )
86+ systemProperty(" com.mojang.eula.agree" , true )
87+ pluginJars(tasks. shadowJar. archiveFile)
88+ runDirectory. convention(layout. buildDirectory. dir(" run/$version " ))
89+
90+ if (jdk. contains(version)) {
91+ javaLauncher = javaToolchains. launcherFor { it. languageVersion = JavaLanguageVersion . of(21 )}
92+ }
93+ }
94+ }
6895
6996/**
7097 * Gradle is weird sometimes, we need to delete the plugin yml from the build folder to actually filter properly.
@@ -140,7 +167,7 @@ allprojects {
140167 compileOnly " com.github.angeschossen:ChestProtectAPI:3.9.1"
141168 compileOnly " com.github.TechFortress:GriefPrevention:16.18.1"
142169 implementation ' xyz.xenondevs:particle:1.8.4'
143- implementation " com.frengor:ultimateadvancementapi-shadeable:2.4.3 "
170+ implementation " com.frengor:ultimateadvancementapi-shadeable:2.5.1 "
144171 implementation ' com.jeff-media:custom-block-data:2.2.3'
145172 compileOnly ' com.griefdefender:api:2.1.0-SNAPSHOT'
146173 compileOnly ' io.netty:netty-all:4.1.68.Final'
0 commit comments