mirror of
https://hub.spigotmc.org/stash/scm/spigot/plugin-annotations.git
synced 2025-04-13 09:29:56 +00:00
Update README to reflect changes.
This commit is contained in:
parent
1c5f2a077f
commit
e677cffa5d
1 changed files with 44 additions and 57 deletions
101
README.md
101
README.md
|
@ -1,6 +1,9 @@
|
|||
# plugin-annotations
|
||||
# Usage
|
||||
Add this jar to your pom.xml to enable automatic annotation-based plugin.yml generation.
|
||||
|
||||
The only *required* annotation is the ```@Plugin``` annotation. All other annotations are optional.
|
||||
See the [wiki](https://www.spigotmc.org/wiki/plugin-yml/) for more information.
|
||||
|
||||
## Example Usage
|
||||
```
|
||||
package org.spigotmc.annotationtest;
|
||||
|
@ -12,73 +15,57 @@ import org.bukkit.plugin.java.annotation.*;
|
|||
import org.bukkit.plugin.java.annotation.Commands.Cmd;
|
||||
import org.bukkit.plugin.java.annotation.Permissions.Perm;
|
||||
|
||||
@Main
|
||||
@Name("Test")
|
||||
@Version("v1.0")
|
||||
@Description("A test plugin.")
|
||||
@LoadOn(PluginLoadOrder.POSTWORLD)
|
||||
@Author("md_5")
|
||||
@Website("spigotmc.org")
|
||||
@UsesDatabase
|
||||
@DependsOn({"WorldEdit", "Towny"})
|
||||
@SoftDependsOn("Vault")
|
||||
@LogPrefix("Testing")
|
||||
@LoadBefore("Essentials")
|
||||
@Commands({
|
||||
@Cmd(
|
||||
value = "foo",
|
||||
desc = "Foo command",
|
||||
aliases = {"foobar", "fubar"},
|
||||
permission = "test.foo",
|
||||
permissionMessage = "You do not have permission!",
|
||||
usage = "/<command> [test|stop]"
|
||||
),
|
||||
@Cmd("bar")
|
||||
})
|
||||
@Permissions({
|
||||
@Perm(
|
||||
value = "test.foo",
|
||||
desc = "Allows foo command",
|
||||
defaultValue = PermissionDefault.OP
|
||||
),
|
||||
@Perm(
|
||||
value = "test.*",
|
||||
desc = "Wildcard perm",
|
||||
defaultValue = PermissionDefault.OP,
|
||||
children = {"test.foo"}
|
||||
)
|
||||
})
|
||||
@Plugin(name = "TestPlugin", version = "1.0")
|
||||
@Description(desc = "A test plugin")
|
||||
@LoadOn(loadOn = PluginLoadOrder.POSTWORLD) // defaults to PluginLoadOrder.POSTWORLD if not preset
|
||||
@Author(name = "md_5")
|
||||
@Website(url = "spigotmc.org")
|
||||
@LogPrefix(prefix = "Testing")
|
||||
@Dependency(plugin = "WorldEdit")
|
||||
@Dependency(plugin = "Towny")
|
||||
@LoadBefore(plugin = "Essentials")
|
||||
@SoftDependency(plugin = "FAWE")
|
||||
@Command(name = "foo", desc = "Foo command", aliases = {"foobar", "fubar"}, permission = "test.foo", permissionMessage = "You do not have permission!", usage = "/<command> [test|stop]")
|
||||
@Permission(name = "test.foo", desc = "Allows foo command", defaultValue = PermissionDefault.OP)
|
||||
@Permission(name = "test.*", desc = "Wildcard permission", defaultValue = PermissionDefault.OP, children = {@ChildPermission(name ="test.foo")})
|
||||
public class Test extends JavaPlugin {}
|
||||
```
|
||||
Output:
|
||||
|
||||
```
|
||||
# Auto-generated plugin.yml, generated at 2015/02/20 20:06:29 by org.bukkit.plugin.java.annotation.PluginAnnotationProcessor
|
||||
# Auto-generated plugin.yml, generated at 2018/03/06 18:15:44 by org.bukkit.plugin.java.annotation.PluginAnnotationProcessor
|
||||
|
||||
main: org.spigotmc.annotationtest.Test
|
||||
name: TestPlugin
|
||||
version: '1.0'
|
||||
description: A test plugin
|
||||
load: POSTWORLD
|
||||
author: md_5
|
||||
website: spigotmc.org
|
||||
depend: [WorldEdit, Towny]
|
||||
prefix: Testing
|
||||
depend:
|
||||
- WorldEdit
|
||||
- Towny
|
||||
softdepend:
|
||||
- FAWE
|
||||
loadbefore:
|
||||
- Essentials
|
||||
commands:
|
||||
foo:
|
||||
description: Foo command
|
||||
usage: /<command> [test|stop]
|
||||
aliases:
|
||||
- foobar
|
||||
- fubar
|
||||
permission: test.foo
|
||||
permission-message: You do not have permission!
|
||||
aliases: [foobar, fubar]
|
||||
bar: {}
|
||||
database: true
|
||||
main: org.spigotmc.annotationtest.Test
|
||||
version: v1.0
|
||||
softdepend: [Vault]
|
||||
author: md_5
|
||||
description: A test plugin.
|
||||
name: Test
|
||||
prefix: Testing
|
||||
usage: /<command> [test|stop]
|
||||
permissions:
|
||||
test.*:
|
||||
test.foo:
|
||||
description: Allows foo command
|
||||
default: op
|
||||
description: Wildcard perm
|
||||
children: {test.foo: true}
|
||||
test.foo: {default: op, description: Allows foo command}
|
||||
load: POSTWORLD
|
||||
loadbefore: [Essential:s]
|
||||
```
|
||||
test.*:
|
||||
description: Wildcard permission
|
||||
default: op
|
||||
children:
|
||||
test.foo: true
|
||||
```
|
||||
|
|
Loading…
Add table
Reference in a new issue