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.
|
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
|
## Example Usage
|
||||||
```
|
```
|
||||||
package org.spigotmc.annotationtest;
|
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.Commands.Cmd;
|
||||||
import org.bukkit.plugin.java.annotation.Permissions.Perm;
|
import org.bukkit.plugin.java.annotation.Permissions.Perm;
|
||||||
|
|
||||||
@Main
|
@Plugin(name = "TestPlugin", version = "1.0")
|
||||||
@Name("Test")
|
@Description(desc = "A test plugin")
|
||||||
@Version("v1.0")
|
@LoadOn(loadOn = PluginLoadOrder.POSTWORLD) // defaults to PluginLoadOrder.POSTWORLD if not preset
|
||||||
@Description("A test plugin.")
|
@Author(name = "md_5")
|
||||||
@LoadOn(PluginLoadOrder.POSTWORLD)
|
@Website(url = "spigotmc.org")
|
||||||
@Author("md_5")
|
@LogPrefix(prefix = "Testing")
|
||||||
@Website("spigotmc.org")
|
@Dependency(plugin = "WorldEdit")
|
||||||
@UsesDatabase
|
@Dependency(plugin = "Towny")
|
||||||
@DependsOn({"WorldEdit", "Towny"})
|
@LoadBefore(plugin = "Essentials")
|
||||||
@SoftDependsOn("Vault")
|
@SoftDependency(plugin = "FAWE")
|
||||||
@LogPrefix("Testing")
|
@Command(name = "foo", desc = "Foo command", aliases = {"foobar", "fubar"}, permission = "test.foo", permissionMessage = "You do not have permission!", usage = "/<command> [test|stop]")
|
||||||
@LoadBefore("Essentials")
|
@Permission(name = "test.foo", desc = "Allows foo command", defaultValue = PermissionDefault.OP)
|
||||||
@Commands({
|
@Permission(name = "test.*", desc = "Wildcard permission", defaultValue = PermissionDefault.OP, children = {@ChildPermission(name ="test.foo")})
|
||||||
@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"}
|
|
||||||
)
|
|
||||||
})
|
|
||||||
public class Test extends JavaPlugin {}
|
public class Test extends JavaPlugin {}
|
||||||
```
|
```
|
||||||
Output:
|
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
|
website: spigotmc.org
|
||||||
depend: [WorldEdit, Towny]
|
prefix: Testing
|
||||||
|
depend:
|
||||||
|
- WorldEdit
|
||||||
|
- Towny
|
||||||
|
softdepend:
|
||||||
|
- FAWE
|
||||||
|
loadbefore:
|
||||||
|
- Essentials
|
||||||
commands:
|
commands:
|
||||||
foo:
|
foo:
|
||||||
description: Foo command
|
description: Foo command
|
||||||
usage: /<command> [test|stop]
|
aliases:
|
||||||
|
- foobar
|
||||||
|
- fubar
|
||||||
permission: test.foo
|
permission: test.foo
|
||||||
permission-message: You do not have permission!
|
permission-message: You do not have permission!
|
||||||
aliases: [foobar, fubar]
|
usage: /<command> [test|stop]
|
||||||
bar: {}
|
|
||||||
database: true
|
|
||||||
main: org.spigotmc.annotationtest.Test
|
|
||||||
version: v1.0
|
|
||||||
softdepend: [Vault]
|
|
||||||
author: md_5
|
|
||||||
description: A test plugin.
|
|
||||||
name: Test
|
|
||||||
prefix: Testing
|
|
||||||
permissions:
|
permissions:
|
||||||
test.*:
|
test.foo:
|
||||||
|
description: Allows foo command
|
||||||
default: op
|
default: op
|
||||||
description: Wildcard perm
|
test.*:
|
||||||
children: {test.foo: true}
|
description: Wildcard permission
|
||||||
test.foo: {default: op, description: Allows foo command}
|
default: op
|
||||||
load: POSTWORLD
|
children:
|
||||||
loadbefore: [Essential:s]
|
test.foo: true
|
||||||
```
|
```
|
||||||
|
|
Loading…
Add table
Reference in a new issue