当前位置: 首页>>代码示例>>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;未经允许,请勿转载。