本文整理汇总了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();
}