本文整理汇总了Java中org.bukkit.entity.AreaEffectCloud类的典型用法代码示例。如果您正苦于以下问题:Java AreaEffectCloud类的具体用法?Java AreaEffectCloud怎么用?Java AreaEffectCloud使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AreaEffectCloud类属于org.bukkit.entity包,在下文中一共展示了AreaEffectCloud类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onPotionLinger
import org.bukkit.entity.AreaEffectCloud; //导入依赖的package包/类
@EventHandler
public void onPotionLinger(final AreaEffectCloudApplyEvent event) {
final AreaEffectCloud cloud = event.getEntity();
if(PotionClassification.classify(cloud) != PotionClassification.HARMFUL) return;
for(Iterator<LivingEntity> iterator = event.getAffectedEntities().iterator(); iterator.hasNext(); ) {
final LivingEntity victim = iterator.next();
final ParticipantState victimState = getMatch().getParticipantState(victim);
final DamageInfo damageInfo = damageResolver.resolveDamage(EntityDamageEvent.DamageCause.MAGIC, victim, cloud);
if(victimState != null && queryDamage(event, victimState, damageInfo).isDenied()) {
iterator.remove();
}
}
}
示例2: callLingeringPotionSplashEvent
import org.bukkit.entity.AreaEffectCloud; //导入依赖的package包/类
public static LingeringPotionSplashEvent callLingeringPotionSplashEvent(EntityPotion potion, EntityAreaEffectCloud cloud) {
ThrownPotion thrownPotion = (ThrownPotion) potion.getBukkitEntity();
AreaEffectCloud effectCloud = (AreaEffectCloud) cloud.getBukkitEntity();
LingeringPotionSplashEvent event = new LingeringPotionSplashEvent(thrownPotion, effectCloud);
Bukkit.getPluginManager().callEvent(event);
return event;
}
示例3: effects
import org.bukkit.entity.AreaEffectCloud; //导入依赖的package包/类
public static Collection<PotionEffect> effects(AreaEffectCloud cloud) {
return effects(cloud.getBasePotionData(), cloud.getCustomEffects());
}
示例4: callAreaEffectCloudApplyEvent
import org.bukkit.entity.AreaEffectCloud; //导入依赖的package包/类
public static AreaEffectCloudApplyEvent callAreaEffectCloudApplyEvent(EntityAreaEffectCloud cloud, List<LivingEntity> entities) {
AreaEffectCloudApplyEvent event = new AreaEffectCloudApplyEvent((AreaEffectCloud) cloud.getBukkitEntity(), entities);
cloud.world.getServer().getPluginManager().callEvent(event);
return event;
}