This commit is contained in:
Bella 2020-03-08 13:19:16 -04:00
parent d51a5b0d67
commit a2eff4ba19
13 changed files with 13 additions and 38 deletions

View File

@ -10,8 +10,6 @@ import net.minecraft.launchwrapper.LogWrapper;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentBase;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -20,7 +18,6 @@ public abstract class Command {
protected String label;
protected String syntax;
protected String description;
protected ArrayList<String> aliases;
public final Minecraft mc = Minecraft.getMinecraft();
@ -28,18 +25,10 @@ public abstract class Command {
public static Setting<String> commandPrefix = Settings.s("commandPrefix", ".");
public Command(String label, SyntaxChunk[] syntaxChunks, ArrayList<String> aliases) {
public Command(String label, SyntaxChunk[] syntaxChunks) {
this.label = label;
this.syntaxChunks = syntaxChunks;
this.description = "Descriptionless";
this.aliases = aliases;
}
public Command(String label, SyntaxChunk[] syntaxChunks, String... aliases) {
this.label = label;
this.syntaxChunks = syntaxChunks;
this.description = "Descriptionless";
this.aliases = new ArrayList<String>(Arrays.asList(aliases));
}
public static void sendChatMessage(String message) {
@ -95,10 +84,6 @@ public abstract class Command {
return label;
}
public ArrayList<String> getAliases() {
return aliases;
}
public abstract void call(String[] args);
public SyntaxChunk[] getSyntaxChunks() {

View File

@ -44,22 +44,12 @@ public class CommandManager {
for (Command c : commands) {
if (c.getLabel().equalsIgnoreCase(label)) {
if (!c.getAliases().isEmpty()) {
Command.sendChatMessage("This command has aliases!");
Command.sendChatMessage(c.getLabel() + ", " + String.join(", ", c.getAliases()));
}
c.call(parts);
return;
}
else for (int i = 0; i < c.getAliases().size(); i++) {
if (c.getAliases().get(i).equalsIgnoreCase(label)) {
c.call(parts);
return;
}
}
}
Command.sendChatMessage("Unknown command. try 'cmds' for a list of commands.");
Command.sendChatMessage("Unknown command. try 'commands' for a list of commands.");
}
public static String[] removeElement(String[] input, int indexToDelete) {

View File

@ -12,7 +12,7 @@ import java.util.Comparator;
public class CommandsCommand extends Command {
public CommandsCommand() {
super("commands", SyntaxChunk.EMPTY, "cmd", "cmds");
super("commands", SyntaxChunk.EMPTY);
setDescription("Gives you this list of commands");
}

View File

@ -22,7 +22,7 @@ public class ConfigCommand extends Command {
super("config", new ChunkBuilder()
.append("mode", true, new EnumParser(new String[]{"reload", "save", "path"}))
.append("path", true, new DependantParser(0, new DependantParser.Dependency(new String[][]{{"path", "path"}}, "")))
.build(), "cfg");
.build());
setDescription("Change where your config is saved or manually save and reload your config");
}

View File

@ -8,7 +8,7 @@ import me.zeroeightsix.kami.command.Command;
public class CreditsCommand extends Command {
public CreditsCommand() {
super("credits", null, "creds");
super("credits", null);
setDescription("Prints KAMI Blue's authors and contributors");
}

View File

@ -15,7 +15,7 @@ import java.math.RoundingMode;
public class EntityStatsCommand extends Command {
public EntityStatsCommand() {
super("entitystats", null, "estats", "horestats", "hstats", "vehiclestats");
super("entitystats", null);
setDescription("Print the statistics of the entity you're currently riding");
}

View File

@ -26,7 +26,7 @@ public class FriendCommand extends Command {
super("friend", new ChunkBuilder()
.append("mode", true, new EnumParser(new String[]{"add", "del"}))
.append("name")
.build(), "friends", "f");
.build());
setDescription("Add someone as your friend!");
}

View File

@ -34,7 +34,7 @@ public class HelpCommand extends Command {
}
public HelpCommand() {
super("help", new SyntaxChunk[]{}, "?");
super("help", new SyntaxChunk[]{});
setDescription("Delivers help on certain subjects. Use &7" + Command.getCommandPrefix() + "help subjects&8 for a list.");
}

View File

@ -10,7 +10,7 @@ import net.minecraft.pathfinding.PathPoint;
*/
public class PathCommand extends Command {
public PathCommand() {
super("path", new ChunkBuilder().append("x").append("y").append("z").build(), "pathfind");
super("path", new ChunkBuilder().append("x").append("y").append("z").build());
setDescription("Pathfinding for AutoWalk");
}

View File

@ -20,7 +20,7 @@ import java.util.ArrayList;
public class SignBookCommand extends Command {
public SignBookCommand() {
super("signbook", new ChunkBuilder().append("name").build(), "book", "sign");
super("signbook", new ChunkBuilder().append("name").build());
setDescription("Colored book names. &7#n&8 for a new line and &7&&8 for colour codes");
}

View File

@ -26,7 +26,7 @@ public class TeleportCommand extends Command {
.append("y", true)
.append("z", true)
.append("blocks per tp", false)
.build(), "tp", "hclip", "clip");
.build());
setDescription("Potentia teleport exploit");
}

View File

@ -14,7 +14,7 @@ public class ToggleCommand extends Command {
public ToggleCommand() {
super("toggle", new ChunkBuilder()
.append("module", true, new ModuleParser())
.build(), "t");
.build());
setDescription("Quickly toggle a module on and off");
}

View File

@ -14,7 +14,7 @@ public class VanishCommand extends Command {
Minecraft mc = Minecraft.getMinecraft();
public VanishCommand() {
super("vanish", null, "entitydesync", "edesync", "entityvanish", "evanish", "ev", "van");
super("vanish", null);
setDescription("Allows you to vanish using an entity");
}