當前位置: 首頁>>代碼示例>>Java>>正文


Java PlaceholderAPI類代碼示例

本文整理匯總了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;未經允許,請勿轉載。