forked from RepoMirrors/kami-blue
revert ccc6db61ef
This commit is contained in:
parent
d51a5b0d67
commit
a2eff4ba19
|
@ -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() {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
@ -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!");
|
||||
}
|
||||
|
||||
|
|
|
@ -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.");
|
||||
}
|
||||
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue