summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/EntitySnowball.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/minecraft/server/EntitySnowball.java')
-rw-r--r--src/main/java/net/minecraft/server/EntitySnowball.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/net/minecraft/server/EntitySnowball.java b/src/main/java/net/minecraft/server/EntitySnowball.java
index d1e66f8c..d89221a8 100644
--- a/src/main/java/net/minecraft/server/EntitySnowball.java
+++ b/src/main/java/net/minecraft/server/EntitySnowball.java
@@ -5,7 +5,7 @@ import java.util.List;
// CraftBukkit start
import org.bukkit.craftbukkit.entity.CraftLivingEntity;
import org.bukkit.entity.Projectile;
-import org.bukkit.event.entity.EntityDamageByProjectileEvent;
+import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.ProjectileHitEvent;
// CraftBukkit end
@@ -159,15 +159,15 @@ public class EntitySnowball extends Entity {
Projectile projectile = (Projectile) this.getBukkitEntity();
// TODO @see EntityArrow#162
- EntityDamageByProjectileEvent event = new EntityDamageByProjectileEvent(damagee, projectile, EntityDamageEvent.DamageCause.ENTITY_ATTACK, 0);
+ EntityDamageByEntityEvent event = new EntityDamageByEntityEvent(projectile, damagee, EntityDamageEvent.DamageCause.PROJECTILE, 0);
this.world.getServer().getPluginManager().callEvent(event);
this.shooter = (projectile.getShooter() == null) ? null : ((CraftLivingEntity) projectile.getShooter()).getHandle();
if (event.isCancelled()) {
- stick = !event.getBounce();
+ stick = !projectile.doesBounce();
} else {
// this function returns if the snowball should stick in or not, i.e. !bounce
- stick = movingobjectposition.entity.damageEntity(this.shooter, event.getDamage());
+ stick = movingobjectposition.entity.damageEntity(this, event.getDamage());
}
} else {
stick = movingobjectposition.entity.damageEntity(this.shooter, 0);