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