You will need to change most of the code according to your client base/command base.
The reason why I posted this is for some odd reason, people find it difficult to make the bind command.
Anyways, enjoy!
// edit: changed to the right code tags (dirt)
Code:
package apple.commands;
import org.lwjgl.input.Keyboard;
import apple.Apple;
import apple.interfaces.CommandInterface;
@CommandInterface(name = "bind", help = "§9.bind §9(module) §9(key)")
public class Bind extends Command
{
@Override
public void onCommand (String [] arguments)
{
super.onCommand(arguments);
if (arguments.length != 2)
{
Apple.INSTANCE.addChatComponentMessage(getHelp());
}
else
{
try
{
Apple.INSTANCE.getModuleManager().getModule(arguments[0]).setKey(Keyboard.getKeyIndex(arguments[1].toUpperCase()));
Apple.INSTANCE.addChatComponentMessage("§aBound §a" + Apple.INSTANCE.getModuleManager().getModule(arguments[0]).getName() + " §ato §a" + Keyboard.getKeyName(Apple.INSTANCE.getModuleManager().getModule(arguments[0]).getKey()) + ".");
}
catch (NullPointerException nullPointerException)
{
Apple.INSTANCE.addChatComponentMessage(getHelp());
}
}
}
}
Anyways, enjoy!
// edit: changed to the right code tags (dirt)
Last edited by a moderator: