java类org.bukkit.command.TabExecutor的实例源码

SqlStat.java 文件源码 项目:sqlstat 阅读 27 收藏 0 点赞 0 评论 0
@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.java 文件源码 项目:TitleApi 阅读 23 收藏 0 点赞 0 评论 0
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);
    }


问题


面经


文章

微信
公众号

扫码关注公众号