mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-01 22:16:08 +00:00
More implementation, timed teleports, regex, etc
This commit is contained in:
1 parent
7ac52d747f
commit
e335a48888
25 files changed
+803
-157
No files matched your search
@@ -2,6 +2,7 @@ package net.william278.huskhomes.command;
|
||||
|
||||
import net.william278.huskhomes.HuskHomes;
|
||||
import net.william278.huskhomes.player.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -26,15 +27,15 @@ public abstract class CommandBase {
|
||||
public final String[] aliases;
|
||||
|
||||
/**
|
||||
* Instance of the proxy plugin implementor
|
||||
* Instance of the implementing plugin
|
||||
*/
|
||||
public final HuskHomes implementor;
|
||||
public final HuskHomes plugin;
|
||||
|
||||
|
||||
public CommandBase(String command, String permission, HuskHomes implementingPlugin, String... aliases) {
|
||||
public CommandBase(@NotNull String command, @NotNull String permission, @NotNull HuskHomes implementor, String... aliases) {
|
||||
this.command = command;
|
||||
this.permission = permission;
|
||||
this.implementor = implementingPlugin;
|
||||
this.plugin = implementor;
|
||||
this.aliases = aliases;
|
||||
}
|
||||
|
||||
@@ -44,15 +45,25 @@ public abstract class CommandBase {
|
||||
* @param player {@link Player} executing the command
|
||||
* @param args Command arguments
|
||||
*/
|
||||
public abstract void onExecute(Player player, String[] args);
|
||||
public abstract void onExecute(@NotNull Player player, @NotNull String[] args);
|
||||
|
||||
/**
|
||||
* What should be returned when the player attempts to TAB complete the command
|
||||
* 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(Player player, String[] args);
|
||||
public abstract List<String> onTabComplete(@NotNull Player player, @NotNull String[] args);
|
||||
|
||||
/**
|
||||
* Returns the localised description string of this command
|
||||
*
|
||||
* @return the command description
|
||||
*/
|
||||
public String getDescription() {
|
||||
return plugin.getLocales().getRawLocale(command + "_command_description")
|
||||
.orElse("A HuskHomes command");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user