Skip to content

Disk-MTH/Spigot-plugin-template

Repository files navigation

Spigot plugin template

Description

Spigot plugin template is a simple plugin template, quick to set up with automated actions as much as possible.

By using this project you agree to the terms of use, copyrights and licenses of Spigot, getBukkit, and the EULA of Minecraft.

Installation

In order to prepare your working environment, create a Github repository using the green "Use this template" button. after that clone your repository locally to start working.

If you only want to work locally you can also download the template locally via this link.

Usage

  1. Edit plugin information

Start by modifying the information in the gradle.properties file by replacing them with your own.

Here is the detail information of this file (fields marked with a "#" can be left empty):

  • group: the main package name containing your source code. For more information on nomenclature look here.

  • mainClass: The main class of the plugin (the one that extends JavaPlugin and that contains the methods for activating and deactivating the plugin). It is often at the root of the main package and is usually named Main or the name of the plugin.

  • plugin_name: The name of the plugin. It usually starts with a capital letter and can contain the following characters: "a-z - A-Z - 0-9 - _". The plugin name will also be the name of the plugin configuration folder.

  • version: The plugin version. Here you find the semantic conventions provided by Spigot.

  • spigotVersion: The version of Spigot you want to work with. Here you will find the versions supported by this template.

  • javaVersion: The version of Java used for the project.

  • authors: A coma-separated list of the authors of the plugin. #

  • credits: Just a text for the plugin credits (who developed it, who improved it...). #

  • description: A short description of the plugin. #

  • minRam: The minimum amount of ram allocated to the Java process running the server (in Mo).

  • maxRam: The maximum amount of ram allocated to the Java process running the server (in Mo).

  1. Setup workspace for IDE
  • Intellij Idea: Run the command ./gradlew genIntellijRuns.

  • Eclipse: Run the command ./gradlew genEclispeRuns.

  • Other: Run the command ./gradlew downloadServer.

After running the appropriate command for your needs, simply open the project in your IDE and use it like any other Gradle project.

If you want to try your plugin on another server than the one provided by default (for example on a Mohist server to test compatibility with mods), there is two case:

  • If you have already launched the server once, replace the "server.jar" in the "run" folder with the new "server.jar".
  • Else create the run folder and put your "server.jar" in it.

/!\ the name of the file must ABSOLUTELY be "server.jar" /!\

If you have changed server and want to use the one provided by default again, just delete the "server.jar" in the "run" folder and launch the server.

  1. Launch and build

When you are ready to test your plugin, you can launch the server with the default IDE config or with the command ./gradlew startServer.

If you want to build your plugin, you can use the command ./gradlew build or use the default IDE config and your jar will be in the "build/libs" folder.

Gradle Commands (added by the project)

  • genIntellijruns: Download the jar of the server and generates the default launch configurations for Intellij Idea.

  • genEclispeRuns: Download the jar of the server and generates the default launch configurations for Eclipse.

  • downloadServer: Download the jar of the server.

  • setupServer: Create the run folder (if it does not exist) and add the jar of the server to launch (if it does not exist), an already accepted EULA file (if it does not exist) and a server.properties file with "online-mode" disabled (if it doesn't exist).

  • setupPlugin: Build the plugin and replace it in the server's plugins folder.

  • startServer: Start the server with the start arguments given in the gradle.properties file.

License

All the files in this repository are completely free of rights (see the license) so you can grab the code and do whatever you want with them (just respect the license).

Thanks for reading and good development!

Disk_MTH

About

A gradle based spigot plugin template with quick and easy setup

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages