mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-02 22:17:17 +00:00
Command executing
This commit is contained in:
1 parent
e335a48888
commit
83d5a921ee
7 files changed
+98
-29
No files matched your search
@@ -4,8 +4,6 @@ import net.william278.huskhomes.HuskHomes;
|
||||
import net.william278.huskhomes.player.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Represents an abstract cross-platform representation for a plugin command
|
||||
*/
|
||||
@@ -47,15 +45,6 @@ public abstract class CommandBase {
|
||||
*/
|
||||
public abstract void onExecute(@NotNull Player player, @NotNull String[] args);
|
||||
|
||||
/**
|
||||
* What should be returned when the player attempts to TAB-complete the command
|
||||
*
|
||||
* @param player {@link Player} doing the TAB completion
|
||||
* @param args Current command arguments
|
||||
* @return List of String arguments to offer TAB suggestions
|
||||
*/
|
||||
public abstract List<String> onTabComplete(@NotNull Player player, @NotNull String[] args);
|
||||
|
||||
/**
|
||||
* Returns the localised description string of this command
|
||||
*
|
||||
|
||||
@@ -2,8 +2,16 @@ package net.william278.huskhomes.command;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
/**
|
||||
* Interface providing console execution of commands
|
||||
*/
|
||||
public interface ConsoleExecutable {
|
||||
|
||||
/**
|
||||
* What to do when console executes a command
|
||||
*
|
||||
* @param args command argument strings
|
||||
*/
|
||||
void onConsoleExecute(@NotNull String[] args);
|
||||
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class HomeCommand extends CommandBase {
|
||||
public class HomeCommand extends CommandBase implements TabCompletable {
|
||||
|
||||
private final static String PERMISSION = "huskhomes.command.home";
|
||||
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
package net.william278.huskhomes.command;
|
||||
|
||||
import net.william278.huskhomes.player.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Interface providing tab completions for a command
|
||||
*/
|
||||
public interface TabCompletable {
|
||||
|
||||
/**
|
||||
* What should be returned when the player attempts to TAB-complete the command
|
||||
*
|
||||
* @param player {@link Player} doing the TAB completion
|
||||
* @param args Current command arguments
|
||||
* @return List of String arguments to offer TAB suggestions
|
||||
*/
|
||||
List<String> onTabComplete(@NotNull Player player, @NotNull String[] args);
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user