本文整理汇总了Java中org.bukkit.potion.PotionEffect.isAmbient方法的典型用法代码示例。如果您正苦于以下问题:Java PotionEffect.isAmbient方法的具体用法?Java PotionEffect.isAmbient怎么用?Java PotionEffect.isAmbient使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.potion.PotionEffect
的用法示例。
在下文中一共展示了PotionEffect.isAmbient方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addCustomEffect
import org.bukkit.potion.PotionEffect; //导入方法依赖的package包/类
public boolean addCustomEffect(PotionEffect effect, boolean overwrite) {
Validate.notNull(effect, "Potion effect must not be null");
int index = indexOfEffect(effect.getType());
if (index != -1) {
if (overwrite) {
PotionEffect old = customEffects.get(index);
if (old.getAmplifier() == effect.getAmplifier() && old.getDuration() == effect.getDuration() && old.isAmbient() == effect.isAmbient()) {
return false;
}
customEffects.set(index, effect);
return true;
} else {
return false;
}
} else {
if (customEffects == null) {
customEffects = new ArrayList<PotionEffect>();
}
customEffects.add(effect);
return true;
}
}
示例2: setAbso
import org.bukkit.potion.PotionEffect; //导入方法依赖的package包/类
private void setAbso(int amount){
absoEffect = new PotionEffect(PotionEffectType.ABSORPTION, absoEffect.getDuration(), (amount/4)-1, absoEffect.isAmbient(),
absoEffect.hasParticles());
abso = amount;
}
示例3: setLevel
import org.bukkit.potion.PotionEffect; //导入方法依赖的package包/类
public static PotionEffect setLevel(PotionEffect effect, int level) {
return new PotionEffect(effect.getType(), effect.getDuration(), level-1, effect.isAmbient(),
effect.hasParticles());
}
示例4: setDuration
import org.bukkit.potion.PotionEffect; //导入方法依赖的package包/类
public static PotionEffect setDuration(PotionEffect effect, int duration) {
return new PotionEffect(effect.getType(), duration, effect.getAmplifier(), effect.isAmbient(),
effect.hasParticles());
}