本文整理汇总了Java中org.bukkit.entity.EntityType.SPLASH_POTION属性的典型用法代码示例。如果您正苦于以下问题:Java EntityType.SPLASH_POTION属性的具体用法?Java EntityType.SPLASH_POTION怎么用?Java EntityType.SPLASH_POTION使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.entity.EntityType
的用法示例。
在下文中一共展示了EntityType.SPLASH_POTION属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onProjectileLaunch
@EventHandler(priority=EventPriority.HIGHEST)
public void onProjectileLaunch(final ProjectileLaunchEvent event) {
final Projectile projectile = event.getEntity();
if (event.getEntityType() == EntityType.SPLASH_POTION && projectile.getType().equals((Object)PotionEffectType.HEAL)) {
if (projectile.getShooter() instanceof Player && ((Player) projectile.getShooter()).isSprinting()) {
final Vector velocity = projectile.getVelocity();
velocity.setY(velocity.getY() - 0.4);
}
}
}
示例2: onProjectileLaunch
@EventHandler
public void onProjectileLaunch(final ProjectileLaunchEvent event) {
if (event.getEntityType() == EntityType.SPLASH_POTION) {
final Projectile projectile = event.getEntity();
if (projectile.getShooter() instanceof Player && ((Player) projectile.getShooter()).isSprinting()) {
final Vector velocity = projectile.getVelocity();
velocity.setY(velocity.getY() - 0.8);
projectile.setVelocity(velocity);
}
}
}
示例3: getType
public EntityType getType() {
return EntityType.SPLASH_POTION;
}
示例4: isEntityThrownPotion
public static boolean isEntityThrownPotion(@NotNull Entity entity) {
return entity.getType() == EntityType.SPLASH_POTION || entity.getType() == EntityType.LINGERING_POTION;
}