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