-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f313fa2
commit 3387112
Showing
28 changed files
with
311 additions
and
6 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
17 changes: 17 additions & 0 deletions
17
...mmon/src/main/java/me/illusion/skyblockcore/common/command/audience/SkyblockAudience.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,28 @@ | ||
package me.illusion.skyblockcore.common.command.audience; | ||
|
||
/** | ||
* Represents a generic Audience-like class, similar to Bukkit's CommandSender | ||
*/ | ||
public interface SkyblockAudience { | ||
|
||
/** | ||
* Sends a raw message to the audience. | ||
* | ||
* @param message The message to send. | ||
*/ | ||
void sendMessage(String message); | ||
|
||
/** | ||
* Checks if the audience has a permission. | ||
* @param permission The permission to check. | ||
* @return Whether or not the audience has the permission. | ||
*/ | ||
boolean hasPermission(String permission); | ||
|
||
/** | ||
* Checks if the audience is a console. | ||
* @return Whether or not the audience is a console. | ||
*/ | ||
boolean isConsole(); | ||
|
||
} |
3 changes: 3 additions & 0 deletions
3
...c/main/java/me/illusion/skyblockcore/common/command/audience/SkyblockConsoleAudience.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
21 changes: 20 additions & 1 deletion
21
...Common/src/main/java/me/illusion/skyblockcore/common/command/context/CommandArgument.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
24 changes: 24 additions & 0 deletions
24
...-Common/src/main/java/me/illusion/skyblockcore/common/command/context/CommandContext.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,36 @@ | ||
package me.illusion.skyblockcore.common.command.context; | ||
|
||
/** | ||
* Represents a command context. This allows for the retrieval of arguments and is passed for tab completion and command execution. | ||
*/ | ||
public interface CommandContext { | ||
|
||
/** | ||
* Gets an argument by name | ||
* | ||
* @param name The name of the argument. | ||
* @param <T> The type of the argument. | ||
* @return The parsed argument. | ||
*/ | ||
<T> T getArgument(String name); // I know it's an unsafe cast, but Cloud commands do it too, so I'm not going to bother. | ||
|
||
/** | ||
* Gets an argument by index. Starts at 0. | ||
* @param index The index of the argument. | ||
* @return The parsed argument. | ||
* @param <T> The type of the argument. | ||
*/ | ||
<T> T getArgument(int index); | ||
|
||
/** | ||
* Gets the full input of the command. This is the full command, not just the arguments, without a / | ||
* @return The full input. | ||
*/ | ||
String getFullInput(); | ||
|
||
/** | ||
* Gets the last input of the command. This is the last word that was parsed by the last argument. | ||
* @return The last input. | ||
*/ | ||
String getLastInput(); | ||
} |
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
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
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
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
Oops, something went wrong.