Skip to content
Raphaël Fromentin edited this page Jan 28, 2023 · 11 revisions

ManaDrop provides Spigot tools to easily setup a Spigot workspace.

Dependency and Repository shortcuts

Name Description Type
bukkit The Bukkit API without CraftBukkit and NMS, requiring spigotRepository Dependency
craftbukkit CraftBukkit server including NMS. Requiring mavenLocal Dependency
paperApi The PaperSpigot API without NMS requiring paperRepository Dependency
paperPublic The Paper repository including Paper and Waterfall Repository
sonatype Sonatype's Maven repository Repository
spigotApi The Spigot API without CraftBukkit and NMS, requiring spigotRepository Dependency
spigot The Spigot server including Spigot API, CraftBukkit and NMS. Requiring mavenLocal Dependency
spigotCentral Spigot's Maven main repository Repository
spigotSnapshot Spigot's Maven "SNAPSHOT" repository Repository

See also Dependency and Repository shortcuts

Plugin.yml generation

The Spigot extension provides plugin.yml (description) generation feature:

spigot {
    desc {
        named 'TestPlugin' //Default: the project name
        version project.version //Default: the project version
        authors 'Il_totore'
        main 'fr.il_totore.entitymetadata.plugin.Main'
    }
}

processResources.finalizedBy(spigotPlugin)

Attributes

Name Description Type Default Value Required
api-version (apiVersion) The plugin's api version String, use the used Spigot version or legacy if under 1.13 Absent false
authors Plugin's author(s) String Absent false
command Add a command A new command as Closure Absent false
depend Plugin's required dependencies String list representing plugins' name Absent false
description The plugin's description String Absent false
loadbefore (loadBefore) Plugins needing to be loaded after this plugin String list representing plugins' name Absent false
main The plugin's main class String null true
name (named) The plugin's name String The project's name true
permissions Plugin's permissions A new permission as Clojure Absent false
prefix (prefixed) The plugin's prefix String Absent (in Spigot the plugin's name is used by default) false
softdepend (softDepend) Plugin's optional dependencies. Used to load the plugin after them String list representing plugins' name Absent false
version The plugin's version String The project's version true

Commands

You can register new command using the command method requiring a Clojure.

Name Description Type Default Value Required
aliases The command's aliases String list Absent false
description The command's description String Absent false
name (named) The command's name String null true
permission The command's required permission String (plugin.foo) Absent false
permission-message (permissionMessage) The message sent when the player doesn't have permission to execute this commands String Absent false
usage The command's usage String Absent false

Here is an example of plugin description with commands:

spigot {
    desc {
        named 'TestPlugin' //Default: the project name
        version project.version //Default: the project version
        authors 'Il_totore'
        main 'fr.il_totore.entitymetadata.plugin.Main'

        command {
            named 'test'
            description 'A test command'
            aliases 'tst', 'thisisanalias'
        }
    }
}

Permissions

You can register new permission using the permission method requiring a Clojure.

Name Description Type Default Value Required
child Add new child String, child permission's name Absent false
defaultType The default value of the permission String, grant_player, deny_player, grant_op, deny_op Absent (Spigot default is op) false
description The permission's description String Absent false
name (named) The permission's name String null true

Here is an example of plugin description with permissions:

spigot {
    desc {
        named 'TestPlugin' //Default: the project name
        version project.version //Default: the project version
        authors 'Il_totore'
        main 'fr.il_totore.entitymetadata.plugin.Main'

        permission {
            named 'perm.*'
            description 'All perms'
            defaultType 'grant_op'
            child {
                named 'perm.firstChild'
                inherit true
            }

            child {
                named 'perm.secondChild'
                inherit false
            }
        }

        permission {
            named 'perm.firstChild'
            description 'The first one'
            defaultType 'grant_player'
        }

        permission {
            named 'perm.secondChild'
            description 'Luigi'
            defaultType 'deny_player'
        }
    }
}

Description example

spigot {
    desc {
        named 'TestPlugin' //Default: the project name
        version project.version //Default: the project version
        authors 'Il_totore'
        main 'fr.il_totore.entitymetadata.plugin.Main'

        command {
            named 'test'
            description 'A test command'
            aliases 'tst', 'thisisanalias'
        }

        permission {
            named 'perm.*'
            description 'All perms'
            defaultType 'grant_op'
            child {
                named 'perm.firstChild'
                inherit true
            }

            child {
                named 'perm.secondChild'
                inherit false
            }
        }

        permission {
            named 'perm.firstChild'
            description 'The first one'
            defaultType 'grant_player'
        }

        permission {
            named 'perm.secondChild'
            description 'Luigi'
            defaultType 'deny_player'
        }
    }
}

NMS Support

You can download and manage NMS dependencies automatically using the buildTools task.

buildTools {
  versions '1.8', '1.9'
}

Attributes

Here is a list of buildTools task attributes

Name Description Type Default Value Required
buildToolsUrl The used BuildTools jar URL String Spigot's Jenkins, latest release false
mavenPath The mvn executable path String The mvn executable found in %MAVEN_HOME%/bin false
maxRamAllowed Max memory allowed to BuildTools in MB. Equals to -Xmx argument int 1024 false
refreshBuildTools Force ManaDrop to redownload BuildTools boolean true false
refreshVersions Force ManaDrop to rebuild each versions boolean false false
showBuildToolsLogs Show BuildTools build logs. Note BuildTools's Maven logs will be shown even if showMavenInstallCheckLogs is false boolean true false
showMavenInstallCheckLogs Show Maven logs when checking for installed versions boolean false false
stopOnError Stop task on error if false, ManaDrop will skip failed build and try to build others boolean true false
versions (allVersions to get) Add Spigot versions String list (varargs) No version false
workDir Set working directory Directory as java.io.File Absent true