A supercharged gradle template for developing Minecraft plugins with multi platform support.

Overview

Minecraft Multi-Platform Template

Build Status GitHub release (latest SemVer including pre-releases) Spiget tested server versions Spiget Downloads Spiget Rating codecov Commitizen friendly semantic-release Discord Shield

You can use this template to develop your own high quality Minecraft plugins for multiple platforms using Gradle with ease.

This template is a more advanced version of the spigot-plugin-template and offers an easy start to develop your plugin for multiple Minecraft platforms, like Paper, Nukkit, Velocity, Bungee, etc.

See the minecraft-server-template for quick starting your Minecraft network in under 30 seconds.

Features

The template or better boilerplate comes with a lot of features that are useful if you want to develop high quality plugins for multiple Minecraft platforms. However, you don't need to use all of them, you can simply remove the features and platforms you don't need.

Quickstart setup

  • Create a [new Github project][template] using this template.
  • Clone the new repository and open it in IntelliJ.
  • Update the gradle.properties file and change the following variables:
    • group: your-maven-group-id (e.g.: io.github.silthus)
    • pluginName: YourPluginName
    • author: YourName
  • Update the root.projectName inside settings.gradle. This will be your artifactId.
  • Delete the CHANGELOG.md. It will be generated on your first release.
  • Update the README to point to your project and spigot resource id.
  • Rename the java package and plugin to match your project.
  • Then execute the Server run configuration and the template will run the Spigot BuildTools to download and build spigot or paper for you.
  • Code away :) - and once you are ready, push your commit (in conventional commit style) to master.

Please read the Contributing Guidelines before submitting any pull requests or opening issues.

NOTE
You might need to run the gradle clean task after renaming the packages and reimport the gradle project to resolve errors with generating the plugin.yml.

Releasing a new version of your plugin

One of the major benefits of this template is the fact that it will automatically release a new version on every push to master based on your commit messages. This makes sure your plugin is released following the semantic versioning guidelines. For this to work you have to follow a few simple rules:

  • Commit only working and tested code to the master branch. Use Pull Requests to work on bigger features or bug fixes and merge them when you are ready.
  • Every bugfix, feature and change should have one commit associated with it. Do not mix multiple bugs, features, etc. into one huge commit message. Keep your commit size small and commit often.
  • Your commit messages must follow the conventional commit rules.

Commit message format

See the conventional commit homepage for more details and examples on the topic. But here is a quick summary to get you started.

The Conventional Commits specification is a lightweight convention on top of commit messages. It provides an easy set of rules for creating an explicit commit history; which makes it easier to write automated tools on top of. This convention dovetails with SemVer, by describing the features, fixes, and breaking changes made in commit messages.

The commit message should be structured as follows:

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

The commit contains the following structural elements, to communicate intent to the consumers of your library or plugin:

  • fix: a commit of the type fix patches a bug in your codebase (this correlates with PATCH in semantic versioning).
  • feat: a commit of the type feat introduces a new feature to the codebase (this correlates with MINOR in semantic versioning).
  • BREAKING CHANGE: a commit that has a footer BREAKING CHANGE:, or appends a ! after the type/scope, introduces a breaking API change (correlating with MAJOR in semantic versioning). A BREAKING CHANGE can be part of commits of any type.
  • types other than fix: and feat: are allowed, for example @commitlint/config-conventional (based on the the Angular convention) recommends build:, chore:, ci:, docs:, style:, refactor:, perf:, test:, and others.
  • footers other than BREAKING CHANGE: <description> may be provided and follow a convention similar to git trailer format. Additional types are not mandated by the Conventional Commits specification, and have no implicit effect in semantic versioning (unless they include a BREAKING CHANGE).

A scope may be provided to a commit’s type, to provide additional contextual information and is contained within parenthesis, e.g., feat(parser): add ability to parse arrays.

Here are some examples:

Commit message with description and breaking change footer
feat: allow provided config object to extend other configs

BREAKING CHANGE: `extends` key in config file is now used for extending other config files
Commit message with no body
docs: correct spelling of CHANGELOG
Commit message with scope
feat(lang): add polish language
Commit message with multi-paragraph body and multiple footers
fix: correct minor typos in code

see the issue for details

on typos fixed.

Reviewed-by: Z
Refs #133

Publishing your maven package

Your plugin will be automatically published as a maven package on Github packages as soon as you release a new version.

About the group and artifactId

The group appended by your artifactId is used to uniquely identify your project when importing it in other projects. When you import spigot in your project you use the group org.spigotmc followed by the artifactId spigot-api and the version.

The following was taken from the offical maven naming guide.

  • groupId uniquely identifies your project across all projects. A group ID should follow Java's package name rules. This means it starts with a reversed domain name you control. For example: org.apache.maven, org.apache.commons.
    If you dont't own a domain, you can use the github domain io.github appended by your Github username, e.g. io.github.silthus
  • artifactId is the name of the jar without version. If you created it, then you can choose whatever name you want with lowercase letters and no strange symbols. For example: `maven, commons-math

Github Package Authentication

You need to configure authentication for Github Packages if you want to use your maven package in other projects.

  1. Create a Github Personal Access Token
  2. Create or update the gradle.properties inside C:\Users\%username%\.gradle with the following and replace YOUR_GITHUB_USERNAME with your Github username and YOUR_PERSONAL_ACCESS_TOKEN with the access token from step 1.
gpr.user=YOUR_GITHUB_USERNAME
gpr.key=YOUR_PERSONAL_ACCESS_TOKEN

Debugging your plugin

Copy your plugin automatically

You can export your plugin to the plugins directory from your working directory with the Gradle prepareSpigotPlugins task. The task will build and copy your plugin automatically into the plugins/ directory.

Running and debugging the Minecraft server

You can run or debug your plugin using the Server run configuration from within IntelliJ to automatically download the Minecraft server, built it, copy your and dependent plugins into it and start it in debugging mode.

This is due to the awesome power of Spigradle's debug tasks. Find out more on the Spigradle Github page.

References

Comments
Releases(v1.0.0)
Owner
sVoxelDev
Supercharged Minecraft Development
sVoxelDev
Tabletop Games Framework (TAG) - a Java-based benchmark for developing modern board games for AI research

The Tabletop Games Framework (TAG) is a Java-based benchmark for developing modern board games for AI research

null 56 Dec 12, 2022
Simple Calender App Written in Java , Built with Gradle

Simple Calendar Simple Calendar is an just another open-source Android Calendar application written in java. Features Minimal & Clean Fullfilles needs

Aryan Sinha 2 Dec 3, 2021
Xerath - 🔪 AOP development framework implemented through *Annotation + ASM + Gradle Transform API* for Android🤖

简体中文 | English | Xerath Xerath 是一个通过 [自定义注解]+ASM + Gradle Transform API 实现的一套功能强大,方便开发,并且能够有效减少重复代码的Android Aop 框架。 旨在编译器进行全局性的修改,来完成一些诸如方法耗时统计,异常收集,拦

Pumpkin 325 Nov 22, 2022
A sample microservice built with Spring Boot and Gradle.

Project Overview A sample microservice built with Spring Boot and Gradle. There are APIs built using REST and the resource is bicycle. All CRUD operat

Gordon Mendonsa 1 Feb 2, 2022
Gradle plugin for Android applications for detecting unexpected changes in AndroidManifest.xml

manifest-guard Gradle plugin for Android applications for detecting unexpected changes in AndroidManifest.xml The problem being solved Every third-par

Daniil Popov 39 Dec 24, 2022
This is a module for Waterfall/Bungeecord! That means instead of putting it in the plugins/ folder

CMD: Plugins This is a module for Waterfall/Bungeecord! That means instead of putting it in the plugins/ folder, you put it in the modules/ folder! In

CyberedCake 0 Jun 8, 2022
Run Java plugins without compiling them

Run Java plugins without compiling them! Usage Under plugins/SkriptJava, you can put your .java files to run when the server is up and loaded. This pl

Rance Andres 5 Sep 5, 2022
Spigot Premium Plugins Updater

SPPU Spigot Premium Plugins Updater Installation Minimum Java 8 required Download the SPPU.jar and put it into your servers root directory Download th

Osiris-Team 7 Aug 1, 2022
A MOTD plugin for Velocity that caches network packets. This helps it be the fastest one of the MOTD plugins.

FastMOTD A MOTD plugin for Velocity that catches network packets. This helps it be the fastest one of the MOTD plugins. Test server: ely.su Features F

Elytrium 19 Dec 24, 2022
Business Application Platform - no-code/low-code platform to build business applications

Orienteer What is Orienteer Orienteer is Business Application Platform: Easy creation of business applications Extendable to fit your needs Dynamic da

Orienteer 189 Dec 6, 2022
A small mod to improve support for architectures and libraries officially unsupported by Minecraft. Mainly targeting Apple Macs using arm processors.

fabric-loom-native-support A small mod to improve support for architectures and libraries officially unsupported by Minecraft. Mainly targeting Apple

FabricMC 5 Oct 17, 2022
Patches for the old minecraft official launcher to add microsoft account support

MSA4Legacy Patches for the old minecraft official launcher to add microsoft account support My code here is quite atrocious in some parts (for example

Nep Nep 26 Nov 3, 2022
Build your own Minecraft authentication system with Mojang authentication server support.

Build your own Minecraft authentication system with Mojang authentication server support. A fork of yushijinhun/authlib-injector.

Ethan Zuo 15 Dec 17, 2022
Multi-Tenant Spring Boot Application with separate databases using Hibernate and H2.

Multi-Tenant Spring Boot Application A Spring Boot application that utilises a multi-tenancy architecture by providing multiple databases, one for eac

Alex Gschnitzer 15 May 9, 2022
Build criterion and ecosystem above multi-model databases

ShardingSphere - Building a Criterion and Ecosystem Above Multi-Model Databases Official Website: https://shardingsphere.apache.org/ Stargazers Over T

The Apache Software Foundation 17.8k Jan 9, 2023
Multi-OS Engine: Create iOS Apps in Java (or Kotlin ... etc.)

Multi-OS Engine Overview Multi-OS Engine provides a Java runtime and Java interfaces to iOS platform API to develop native iOS applications with nativ

Multi-OS Engine 561 Dec 22, 2022
Multi-Disciplinary Project

Multi-Disciplinary Project With an odd-numbered group of 7, the planning for the distribution of work is tricky since certain members have to take add

Lim You Rong 0 Mar 9, 2022
MarioCash is a trust-based multi-dimensional blockchains built with a vision to connect everything and any blockchain networks.

MarioCash We will change the world by blockchain. What is mariocash? MARIOCASH is a trust-based multi-dimensional blockchains (branches) built with a

Brantley·Williams 23 Mar 10, 2022