本文整理匯總了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;
}