-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
2.0.0
- Loading branch information
Showing
54 changed files
with
1,064 additions
and
693 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...on/blade/command/annotation/Combined.java → ...e/vaperion/blade/annotation/Combined.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package me.vaperion.blade.annotation; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({ElementType.METHOD, ElementType.TYPE}) | ||
public @interface Command { | ||
/** | ||
* The names you can use to execute this command. | ||
* <p>Example: <code>{"a", "b"}</code> => <code>/a</code>; <code>/b</code> | ||
*/ | ||
String[] value(); | ||
|
||
/** | ||
* This method indicates whether this command should be executed asynchronously or not. | ||
* <p>This is useful for interacting with a database in a command, so you don't have to do the threading manually. | ||
*/ | ||
boolean async() default false; | ||
|
||
/** | ||
* This method indicates whether quotes (<code>'</code>) and double quotes (<code>"</code>) should be parsed or not. | ||
* <p>If this is true, <code>"hello world"</code> will turn into one string argument instead of two (<code>"hello</code> and <code>world"</code>). | ||
*/ | ||
boolean quoted() default false; | ||
|
||
/** | ||
* This is the description of the command that is shown when you hover over the usage message. | ||
*/ | ||
String description() default ""; | ||
|
||
/** | ||
* This data will get appended to the end of the usage message. | ||
*/ | ||
String extraUsageData() default ""; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...perion/blade/command/annotation/Flag.java → ...va/me/vaperion/blade/annotation/Flag.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...perion/blade/command/annotation/Name.java → ...va/me/vaperion/blade/annotation/Name.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package me.vaperion.blade.annotation; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target(ElementType.PARAMETER) | ||
public @interface Optional { | ||
/** | ||
* The value will be used if the argument is not provided. | ||
* <p> | ||
* Reserved values: | ||
* <ul> | ||
* <li><code>null</code> => passes null</li> | ||
* <li><code>self</code> (for player types) => passes the sender</li> | ||
* </ul> | ||
* <p> | ||
* Any other value will be parsed. | ||
*/ | ||
String value() default "null"; | ||
|
||
/** | ||
* This method indicates whether <code>null</code> is allowed if an argument is provided. | ||
* <p> | ||
* <p>Example: | ||
* <p>Command declaration: <code>statsCommand(@Sender Player sender, @Name("player") @Optional Player target)</code> | ||
* <p>Executed commands: | ||
* <ul> | ||
* <li>/stats -> <code>null</code> gets passed because no argument was provided</li> | ||
* <li>/stats RealPlayer -> <code>RealPlayer</code> gets passed</li> | ||
* <li>/stats FakePlayer -> If {@link #ignoreFailedArgumentParse()} returns true, <code>null</code> will be passed, otherwise usage will be shown</li> | ||
* </ul> | ||
*/ | ||
boolean ignoreFailedArgumentParse() default false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.