-
Notifications
You must be signed in to change notification settings - Fork 19
Basic Usage
Run Paper
In build.gradle.kts
:
plugins {
// Apply the plugin
id("xyz.jpenilla.run-paper") version "2.2.0"
}
tasks {
runServer {
// Configure the Minecraft version for our task.
// This is the only required configuration besides applying the plugin.
// Your plugin's jar (or shadowJar if present) will be used automatically.
minecraftVersion("1.19.2")
}
}
You can now run a Paper server simply by invoking the runServer
task!
Run Velocity
In build.gradle.kts
:
plugins {
// Apply the plugin
id("xyz.jpenilla.run-velocity") version "2.2.0"
}
tasks {
runVelocity {
// Configure the Velocity version for our task.
// This is the only required configuration besides applying the plugin.
// Your plugin's jar (or shadowJar if present) will be used automatically.
velocityVersion("3.1.2-SNAPSHOT")
}
}
You can now run a Velocity proxy simply by invoking the runVelocity
task!
Run Waterfall
In build.gradle.kts
:
plugins {
// Apply the plugin
id("xyz.jpenilla.run-waterfall") version "2.2.0"
}
tasks {
runWaterfall {
// Configure the Waterfall version for our task.
// This is the only required configuration besides applying the plugin.
// Your plugin's jar (or shadowJar if present) will be used automatically.
waterfallVersion("1.19")
}
}
You can now run a Waterfall proxy simply by invoking the runWaterfall
task!
The xyz.jpenilla.run-task
system property will be set to true
for runs.
run-task has the ability to automatically download plugins (for use in run tasks) from a variety of sources including GitHub Releases, Modrinth, Hangar, and plain URLs.
In this example, we will use run-paper
and its runServer
task, but the same applies to the other plugins and their run tasks.
tasks {
runServer {
downloadPlugins {
// make sure to double check the version id on the Modrinth version page
modrinth("carbon", "2.1.0-beta.21")
github("jpenilla", "MiniMOTD", "v2.0.13", "minimotd-bukkit-2.0.13.jar")
hangar("squaremap", "1.2.0")
url("https://download.luckperms.net/1515/bukkit/loader/LuckPerms-Bukkit-5.4.102.jar")
}
}
}
In more complex setups, you may want to have multiple run tasks that share some or all of their plugin downloads. This is possible using RunExtension#downloadPluginsSpec
and DownloadPluginsSpec#from
.
In this example, we will use run-paper
and its runServer
task/runPaper
extension, but the same applies to the other plugins and their run tasks/extensions.
// create a spec
val myPlugins = runPaper.downloadPluginsSpec {
// add some plugins
hangar("squaremap", "1.2.0")
// ...
}
// create another spec
val allPlugins = runPaper.downloadPluginsSpec {
from(myPlugins) // copy in everything from myPlugins
// add some other plugins ...
}
tasks.runServer {
downloadPlugins.from(allPlugins) // copy allPlugins into runServer.downloadPlugins
}
Folia support is provided in run-paper
through the runPaper.folia
extension. The simplest way to add a runFolia
task is to call runPaper.folia.registerTask()
in the build script.