本文整理汇总了Java中be.maximvdw.placeholderapi.PlaceholderAPI类的典型用法代码示例。如果您正苦于以下问题:Java PlaceholderAPI类的具体用法?Java PlaceholderAPI怎么用?Java PlaceholderAPI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PlaceholderAPI类属于be.maximvdw.placeholderapi包,在下文中一共展示了PlaceholderAPI类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initialize
import be.maximvdw.placeholderapi.PlaceholderAPI; //导入依赖的package包/类
@Override
public boolean initialize(List<Integer> enabledRanks) {
LastReplacer lastReplacer = new LastReplacer(this.lastReplacer);
boolean updated = PlaceholderAPI.registerPlaceholder(plugin, "factionstop_name:last", lastReplacer);
for (int rank : enabledRanks) {
RankReplacer replacer = new RankReplacer(rankReplacer, rank);
if (PlaceholderAPI.registerPlaceholder(plugin, "factionstop_name:" + rank, replacer)) {
updated = true;
}
}
PlayerReplacer playerReplacer = new PlayerReplacer(this.playerReplacer);
if (PlaceholderAPI.registerPlaceholder(plugin, "factionstop_rank:player", playerReplacer)) {
updated = true;
}
return updated;
}
开发者ID:novucs,项目名称:factions-top,代码行数:20,代码来源:MVdWPlaceholderAPIHook.java
示例2: MVdWPlaceholderApiHook
import be.maximvdw.placeholderapi.PlaceholderAPI; //导入依赖的package包/类
/**
* Creates the MVdWPlaceholderAPI hook with the main class instance.
*
* @param plugin The EmojiChat main class instance.
*/
public MVdWPlaceholderApiHook(EmojiChat plugin) {
for (String key : plugin.getEmojiHandler().getEmojis().keySet()) {
PlaceholderAPI.registerStaticPlaceholders(plugin, key.replace(":", ""), plugin.getEmojiHandler().getEmojis().get(key).toString());
}
plugin.getLogger().info("Hooked " + getName());
enabled = true;
}
开发者ID:RadBuilder,项目名称:EmojiChat,代码行数:14,代码来源:MVdWPlaceholderApiHook.java
示例3: MVdWPlaceholderHook
import be.maximvdw.placeholderapi.PlaceholderAPI; //导入依赖的package包/类
public MVdWPlaceholderHook(Core instance) {
super("MVdWPlaceholderAPI");
this.instance = instance;
if (isEnabled()) {
for (String placeholder : PLACEHOLDERS) {
PlaceholderAPI.registerPlaceholder(instance, placeholder, this);
}
}
}
开发者ID:RealizedMC,项目名称:Duels,代码行数:11,代码来源:MVdWPlaceholderHook.java
示例4: registerPlaceHolder
import be.maximvdw.placeholderapi.PlaceholderAPI; //导入依赖的package包/类
public static void registerPlaceHolder(Loader loader, String name, final FeatherBoardReplaceEvent event) {
if (loader instanceof BukkitLoader) {
if (Bukkit.getPluginManager().isPluginEnabled("MVdWPlaceholderAPI")) {
PlaceholderAPI.registerPlaceholder((Plugin) loader, name, new PlaceholderReplacer() {
@Override
public String onPlaceholderReplace(PlaceholderReplaceEvent placeholderReplaceEvent) {
return event.getValue(placeholderReplaceEvent.getOfflinePlayer().getName(), placeholderReplaceEvent.isOnline());
}
});
}
}
}
开发者ID:greatman,项目名称:GreatmancodeTools,代码行数:13,代码来源:FeatherBoard.java
注:本文中的be.maximvdw.placeholderapi.PlaceholderAPI类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论