summaryrefslogtreecommitdiffstats
path: root/README.md
blob: e81a80b15b295981731ec0b3cc9d593333129b79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# plugin-annotations
Add this jar to your pom.xml to enable automatic annotation-based plugin.yml generation.

## Example Usage
```
package org.spigotmc.annotationtest;

import org.bukkit.permissions.PermissionDefault;
import org.bukkit.plugin.PluginLoadOrder;
import org.bukkit.plugin.java.*;
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"}
        )
})
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

website: spigotmc.org
depend: [WorldEdit, Towny]
commands:
  foo:
    description: Foo command
    usage: /<command> [test|stop]
    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
permissions:
  test.*:
    default: op
    description: Wildcard perm
    children: {test.foo: true}
  test.foo: {default: op, description: Allows foo command}
load: POSTWORLD
loadbefore: [Essential:s]
```