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