Coder Social home page Coder Social logo

spigot-plugin-archetype's Introduction

This is a maven archetype ("template project") to quickly create a new Spigot plugin from scratch. See below on how to use it.

Features

  • Automatically creates a whole project setup including main class, plugin.yml and pom.xml
  • Set a custom package name, main class name, plugin name, ...
  • Set a custom Spigot version to use (e.g. "1.19.3")
  • Choose whether you want to use NMS or not
    • If you use NMS, it automatically adds the mojang mapping stuff to your pom.xml if using 1.17+
  • Creates an "exportToServer" profile so you can deploy your .jar to your test server with one click
  • Choose which dependencies you want to add, and automatically shade them when needed (JeffLib, Vault, CustomBlockData, MorePersistentDataTypes...)
  • Optionally add a static instance getter to your main class
  • ...and much more!

Available options

General options

Option Description Default value
groupId The Maven Group ID of your plugin
artifactId The Maven Artifact ID of your plugin
version The version of your plugin 1.0-SNAPSHOT
pluginName The name of your plugin
package The main package name of your plugin com.example.myplugin
mainClass The name of your main class MyPlugin
description Your plugin's description
author The author of your plugin Someone
spigotVersion The Spigot version to use 1.19.3
javaVersion The Java version to use, e.g. 8 or 17 8
pathToTestServer The path to your server (optional) C:\mctest\plugins
addStaticGetter Whether to add a static instance getter false
useKotlin Whether to use Kotlin instead of Java false

Optional dependencies

You can also automatically add the following dependencies. Allowed values are true and false. Default is false for all.

Option Dependency Scope Description
dependNMS Spigot (NMS) Provided Allows accessing CraftBukit and NMS classes + automatic remapping for 1.17+
dependLombok Lombok Annotation Annotation-based library to reduce boilerplate code
dependJeffLib JeffLib Shaded General-purpose library
dependVault Vault Soft-Depend Permissions, Chat & Economy API
dependACF ACF Shaded Command framework
dependMockBukkit MockBukkit Test Unit testing. Automatically creates an example test, too.
dependMorePersistentDataTypes MorePersistentDataTypes Shaded More PersistentDataTypes + Collections, Maps & Arrays for PDC
dependCustomBlockData CustomBlockData Shaded PDC for Blocks
dependProtocolLib ProtocolLib Soft-Depend Packet sending & listening library
dependWorldEdit WorldEdit Soft-Depend WorldEdit API
dependWorldGuard WorldGuard Soft-Depend WorldGuard API (includes WorldEdit API)
dependSpigotUpdateChecker SpigotUpdateChecker Shaded Powerful Update checker library
dependTaskChain TaskChain Shaded Control Flow framework
dependConfigurateGson Configurate-Gson Shaded Simple configuration library for JSON using Gson
dependConfigurateHocon Configurate-HOCON Shaded Simple configuration library for HOCON
dependConfigurateJackson Configurate-Jackson Shaded Simple configuration library for JSON using Jackson
dependConfigurateXml Configurate-XML Shaded Simple configuration library for XML
dependConfigurateYaml Configurate-YAML Shaded Simple configuration library for YAML
dependRecordBuilder RecordBuilder Annotation RecordBuilder library
dependAdventure Adventure-API Shaded Adventure API
dependMiniMessage MiniMessage Shaded MiniMessage API (includes Adventure API)
dependInventoryFramework IF (InventoryFramework) Shaded GUI library
dependCirrus Cirrus Shaded GUI library

Usage (Spigot-Plugin-Generator)

You can use the Spigot-Plugin-Generator to use this archetype without having to install it locally. Simply download the Spigot-Plugin-Generator from the releases page and run it. It will automatically download the latest version of this archetype.

img.png img2.png img3.png

Usage (Advanced)

You simply have to clone this repo, then mvn install it.

git clone https://github.com/JEFF-Media-GbR/maven-spigot-plugin
cd maven-spigot-plugin
mvn install

Then, you can create a new project using the archetype, either through your IDE or using the command line:

From within IntelliJ

  1. Open IntelliJ
  2. Click File -> New -> Project...
  3. Select Maven Archetype on the left
  4. Choose Default Local in the Catalog menu
  5. Select com.jeff-media:spigot-plugin in the Archetype menu. If this does not appear, click on Add, then enter com.jeff_media as Group ID, spigot-plugin as Artifact ID and 1.0.0-SNAPSHOT as Version.
  6. Fill in the properties to your likings

img.png img_1.png

From Command line

You can either declare all properties that you want to change:

mvn archetype:generate \
  -DarchetypeArtifactId=spigot-plugin \
  -DarchetypeGroupId=com.jeff_media \
  -DarchetypeVersion=1.0.0-SNAPSHOT \
  -D<option>=<value> ...

Or you can use the interactive mode and make maven ask you for each property:

mvn archetype:generate \
  -DaskForDefaultPropertyValues=true \
  -DarchetypeArtifactId=spigot-plugin \
  -DarchetypeGroupId=com.jeff_media \
  -DarchetypeVersion=1.0.0-SNAPSHOT

Todo

  • Add SpigotUpdateChecker dependency
  • Add WorldEdit / WorldGuard dependency
  • Add ProtocolLib
  • Add Lombok
  • Add PaperLib

spigot-plugin-archetype's People

Contributors

mfnalex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

spigot-plugin-archetype's Issues

Includes self ego library

Big issue, library contains other libraries. Makes me incredibly discombobulated. I cannot even begin to understand how understandable this discombobulating effect has on me.

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.