summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSenmori <thesenmori@gmail.com>2018-03-06 18:24:13 -0500
committerSenmori <thesenmori@gmail.com>2018-03-06 18:24:13 -0500
commite677cffa5de059d623c03705f9568b57447f5b05 (patch)
tree23d3c10d2eda0b7e049716cc8bb2d005e890455c
parent1c5f2a077f4731ee9f3e6e4af7cca1ca87c67276 (diff)
downloadplugin-annotations-e677cffa5de059d623c03705f9568b57447f5b05.tar
plugin-annotations-e677cffa5de059d623c03705f9568b57447f5b05.tar.gz
plugin-annotations-e677cffa5de059d623c03705f9568b57447f5b05.tar.lz
plugin-annotations-e677cffa5de059d623c03705f9568b57447f5b05.tar.xz
plugin-annotations-e677cffa5de059d623c03705f9568b57447f5b05.zip
Update README to reflect changes.
-rw-r--r--README.md99
1 files changed, 43 insertions, 56 deletions
diff --git a/README.md b/README.md
index e81a80b..82e6b46 100644
--- a/README.md
+++ b/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.foo:
+ description: Allows foo command
+ default: op
test.*:
+ description: Wildcard permission
default: op
- description: Wildcard perm
- children: {test.foo: true}
- test.foo: {default: op, description: Allows foo command}
-load: POSTWORLD
-loadbefore: [Essential:s]
-``` \ No newline at end of file
+ children:
+ test.foo: true
+```