All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.badbird5907.blib.command.BaseCommand Maven / Gradle / Ivy

There is a newer version: 2.1.11-REL
Show newest version
package net.badbird5907.blib.command;

import net.badbird5907.blib.annotation.Disable;
import net.badbird5907.blib.bLib;
import org.bukkit.ChatColor;
import org.bukkit.plugin.Plugin;

import java.util.List;

public abstract class BaseCommand {
    public Plugin plugin = bLib.getPlugin();

    public BaseCommand(){
        if (this.getClass().isAnnotationPresent(Disable.class))
            return;
        CommandFramework.getInstance().registerCommands(this);
    }
    public abstract CommandResult execute(Sender sender, String[] args);
    public List tabComplete(Sender sender, String[] args){
        return null;
    }
    private String usageMessage = "";

    public String getUsageMessage() {
        return usageMessage;
    }

    public void sendUsage(Sender sender){
        sender.sendMessage(ChatColor.translateAlternateColorCodes('&',this.getClass().getAnnotation(Command.class).usage()));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy