mirror of
https://github.com/Freezy-Studios/BlazeSMP.git
synced 2025-04-22 04:44:04 +02:00
Updated a libary!
This commit is contained in:
parent
293938e58a
commit
f2c3f65d76
1 changed files with 11 additions and 22 deletions
|
@ -7,9 +7,9 @@ import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
@SuppressWarnings("ALL")
|
|
||||||
public abstract class SimpleCommand implements CommandExecutor, TabExecutor {
|
public abstract class SimpleCommand implements CommandExecutor, TabExecutor {
|
||||||
protected static Logger logger = Logger.getLogger(BlazeSMP.class.getName());
|
protected static Logger logger = Logger.getLogger(BlazeSMP.class.getName());
|
||||||
protected static CommandMap cmap;
|
protected static CommandMap cmap;
|
||||||
|
@ -17,43 +17,33 @@ public abstract class SimpleCommand implements CommandExecutor, TabExecutor {
|
||||||
protected final String description;
|
protected final String description;
|
||||||
protected final List<String> alias;
|
protected final List<String> alias;
|
||||||
protected final String usage;
|
protected final String usage;
|
||||||
protected final String permissionMessage;
|
|
||||||
protected final String permission;
|
protected final String permission;
|
||||||
|
|
||||||
public SimpleCommand(String command) {
|
public SimpleCommand(String command) {
|
||||||
this(command, null, null, null, null, null);
|
this(command, null, null, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SimpleCommand(String command, String usage) {
|
public SimpleCommand(String command, String usage) {
|
||||||
this(command, usage, null, null, null, null);
|
this(command, usage, null, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SimpleCommand(String command, String usage, String description) {
|
public SimpleCommand(String command, String usage, String description) {
|
||||||
this(command, usage, description, null, null, null);
|
this(command, usage, description, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SimpleCommand(String command, String usage, String description, List<String> alias) {
|
public SimpleCommand(String command, String usage, String description, List<String> alias) {
|
||||||
this(command, usage, description, null, null, alias);
|
this(command, usage, description, null, alias);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SimpleCommand(String command, String usage, String description, String permissionMessage) {
|
public SimpleCommand(String command, String usage, String description, String permission) {
|
||||||
this(command, usage, description, permissionMessage, null, null);
|
this(command, usage, description, permission, null);
|
||||||
}
|
|
||||||
|
|
||||||
public SimpleCommand(String command, String usage, String description, String permissionMessage, String permission) {
|
|
||||||
this(command, usage, description, permissionMessage, permission, null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public SimpleCommand(String command, String usage, String description, String permission, List<String> alias) {
|
public SimpleCommand(String command, String usage, String description, String permission, List<String> alias) {
|
||||||
this(command, usage, description, null, permission, alias);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SimpleCommand(String command, String usage, String description, String permissionMessage, String permission, List<String> alias) {
|
|
||||||
this.command = command;
|
this.command = command;
|
||||||
this.description = description;
|
this.description = description;
|
||||||
this.alias = alias;
|
this.alias = alias;
|
||||||
this.usage = usage;
|
this.usage = usage;
|
||||||
this.permissionMessage = permissionMessage;
|
|
||||||
this.permission = permission;
|
this.permission = permission;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,7 +52,6 @@ public abstract class SimpleCommand implements CommandExecutor, TabExecutor {
|
||||||
if (this.alias != null) cmd.setAliases(this.alias);
|
if (this.alias != null) cmd.setAliases(this.alias);
|
||||||
if (this.description != null) cmd.setDescription(this.description);
|
if (this.description != null) cmd.setDescription(this.description);
|
||||||
if (this.usage != null) cmd.setUsage(this.usage);
|
if (this.usage != null) cmd.setUsage(this.usage);
|
||||||
if (this.permissionMessage != null) cmd.setPermissionMessage(this.permissionMessage);
|
|
||||||
if (this.permission != null) cmd.setPermission(this.permission);
|
if (this.permission != null) cmd.setPermission(this.permission);
|
||||||
getCommandMap().register("blazesmp", cmd);
|
getCommandMap().register("blazesmp", cmd);
|
||||||
cmd.setExecutor(this);
|
cmd.setExecutor(this);
|
||||||
|
@ -104,11 +93,11 @@ public abstract class SimpleCommand implements CommandExecutor, TabExecutor {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, String[] args) {
|
public @NotNull List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, String[] args) {
|
||||||
if (exe != null) {
|
if (exe != null) {
|
||||||
return exe.onTabComplete(sender, this, alias, args);
|
return Objects.requireNonNull(exe.onTabComplete(sender, this, alias, args));
|
||||||
}
|
}
|
||||||
return null;
|
return List.of();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue