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


Java FireworkMeta.getPower方法代碼示例

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


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

示例1: setFireworkMeta

import org.bukkit.inventory.meta.FireworkMeta; //導入方法依賴的package包/類
@Override
public void setFireworkMeta(FireworkMeta meta) {
    item.setItemMeta(meta);

    // Copied from EntityFireworks constructor, update firework lifetime/power
    getHandle().lifetime = 10 * (1 + meta.getPower()) + random.nextInt(6) + random.nextInt(7);

    getHandle().getDataWatcher().setObjectWatched(FIREWORK_ITEM_INDEX); // Update
}
 
開發者ID:UraniumMC,項目名稱:Uranium,代碼行數:10,代碼來源:CraftFirework.java

示例2: 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

示例3: setFireworkMeta

import org.bukkit.inventory.meta.FireworkMeta; //導入方法依賴的package包/類
@Override
public void setFireworkMeta(FireworkMeta meta) {
    item.setItemMeta(meta);

    // Copied from EntityFireworks constructor, update firework lifetime/power
    getHandle().expectedLifespan = 10 * (1 + meta.getPower()) + random.nextInt(6) + random.nextInt(7);

    getHandle().getDataWatcher().update(FIREWORK_ITEM_INDEX);
}
 
開發者ID:OvercastNetwork,項目名稱:CraftBukkit,代碼行數:10,代碼來源:CraftFirework.java

示例4: setFireworkMeta

import org.bukkit.inventory.meta.FireworkMeta; //導入方法依賴的package包/類
public void setFireworkMeta(FireworkMeta meta) {
    item.setItemMeta(meta);

    // Copied from EntityFireworks constructor, update firework lifetime/power
    getHandle().expectedLifespan = 10 * (1 + meta.getPower()) + random.nextInt(6) + random.nextInt(7);

    getHandle().getDataWatcher().h(FIREWORK_ITEM_INDEX); // Update
}
 
開發者ID:AlmuraDev,項目名稱:Almura-Server,代碼行數:9,代碼來源:CraftFirework.java

示例5: 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

示例6: 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

示例7: setFireworkMeta

import org.bukkit.inventory.meta.FireworkMeta; //導入方法依賴的package包/類
@Override
public void setFireworkMeta(FireworkMeta meta) {
    item.setItemMeta(meta);

    // Copied from EntityFireworks constructor, update firework lifetime/power
    getHandle().expectedLifespan = 10 * (1 + meta.getPower()) + random.nextInt(6) + random.nextInt(7);

    getHandle().getDataWatcher().markDirty(EntityFireworks.FIREWORK_ITEM);
}
 
開發者ID:bergerkiller,項目名稱:SpigotSource,代碼行數:10,代碼來源:CraftFirework.java

示例8: 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

示例9: 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

示例10: setFireworkMeta

import org.bukkit.inventory.meta.FireworkMeta; //導入方法依賴的package包/類
public void setFireworkMeta(FireworkMeta meta) {
    item.setItemMeta(meta);

    // Copied from EntityFireworks constructor, update firework lifetime/power
    getHandle().field_92055_b = 10 * (1 + meta.getPower()) + random.nextInt(6) + random.nextInt(7);

    getHandle().func_70096_w().func_82708_h(FIREWORK_ITEM_INDEX); // Update
}
 
開發者ID:agaricusb,項目名稱:MCPBukkit,代碼行數:9,代碼來源:CraftFirework.java


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