Giter Club home page Giter Club logo

plugin-template's Introduction

PaperMC/Spigot Minecraft Server Plugin Template

A template for building PaperMC/Spigot Minecraft server plugins!

Build, Test, and Release

Features

Github Actions ๐ŸŽฌ

Bots ๐Ÿค–

  • Probot: Stale
    • Mark issues stale after 30 days
  • Dependabot
    • Update GitHub Actions workflows
    • Update Gradle dependencies

Issue Templates ๐Ÿ“‹

  • Bug report template
  • Feature request template

Gradle Builds ๐Ÿ—

Config Files ๐Ÿ“

  • Sample plugin.yml with autofill name, version, and main class.
  • Empty config.yml (just to make life *that* much easier)
  • Gradle build config
  • Simple .gitignore for common Gradle files

Usage

In order to use this template for yourself, there are a few things that you will need to keep in mind.

Release Info

Stable versions of this repo are tagged vX.Y.Z and have an associated release.

Testing versions of this repo are tagged vX.Y.Z-RC-N and have an associated pre-release.

Development versions of this repo are pushed to the master branch and are not tagged.

Release and Versioning Strategy

Event Version Format CI Action GitHub Release Draft?
PR yyMMdd-HHmm-SNAPSHOT Build and test No
Schedule yyMMdd-HHmm-SNAPSHOT Build, test, and notify No
Push to main 0.0.0-SNAPSHOT Build, test, release, and notify No
Tag vX.Y.Z-RC-N X.Y.Z-SNAPSHOT Build, test, release, and notify Pre-release
Tag vX.Y.Z X.Y.Z Build, test, release, and notify Release

Discord Notifications

In order to use Discord notifications, you will need to create two GitHub secrets. DISCORD_WEBHOOK_ID should be set to the id of your Discord webhook. DISCORD_WEBHOOK_TOKEN will be the token for the webhook.

You can find these values by copying the Discord Webhook URL:
https://discord.com/api/webhooks/<DISCORD_WEBHOOK_ID>/<DISCORD_WEBHOOK_TOKEN>

For more information, see Discord Message Notify.


I've broken the rest of the changes up by their files to make things a bit easier to find.


settings.gradle

Update the line below with the name of your plugin.

rootProject.name = 'ExamplePlugin'

build.gradle

Make sure to update the group to your package's name in the following section.

group = "com.crimsonwarpedcraft.exampleplugin"

Add any required repositories for your dependencies in the following section.

repositories {
    maven {
        name 'papermc'
        url 'https://papermc.io/repo/repository/maven-public/'
        content {
            includeModule("io.papermc.paper", "paper-api")
            includeModule("io.papermc", "paperlib")
            includeModule("net.md-5", "bungeecord-chat")
        }
    }

    mavenCentral()
}

Also, update your dependencies as needed (of course).

dependencies {
    compileOnly 'io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT'
    compileOnly 'com.github.spotbugs:spotbugs-annotations:4.7.3'
    implementation 'io.papermc:paperlib:1.0.8'
    spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.12.0'
    testCompileOnly 'com.github.spotbugs:spotbugs-annotations:4.7.3'
    testImplementation 'io.papermc.paper:paper-api:1.20.1-R0.1-SNAPSHOT'
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0'
}

src/main/resources/plugin.yml

First, update the following with your information.

author: AUTHOR
description: DESCRIPTION

Next, the commands and permissions sections below should be updated as needed.

commands:
  ex:
    description: Base command for EXAMPLE
    usage: "For a list of commands, type /ex help"
    aliases: example
permissions:
  example.test:
    description: DESCRIPTION
    default: true
  example.*:
    description: Grants all other permissions
    default: false
    children:
      example.test: true

.github/dependabot.yml

You will need to replace all instances of leviem1, such as the one below, with your GitHub username.

reviewers:
  - "leviem1"

.github/CODEOWNERS

You will need to replace leviem1, with your GitHub username.

*   @leviem1

.github/FUNDING.yml

Update or delete this file, whatever applies to you.

github: leviem1

For more information see: Displaying a sponsor button in your repository

CODE_OF_CONDUCT.md

If you chose to adopt a Code of Conduct for your project, please update line 63 with your preferred contact method.

Creating a Release

Below are the steps you should follow to create a release.

  1. Create a tag on main using semantic versioning (e.g. v0.1.0)
  2. Push the tag and get some coffee while the workflows run
  3. Publish the release draft once it's been automatically created

Building locally

Thanks to Gradle, building locally is easy no matter what platform you're on. Simply run the following command:

./gradlew build

This build step will also run all checks and tests, making sure your code is clean.

JARs can be found in build/libs/.

Contributing

See CONTRIBUTING.md.


I think that's all... phew! Oh, and update this README! ;)

plugin-template's People

Contributors

dependabot[bot] avatar diddyy avatar leviem1 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

Watchers

 avatar  avatar

plugin-template's Issues

Make Stale stop closing issues

Is your feature request related to a problem? Please describe.
Legitimate issues are sometimes closed by Stale due to inactivity.

Describe the solution you'd like
Stale only marks issues as Stale rather than ever closing them.

Describe alternatives you've considered
I could probably think of something else, but am too lazy currently. If someone else has any input feel free to comment.

Additional context
N/A

Consider migrating workflows to use official gradle action

Is your feature request related to a problem? Please describe.
Cannot cache gradle dependencies on Windows.

Describe the solution you'd like
Consider migrating workflows to use the official gradle action.

Describe alternatives you've considered
We can also just stop the gradle daemon, but we should probably use the official action.

Additional context
N/a

Add prefix to dependabot MRs

Is your feature request related to a problem? Please describe.
A developer currently must manually change the dependabot commit message to make it comply with the Conventional Commits spec.

Describe the solution you'd like
Dependabot should automatically add a "deps: " prefix to the commit.

Describe alternatives you've considered
N/a

Additional context
N/a

License

Do I need to use the GPL license if I use your template to make an addon?

Update to Java 17

Is your feature request related to a problem? Please describe.
N/A

Describe the solution you'd like
Bump Java version to 17.

Describe alternatives you've considered
Keeping the current version won't cause issues, but users won't have access to Java 17 features.

Additional context
Minecraft is now Java 17, though Java 17 can run previous versions, so no immediate need

Update Checkstyle

Let's update Checkstyle!

  • Update Checkstyle to 8.42 in build.gradle
  • Download updated Google config from here and replace config/checkstyle/checkstyle.xml
  • Update code as needed

Run 0.0.0-SNAPSHOT releases from main

Is your feature request related to a problem? Please describe.
Maven snapshots are a bit difficult to plan ahead of a release.

Describe the solution you'd like
Make 0.0.0-SNAPSHOT the bleeding-edge release. Make vX.Y.Z-rc tags vX.Y.Z-SNAPSHOT. Make v.X.Y.Z official releases.

Describe alternatives you've considered
Lots of thinking. This is a PITA and this is the best I can come up with.

Additional context
N/a

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.