Giter Club home page Giter Club logo

run-task's Introduction

Run <Paper|Velocity|Waterfall>

build license

This repository houses a suite of plugins which add tasks to automatically download and run Minecraft server/proxy software along with your plugin built by Gradle. This provides a streamlined method of integration testing plugins.

Run Paper

latest release

Basic Usage

In build.gradle.kts:

plugins {
  // Apply the plugin
  id("xyz.jpenilla.run-paper") version "2.2.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.20.2")
  }
}

You can now run a Paper server simply by invoking the runServer task!

Run Velocity

latest release

Basic Usage

In build.gradle.kts:

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

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

You can now run a Velocity proxy simply by invoking the runVelocity task!

Run Waterfall

latest release

Basic Usage

In build.gradle.kts:

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

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!

Check out the wiki for more detailed usage information.

run-task's People

Contributors

denwav avatar jpenilla avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

run-task's Issues

How to add eula flag

How can I parse -Dcom.mojang.eula.agree=true as flag if I invoke runServer? Can I add flags at all, like Aikar's flags for example.

Add flag

Hey its anyway to add flag method in runServer?

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/build.yml
  • actions/checkout v4
  • gradle/actions v3
  • actions/setup-java v4
  • gradle/actions v3
gradle
gradle.properties
settings.gradle.kts
gradle/libs.versions.toml
  • com.fasterxml.jackson.module:jackson-module-kotlin 2.17.0
  • io.papermc.paperweight.userdev:io.papermc.paperweight.userdev.gradle.plugin 1.5.15
  • net.kyori.indra 3.1.3
  • net.kyori.indra.publishing.gradle-plugin 3.1.3
  • net.kyori.indra.licenser.spotless 3.1.3
  • com.gradle.plugin-publish 1.2.1
plugin/gradle.properties
plugin/settings.gradle.kts
plugin/build.gradle.kts
tester/build.gradle.kts
gradle-wrapper
gradle/wrapper/gradle-wrapper.properties
  • gradle 8.6

  • Check this box to trigger a request for Renovate to run again on this repository

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

Support dependecy jars.

Hello! When working on a single minecraft plugin, this task works really well!
However, some of my work uses multiple projects, published to private repositories.
EDIT This means that I cannot use any of the 'downloadPlugins' options, they wouldn't account for authentication and such.
EDIT 2 Also this would remove duplication, chances are you already have a library plugin as a dependency, and now this is duplicated in the 'downloadPlugins' section.

Would it be possible to add a feature that adds jars from selected dependencies in the project to the server plugins?
It could look something like this:

runServer{
    minecraftVersion("1.20.1")
    localPlugins{ // Couldn't think of a better name
         fromDependency("io.github.thegatesdev:someplugin:1.0.0")
   }
}

Thanks!

able to customize/extend DownloadsAPI

allow us to customize download api's queries to make our own implementation for custom paper forks.
an example

runServer {
    downloadsApiService.convention(DownloadsAPIService.registerIfAbsent(project) {
        downloadsEndpoint = "https://api.purpurmc.org/v2/purpur/"
        downloadProjectName = "purpur"
    })
    minecraftVersion("1.20.2")
}
> Task :paper:runServer FAILED
Fetching Purpur builds for version 1.20.2...
Failed to check for latest release, attempting to use latest local build.
27 actionable tasks: 3 executed, 24 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':paper:runServer'.
> Unknown Purpur Version: 1.20.2

Enable colours by default

I think most people that uses this could profit from adding by default

     runMojangMappedServer {
        systemProperty("terminal.jline", false)
        systemProperty("terminal.ansi", true)
    }
    runServer {
        systemProperty("terminal.jline", false)
        systemProperty("terminal.ansi", true)
    }

to enable colours like
image

Because most people using this will run from ide, and it will be useful for them (you can add a method that automatically remove this if you want)

Most people don't even know you can do that

run-paper in multi-module projects

Is it possible to use run-task in projects with multiple modules?

I have a configuration like:

XYZ:
- plugin1
- plugin2
- plugin3

and I'd like to be able to run it on XYZ and have all three plugins built and included.

I haven't seen any examples like that in the readme or on the wiki, it also didn't seem to work while I tried but there's a chance I did something wrong.

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.

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)

Option to disable bStats

This is set up by default in Bukkit, Spigot and Paper servers, but isn't really appropriate for a development and testing environment, unless bStats integration is what you're testing. Docs here: https://bstats.org/getting-started

Is there a way to automatically disable bStats when starting the 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.

Improve Plugin Jar Detection/Shadow Compatibility

Shadow is currently waiting on johnrengelman/shadow#876 to support Gradle 8.4/Java 21. The project's owner has not been responsive. A fork with the PR merged has been published here.

I believe the fork can be used with run-task, but only if the jar is manually moved to the server's plugin path, and plugin jar detection is disabled.

If possible, I would like for detection to be more customizable so that the Shadow fork can be used while waiting for this update. I do not think this is possible currently.

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.

[IntelliJ] Support for profiling

Hello, I want to profile my server but using run-tasks it doesn't have all the useful things as the live cpu/ram usage graphs. On the paper server they said to me that it's because the profiler is attached to the gradle task not to the server, I wanted to know if there was something I could do to show the graphs I never really used the profiler before so I'm maybe missing something, I still get a detailled report but only after stopping the server, and it doesnt allow to check for memory and cpu usage on the whole program.

image

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.

Ability to reference multi-project plugins

Hey there, first of all, this gradle plugin is just awesome.

I was wondering if it would be possible to allow the "download"/including plugins from referenced projects so in a gradle multi-project build being able to include/reference projects that are plugins would be really handy when it comes to dependencies.

Thanks in advance.

Edit: I've seen some people already requested this and seen some solution using pluginJars but imo feels a bit hacky and adds complexity as you'll need to ensure such jar exists by building the project, it might be easier for anyone to simply reference it with the project directive (just like when you do on dependencies block for example implementation(project(":my-project"))), meaning it will be built and the output jar will be used into the runServer task along with the current project jar.

Unable to accept EULA

Hi, i'm using the latest release of paper and im unable to accept eula from JavaExec args.
image

works with previous versions of paper ๐Ÿ˜ณ๐Ÿ‘Œ

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

Change server directory

Currently the server dir is set by default to gradle module dir/run.

Is there a way to change this location?

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.

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.

Debugging

Not exactly sure why but org.slf4j.Logger#debug(String) doesn't work, but org.slf4j.Logger#error(String) does work.

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"])

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.