Nukkit example (#2)

This commit is contained in:
Gabriel Souza 2018-07-24 10:43:40 -03:00 committed by Minecrell
parent 6ef1128cd8
commit 40b86ec3d1

104
README.md
View file

@ -1,6 +1,6 @@
# plugin-yml
[plugin-yml] is a simple Gradle plugin that generates the `plugin.yml` plugin description file for Bukkit plugins
or `bungee.yml` for Bungee plugins based on the Gradle project. Various properties are set automatically (e.g. project
[plugin-yml] is a simple Gradle plugin that generates the `plugin.yml` plugin description file for Bukkit plugins,
`bungee.yml` for Bungee plugins or `nukkit.yml` for Nukkit plugins based on the Gradle project. Various properties are set automatically (e.g. project
name, version or description) and additional properties can be added using a simple DSL.
## Usage
@ -172,4 +172,104 @@ bungee {
}
```
### Nukkit
#### Groovy
```groovy
plugins {
id 'net.minecrell.plugin-yml.nukkit' version '0.3.0'
}
bukkit {
// Default values can be overridden if needed
// name = 'TestPlugin'
// version = '1.0'
// description = 'This is a test plugin'
// website = 'https://example.com'
// author = 'Notch'
// Plugin main class and api (required)
main = 'com.example.testplugin.TestPlugin'
api = ['1.0.0']
// Other possible properties from nukkit.yml (optional)
load = 'STARTUP' // or 'POSTWORLD'
authors = ['Notch', 'Notch2']
depend = ['PlotSquared']
softDepend = ['LuckPerms']
loadBefore = ['BrokenPlugin']
prefix = 'TEST'
commands {
test {
description = 'This is a test command!'
aliases = ['t']
permission = 'testplugin.test'
usage = 'Just run the command!'
}
// ...
}
permissions {
'testplugin.*' {
children = ['testplugin.test']
}
'testplugin.test' {
description = 'Allows you to run the test command'
setDefault('OP') // 'TRUE', 'FALSE', 'OP' or 'NOT_OP'
}
}
}
```
#### kotlin-dsl
```kotlin
plugins {
id("net.minecrell.plugin-yml.nukkit") version "0.3.0"
}
bukkit {
// Default values can be overridden if needed
// name = "TestPlugin"
// version = "1.0"
// description = "This is a test plugin"
// website = "https://example.com"
// author = "Notch"
// Plugin main class and api (required)
main = "com.example.testplugin.TestPlugin"
api = listOf("1.0.0")
// Other possible properties from nukkit.yml (optional)
load = NukkitPluginDescription.PluginLoadOrder.STARTUP // or POSTWORLD
authors = listOf("Notch", "Notch2")
depend = listOf("PlotSquared")
softDepend = listOf("LuckPerms")
loadBefore = listOf("BrokenPlugin")
prefix = "TEST"
commands {
"test" {
description = "This is a test command!"
aliases = listOf("t")
permission = "testplugin.test"
usage = "Just run the command!"
}
// ...
}
permissions {
"testplugin.*" {
children = listOf("testplugin.test")
}
"testplugin.test" {
description = "Allows you to run the test command"
default = NukkitPluginDescription.Permission.Default.OP // TRUE, FALSE, OP or NOT_OP
}
}
}
```
[plugin-yml]: https://github.com/Minecrell/plugin-yml