-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
29 changed files
with
564 additions
and
649 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
plugin_version = 2.0.0 | ||
plugin_id = customdiscs |
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
25 changes: 25 additions & 0 deletions
25
src/main/java/io/github/subkek/customdiscs/command/AbstractSubCommand.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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package io.github.subkek.customdiscs.command; | ||
|
||
import dev.jorel.commandapi.CommandAPICommand; | ||
import dev.jorel.commandapi.executors.CommandArguments; | ||
import io.github.subkek.customdiscs.util.Formatter; | ||
import org.bukkit.command.CommandSender; | ||
|
||
public abstract class AbstractSubCommand extends CommandAPICommand { | ||
public AbstractSubCommand(String commandName) { | ||
super(commandName); | ||
} | ||
|
||
protected <T>T getArgumentValue(CommandArguments arguments, String nodeName, Class<T> argumentType) { | ||
T value; | ||
if ((value = arguments.getByClass(nodeName, argumentType)) == null) | ||
throw new IllegalArgumentException(Formatter.format( | ||
"Couldn't find argument {0} with name", nodeName | ||
)); | ||
return value; | ||
} | ||
|
||
public abstract String getDescription(); | ||
public abstract String getSyntax(); | ||
public abstract boolean hasPermission(CommandSender sender); | ||
} |
Oops, something went wrong.