diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index 0dcadcad..c49f0aa4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -11,7 +11,6 @@ import net.minecraft.server.EntityArrow; import net.minecraft.server.EntityEgg; import net.minecraft.server.EntityEnderDragon; import net.minecraft.server.EntityEnderPearl; -import net.minecraft.server.EntityFireball; import net.minecraft.server.EntityLargeFireball; import net.minecraft.server.EntityLiving; import net.minecraft.server.EntitySmallFireball; @@ -278,19 +277,18 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { } else if (Arrow.class.isAssignableFrom(projectile)) { launch = new EntityArrow(world, getHandle(), 1); } else if (Fireball.class.isAssignableFrom(projectile)) { + Location location = getEyeLocation(); + Vector direction = location.getDirection().multiply(10); + if (SmallFireball.class.isAssignableFrom(projectile)) { - launch = new EntitySmallFireball(world); + launch = new EntitySmallFireball(world, getHandle(), direction.getX(), direction.getY(), direction.getZ()); } else if (WitherSkull.class.isAssignableFrom(projectile)) { - launch = new EntityWitherSkull(world); + launch = new EntityWitherSkull(world, getHandle(), direction.getX(), direction.getY(), direction.getZ()); } else { - launch = new EntityLargeFireball(world); + launch = new EntityLargeFireball(world, getHandle(), direction.getX(), direction.getY(), direction.getZ()); } - Location location = getEyeLocation(); - Vector direction = location.getDirection().multiply(10); - launch.setPositionRotation(location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch()); - ((EntityFireball) launch).setDirection(direction.getX(), direction.getY(), direction.getZ()); } Validate.notNull(launch, "Projectile not supported"); |