Gradle plugin adding a task to run a Paper Minecraft server

Overview

Run Paper

build license latest release

Run Paper is a Gradle plugin which adds a task to automatically download and run a Paper Minecraft server along with your plugin built by Gradle.

Usage

Apply the plugin in your project buildscript.

plugins {
  // Apply the plugin
  id("xyz.jpenilla.run-paper") version "1.0.2"
}

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.16.5")
  }
}

Now you can run a Paper server simply by invoking the runServer task!

Check out the wiki for more detailed usage information.

Comments
  • run velocity?

    run velocity?

    Could this project be extended to run velocity? They use the same download API and all it would require is some arguments to be changed, but if that's out of the scope of this project that's understandable.

    opened by OskarZyg 8
  • Support multiple run server configurations

    Support multiple run server configurations

    The proposal is something similar to maven-publish that you could have a bunch of different tasks for multiple servers setups.

    This allows Monorepo projects for a big network project to setup different types of servers, plugins, modules and configurations.

    opened by DevSrSouza 4
  • Build.gradle doesn't recognize Minecraft 1.18.1

    Build.gradle doesn't recognize Minecraft 1.18.1

    Caused by: java.lang.IllegalStateException: Unknown Minecraft Version: 1.18.1 at xyz.jpenilla.runpaper.service.PaperclipService.unknownMinecraftVersion(PaperclipService.kt:302) at xyz.jpenilla.runpaper.service.PaperclipService.resolveLatestLocalBuild(PaperclipService.kt:229) at xyz.jpenilla.runpaper.service.PaperclipService.resolveBuildNumber(PaperclipService.kt:220) at xyz.jpenilla.runpaper.service.PaperclipService.resolvePaperclip(PaperclipService.kt:126) at xyz.jpenilla.runpaper.task.RunServerTask.configure(RunServerTask.kt:143) at xyz.jpenilla.runpaper.task.RunServerTask.exec(RunServerTask.kt:119)

    opened by Epicjii 3
  • Skip looking up new build for x amount of time

    Skip looking up new build for x amount of time

    Besides having faster server startup, for those of us with slow internet just checking for a new build can take an extra second or two (or timeout.) It'd be great if it only checked for a new Paper build every 24 hours, with possibly an option for force checking.

    opened by PaulBGD 3
  • Shade not called when specifying a custom serverJar

    Shade not called when specifying a custom serverJar

    when I call runServer, It shades all my deps fine, but when I specify a serverJar inside the runServer block, it fails to shade, so I get Caused by: java.lang.NoClassDefFoundError: Could not initialize class x.y.InventoryGUI

    opened by u9g 1
  • Allow changing paper downloads api url

    Allow changing paper downloads api url

    https://github.com/jpenilla/run-paper/blob/98cf9182f25dd8582d583f930588bb70ccb3e6e1/src/main/kotlin/xyz/jpenilla/runpaper/paperapi/DownloadsAPI.kt#L32

    opened by u9g 1
  • Allow for adding launch arguments

    Allow for adding launch arguments

    I'd like to be able to add an argument to the command that runs the server so I can build my plugin with this: https://github.com/Paul19988/Advanced-Slime-World-Manager/blob/1.18/.docs/usage/install.md#how-to-install-swm

    opened by u9g 1
  • Feature request: Run Minecraft Server based off of Project SDK version rather than user's JAVA_HOME

    Feature request: Run Minecraft Server based off of Project SDK version rather than user's JAVA_HOME

    Would make it easier to develop for different Minecraft versions since I admittedly just spent one too many minutes trying to figure out why my 1.17.1 server wasn't launching with this before I realized my JAVA_HOME was set to java 17. And it wasn't using my Java 16 which I had set my project SDK to

    opened by AshIndigo 1
  • Unrecognized field

    Unrecognized field "channel"

    I'm suddenly getting this error in any of my projects that use this plugin. I've tried using different java versions too.

    Version 1.0.1-SNAPSHOT

    Unrecognized field "channel" (class xyz.jpenilla.runpaper.paperapi.BuildResponse), not marked as ignorable (7 known properties: "project_id", "changes", "version", "downloads", "time", "build", "project_name"]) at [Source: UNKNOWN; line: 1, column: 420] (through reference chain: xyz.jpenilla.runpaper.paperapi.BuildResponse["channel"])

    opened by viveleroi 1
  • Support or new plugin for purpur?

    Support or new plugin for purpur?

    I've been using for paper and love it, but one of my plugins likely needs to use purpur. I would love a similar plugin like this for gradle and purpur. I don't know what would be involved but it makes plugin dev much easier. Since purpur is a paper fork and they have a download API as well, I assume it's not terribly different but am unsure.

    opened by viveleroi 1
  • "Failed to verify SHA256 hash of downloaded file."

    When running the 'runServer' Gradle task, the download fails with the error of "Failed to verify SHA256 hash of downloaded file." Stacktrace: image

    opened by nicholasgrose 0
  • Option for graceful stop of server

    Option for graceful stop of server

    It would be really useful to be able to just run the runServer task again inside of IntelliJ, and that the server then closes gracefully, like if you Ctrl-C inside of the console. This can be done by sending a SIGINT to the JVM, so it has to be possible somehow.

    Maybe also a "config" option for people that (don't) need this functionality. Though the maintainer would have to decide what's the default, I'd be happy with both.

    opened by motz0815 1
  • Implement

    Implement "delete" method in VM

    I'm not sure if this is entirely possible, but support for "Compile & Reload File" via the Run Debug option in IntelliJ would be great!

    Current error: image

    opened by Chew 0
  • Add and document jar argument

    Add and document jar argument

    When developing paper plugins, occasionally it is useful to know when it's being run inside a dev environment.

    Adding a jar argument or environment variable to run-paper would allow plugins to enable extra debug behavior when running from a debugging environment.

    opened by ryantheleach 1
  • Translate https://github.com/jpenilla/run-paper/wiki/Extensions to Potato

    Translate https://github.com/jpenilla/run-paper/wiki/Extensions to Potato

    I'm trying to debug https://github.com/oddlama/vane and contribute, but I'm pretty potato when it comes to gradle.

    It would be very appreciated if https://github.com/jpenilla/run-paper/wiki/Extensions had a little more information that could be followed for multi-module projects :-), or maybe an example.

    opened by ryantheleach 1
  • Configure Renovate

    Configure Renovate

    Mend Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    đŸšĻ To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • .github/workflows/build.yml (github-actions)
    • gradle.properties (gradle)
    • settings.gradle.kts (gradle)
    • build.gradle.kts (gradle)
    • gradle/wrapper/gradle-wrapper.properties (gradle-wrapper)

    Configuration

    🔡 Renovate has detected a custom config for this PR. Feel free to ask for help if you have any doubts and would like it reviewed.

    Important: Now that this branch is edited, Renovate can't rebase it from the base branch any more. If you make changes to the base branch that could impact this onboarding PR, please merge them manually.

    What to Expect

    It looks like your repository dependencies are already up-to-date and no Pull Requests will be necessary right away.


    ❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
Releases(v2.0.1)
  • v2.0.1(Dec 8, 2022)

    Changelog

    Changed

    • Moved plugin jar methods to separate class (01f7ce8c136e8975add5f01dcf8ca14a753cb94c)
    • Improved handling of blank duration strings (4d7a871844f52d076fb543f100c29c9db2dfa882)
    • Improved DownloadsAPIService documentation (94c4452740de4bab9789991ec4f530a544df8299)
    Source code(tar.gz)
    Source code(zip)
  • v2.0.0(Nov 15, 2022)

    Changelog

    Added

    • Added run-velocity and run-waterfall plugins

    Changed

    • PaperclipService renamed to DownloadsAPIService
    • Default DownloadsAPIService display name now splits on - instead of
    • RunServerTask renamed to RunServer
    • xyz.jpenilla.run-paper.updateCheckFrequency property replaced by xyz.jpenilla.run-task.updateCheckFrequency. The old property will continue to work for now, however usage will print a warning informing of the change.
    • Reworked cache layout
      • Old caches will not be deleted, they will stay in $GRADLE_USER_HOME/caches/RunPaper
      • New caches are stored in $GRADLE_USER_HOME/caches/run-task-jars/<paper|velocity|waterfall|user/$USER_SERVICE_NAME>
    • cleanPaperclipCache will not longer clear caches for custom DownloadsAPIService registrations. There are now separate tasks: cleanPaperclipCache, cleanVelocityCache, cleanWaterfallCache, cleanCustomServiceCaches, and cleanAllRunTaskCaches. The platform-specific tasks are registered by their respective plugins, the tasks for custom and all caches will exist if any one of the run-task plugins are applied. The clear all caches task will for example clear Velocity caches even if only run-paper is applied, as it deletes the entire run-task-jars directory.

    Fixed

    • Fixed unintended eager task creation

    Removed

    • All API deprecated in 1.1.0 is now removed
    • paperBuild convenience methods have been removed from RunServer, use the build property directly or the build convenience methods on the AbstractRun super class
    Source code(tar.gz)
    Source code(zip)
  • v1.1.0(Nov 8, 2022)

    • Exposed the PaperclipService to API, allowing for registration of custom services for use by RunServerTasks
    • Moved RunServerTask.PaperBuild to PaperclipService.Build and made members and constructor of Specific builds public
    • Exposed RunServerTask#paperBuild property directly in addition to convenience methods
    • Added paperclipService property to RunServerTask, defaulting to the built in Paper service
    • Added serverDisplayName property to RunServerTask to customize log messages

    An example of using the new API for running a fork:

    tasks {
      register<RunServerTask>("runFork") {
        paperclipService.set(PaperclipService.registerIfAbsent(project) {
          downloadsEndpoint = "https://fork.io/api/v2/"
          downloadProjectName = "fork"
        })
        serverDisplayName.set("Fork")
        minecraftVersion("1.19.2")
      }
    }
    

    You can of course modify the existing runServer task instead of creating a new one, this is just one simple example.

    Source code(tar.gz)
    Source code(zip)
  • v1.0.6(Dec 7, 2021)

  • v1.0.5(Nov 30, 2021)

  • v1.0.4(Aug 24, 2021)

    • Expose the serverJar and minecraftVersion properties on RunServerTask for more flexibility in configuration
    • Deprecate paperclipJar methods in favor of new serverJar methods for clearer naming
    • Add automatic integration with paperweight-userdev
      • Adds runMojangMappedServer task for testing without needing to reobfuscate the plugin jar
      • Configures the runServer task to use the Minecraft version from the paperweight dev bundle by default, and to use the reobfuscated plugin jar
    Source code(tar.gz)
    Source code(zip)
  • v1.0.3(Jun 18, 2021)

  • v1.0.2(Jun 6, 2021)

    • Show download progress
    • Add xyz.jpenilla.run-paper.updateCheckFrequency property to configure how often Run Paper will check for new builds of Paper. See the wiki for more details.
    Source code(tar.gz)
    Source code(zip)
  • v1.0.1(Jun 1, 2021)

  • v1.0.0(May 29, 2021)

WolfxPaper - A Paper fork designed for Wolfx Survial, may useful for some Semi-Vanilla Server

WolfxPaper A Paper fork designed for Wolfx Survial, may useful for some "Semi-Va

TenkyuChimata 1 Jan 19, 2022
Paper plugin for third-party AuthMe logins

Interactive Login Paper plugin that extends AuthMe (or AuthMeReloaded) with interactive third-party logins. Currently supports Discord as an external

Leonardo Giovanni Scur 0 Nov 25, 2021
VirtualTag is a name tag edit plugin for minecraft server

VirtualTag VirtualTag is a NameTag Edit plugin for modern minecraft server Support Version 1.17.x Download https://github.com/jiangdashao/VirtualTag/r

RERERE 13 Dec 18, 2022
An advanced Minecraft plugin template made in Gradle

//DONT_APPLY_TEMPLATE_CHANGE Gradle Plugin Template Kotlin DSL Version ℹī¸ This template was planned to support only kotlin, but it also supports Java!

null 0 Apr 17, 2022
Run Minecraft on the command line

HeadlessForge While headless Minecraft Clients aren't anything new, they come with a drawback. The Minecraft API is missing and you need to add all fu

null 28 Oct 17, 2022
A minecraft modification based on Fabric with Yarn Mappings, developed for the newest version of the sandbox game Minecraft.

JupiterClient A minecraft modification based on Fabric with Yarn Mappings, developed for the newest version of the sandbox game Minecraft. Building th

Cedric H. 1 Jun 27, 2022
Rock paper scissors game for Android built with Kotlin

Android-rock-paper-scissors Rock paper scissors game for Android built with Kotlin It's a pretty basic app. I built it to get more practice with kotli

Adel Nehikhare 5 Oct 30, 2022
A high-performance fork of Paper/Airplane designed for large servers.

Pufferfish A highly optimized Paper/Airplane fork designed for large servers requiring both maximum performance, stability, and "enterprise" features.

Pufferfish Studios LLC 399 Jan 7, 2023
A fork from Paper and unofficial Airplane continuation for RedeObscurity.

Obscurity A fork from Paper and unofficial Airplane continuation for RedeObscurity. Features Downloads This fork is in a state of development. If you

null 0 Jan 6, 2022
Paper-ui - A Multiplatform Compose Theme for your Compose app

paper-ui (WIP) Screen.Recording.2022-02-13.at.8.14.45.PM.mov A Multiplatform Com

theapache64 45 Oct 5, 2022
A react-like kotlin library to create an inventory ui easily in paper plugins

A react-like kotlin library to create an inventory ui easily in paper plugins

R2turnTrue 6 Aug 23, 2022
A powerful Minecraft Server Software coming from the future

Mirai A powerful Minecraft Server Software coming from the future Mirai is ❗ under heavy development ❗ and contributions are welcome! Features 30% fas

Etil 354 Dec 30, 2022
Minecraft Server Software specially designed for Thicc SMP. Here on GitHub without the private patches, just a normal hybrid JettPack-Pufferfish-Empirecraft fork

AlynaaMC A private, custom server software for Thicc SMP and a fork of Pufferfish. Here on GitHub with patches from JettPack, Airplane and Pufferfish

ThiccMC 14 Dec 31, 2021
Server-Side chat emotes for Minecraft

Chat Emotes Chat Emotes is a server-side mod that utilizes the Chat Preview feature introduced in Minecraft 1.19 to provide the use of emotes like Emo

Colin Barndt 7 Oct 25, 2022
A Minecraft server implementation for SuCraft.

Suki A fork of Mirai Made for the server SuCraft: sucraft.org Features Fork of Mirai for the best performance, notably: Fork of Pufferfish for the bes

SuCraft 22 Jan 2, 2023
A simple solution to handling persistent data storage in your Minecraft server.

Modern Data Stores A simple solution to handling persistent data storage in your Minecraft server. This plugin will be used throughout the Modern Plug

Modern Plugins 2 Nov 7, 2022
A simple solution to handling persistent data storage in your Minecraft server.

Modern Data Stores A simple solution to handling persistent data storage in your Minecraft server. This plugin will be used throughout the Modern Plug

Modern Plugins 2 Nov 7, 2022
A Mindustry mod adding turrets from older versions of Mindustry, specifically Mindustry Classic

Mindustry Kotlin Mod Template A Kotlin Mindustry mod that works on Android and PC. This is equivalent to the Java version, except in Kotlin. Building

null 4 Sep 3, 2022