本文整理匯總了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;
}
示例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;
}
示例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);
}
}
}
示例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());
}
});
}
}
}