E: Yes, this is nooby, but I know theres soo many having problems with something in their commands, and I just wanted to make this to help them.. so please don't post negative comments here or anything.. I have made a quick class that you have your commands class(1 command per class) to extend. You can do: Code:java class.getName(), class.getDescription(), class.getUsage(), class.getPermission(), class.getOpdefault(), class.getCodeName(), class.getAliases() Put this in your command class: Code:java public <ClassName>(){ super("Name", "Code_name", "Usage", "Permission", opDefaultBoolean, Arrays.asList("chris", "chris2"), "Description here"); } The actual class: Code:java package easierCommands; import java.util.List; /*** @author stoneminer02* Everything is made by stoneminer02.*/ public class CommandClass{private String name, usage, permission, code_name, description;private boolean opdefault;private List<String> aliases; public CommandClass(String name, String code_name, String usage,String permission, boolean opdefault, List<String> aliases, String description){this.name = name;this.code_name = code_name;this.usage = usage;this.permission = permission;this.opdefault = opdefault;this.aliases = aliases;this.description = description;} public String getName(){return name;} public String getDescription(){return description;} public String getUsage(){return usage;} public String getPermission(){return permission;} public boolean getOpdefault(){return opdefault;} public String getCodeName(){return code_name;} public List<String> getAliases(){return aliases;} /*** In a command where it displays all commands, write something like this:* for(CommandClass command : <Class with command files>.<command classes ArrayList>){* boolean opStuff = command.getOpdefault();* if(opStuff && sender.isOp())* opStuff = true;* else* opStuff = false;* if(sender.hasPermission(command.getPermission()) || opStuff){* //Stuff* }* }*/ /*** For the class with the ArrayList with the command classes, make something like this:* [Top] public static ArrayList<CommandClass> commands = new ArrayList<CommandClass>();* [Register place(Void, executed in onEnable or right in onEnable] getCommand("commandHelp").setExecutor(new Help());commands.add(new Help());*/} Example command class: Code:java package help; public class Help extends CommandClass implements CommandExecutor{public Help(){super("Help", "stonyadmin:help", "/stonyadmin:help","stonyadmin.commands.help", false, Arrays.asList("/help","/stonyhelp"),"Displays all the commands with description, usage and aliases.");} @Overridepublic boolean onCommand(CommandSender sender, Command cmd, String label,String[] args){//Stuff}} The example class is a bit copy pasted from my help class(plugin probably not gonna get released).
stoneminer02 What's the advantage of using your class over doing this? Code:java getCommand("theCommand").<methods here>(); http://jd.bukkit.org/rb/apidocs/org/bukkit/command/Command.html
Yep, this shouldn't be in the resources exactly.. Your just using getters and setter factors. If you have a basic java knowledge, you can code this on your own. Or use the quote above, use bukkit..
ChipDev d3v1n302418.is.amazing should be a sufficient name. You might wanna name the main clads d3v1n302418 as well...
No offense but how does this make things any easier? You still have to do the checks you would have to do normally from the looks of it...