本文整理汇总了Java中org.bukkit.command.TabExecutor类的典型用法代码示例。如果您正苦于以下问题:Java TabExecutor类的具体用法?Java TabExecutor怎么用?Java TabExecutor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TabExecutor类属于org.bukkit.command包,在下文中一共展示了TabExecutor类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onEnable
import org.bukkit.command.TabExecutor; //导入依赖的package包/类
@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);
}
示例2: setUpPlaceHolders
import org.bukkit.command.TabExecutor; //导入依赖的package包/类
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);
}