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


Java FireworkMeta.getEffects方法代碼示例

本文整理匯總了Java中org.bukkit.inventory.meta.FireworkMeta.getEffects方法的典型用法代碼示例。如果您正苦於以下問題:Java FireworkMeta.getEffects方法的具體用法?Java FireworkMeta.getEffects怎麽用?Java FireworkMeta.getEffects使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.bukkit.inventory.meta.FireworkMeta的用法示例。


在下文中一共展示了FireworkMeta.getEffects方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setFrom

import org.bukkit.inventory.meta.FireworkMeta; //導入方法依賴的package包/類
@Override
public SubMeta setFrom(ItemMeta meta) {
    if(meta instanceof FireworkMeta){
        FireworkMeta metas = (FireworkMeta) meta;
        power = metas.getPower();
        for(FireworkEffect eff : metas.getEffects())
            facts.add(new FireworkEffects(eff));
    }
    return this;
}
 
開發者ID:DevCrafters,項目名稱:SaveableSerializing,代碼行數:11,代碼來源:FireworksMeta.java

示例2: CardboardMetaFirework

import org.bukkit.inventory.meta.FireworkMeta; //導入方法依賴的package包/類
@SuppressWarnings("deprecation")
public CardboardMetaFirework(ItemStack firework) {

	this.id = firework.getTypeId();
	FireworkMeta meta = (FireworkMeta) firework.getItemMeta();
	for (FireworkEffect fw : meta.getEffects()) {
		this.effects.add(new CardboardFireworkEffect(fw));
	}

	this.power = meta.getPower();
}
 
開發者ID:StarQuestMinecraft,項目名稱:StarQuestCode,代碼行數:12,代碼來源:CardboardMetaFirework.java

示例3: CardboardMetaFirework

import org.bukkit.inventory.meta.FireworkMeta; //導入方法依賴的package包/類
public CardboardMetaFirework(ItemStack firework) {

		this.id = firework.getTypeId();
		FireworkMeta meta = (FireworkMeta) firework.getItemMeta();
		for (FireworkEffect fw : meta.getEffects()) {
			this.effects.add(new CardboardFireworkEffect(fw));
		}

		this.power = meta.getPower();
	}
 
開發者ID:StarQuestMinecraft,項目名稱:StarQuestCode,代碼行數:11,代碼來源:CardboardMetaFirework.java

示例4: initialize

import org.bukkit.inventory.meta.FireworkMeta; //導入方法依賴的package包/類
@Override
public SerialItemData initialize(ItemStack stack) {
  ItemMeta meta = stack.getItemMeta();
  if(meta instanceof FireworkMeta) {
    valid = true;

    FireworkMeta fireworkMeta = (FireworkMeta)meta;
    power = fireworkMeta.getPower();
    effects = fireworkMeta.getEffects();
  }
  return this;
}
 
開發者ID:TheNewEconomy,項目名稱:TNE-Bukkit,代碼行數:13,代碼來源:FireworkData.java

示例5: getFireworkMetaString

import org.bukkit.inventory.meta.FireworkMeta; //導入方法依賴的package包/類
private static String getFireworkMetaString(final FireworkMeta meta, final String[] separators) {
    final int power = meta.getPower();
    final List<FireworkEffect> effects = meta.getEffects();

    final StringBuilder builder = new StringBuilder();
    builder.append(Integer.toString(power)).append(separators[1]);
    if (!effects.isEmpty()) {
        builder.append(getFireworkEffectString(effects.get(0)));
        for (int i = 1; i < effects.size(); i++) {
            builder.append(separators[1]).append(getFireworkEffectString(effects.get(i)));
        }
    }

    return builder.toString();
}
 
開發者ID:Ribesg,項目名稱:NPlugins,代碼行數:16,代碼來源:ItemMetaUtil.java


注:本文中的org.bukkit.inventory.meta.FireworkMeta.getEffects方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。