Java 类org.bukkit.command.TabExecutor 实例源码

项目:sqlstat    文件:SqlStat.java   
@Override
public void onEnable(){
    instance = this;

    //コンフィグとjavaドライバーのロード
    config = Config.loadConfig();
    stat = new Stat(config);
    getLogger().info("config load completed" + config.getURL() + config.getDB());

    //コマンドの登録
    commands = new HashMap<String, TabExecutor>();
    commands.put("sql", new CSql(this));
    commands.put("stat", new CStat(this));
    commands.put("addperms", new CAddPerms(this));

    //リスナーの登録
    this.getServer().getPluginManager().registerEvents(new LJoinQuit(this), this);
    this.getServer().getPluginManager().registerEvents(this, this);
}
项目:TitleApi    文件:TitleApi.java   
protected void setUpPlaceHolders() {

        placeholder = new Placeholder(this);
        placeholder.registerHolder(new PlayerHolder(HolderType.PLAYER, this));
        placeholder.registerHolder(new StatsHolder(HolderType.STATS, this));

        TabExecutor cmd = new PlaceCommand(placeholder.getHolder(HolderType.PLAYER), placeholder.getHolder(HolderType.STATS), placeholder);
        getCommand("testholder").setExecutor(cmd);
        getCommand("testholder").setTabCompleter(cmd);
        getCommand("testbar").setExecutor(cmd);
        getCommand("testtab").setExecutor(cmd);
        getCommand("testcount").setExecutor(cmd);
    }