diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index d74c8a26a1..4e59a163d4 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -116,6 +116,7 @@ import org.bukkit.craftbukkit.metadata.BlockMetadataStore; import org.bukkit.craftbukkit.potion.CraftPotionUtil; import org.bukkit.craftbukkit.util.CraftMagicNumbers; import org.bukkit.craftbukkit.util.CraftRayTraceResult; +import org.bukkit.entity.AbstractArrow; import org.bukkit.entity.AbstractHorse; import org.bukkit.entity.AbstractVillager; import org.bukkit.entity.Ambient; @@ -1295,7 +1296,7 @@ public class CraftWorld implements World { entity = new EntitySnowball(world, x, y, z); } else if (Egg.class.isAssignableFrom(clazz)) { entity = new EntityEgg(world, x, y, z); - } else if (Arrow.class.isAssignableFrom(clazz)) { + } else if (AbstractArrow.class.isAssignableFrom(clazz)) { if (TippedArrow.class.isAssignableFrom(clazz)) { entity = EntityTypes.ARROW.a(world); ((EntityTippedArrow) entity).setType(CraftPotionUtil.fromBukkit(new PotionData(PotionType.WATER, false, false))); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java index a81805dd52..0e4afe8f00 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java @@ -6,12 +6,12 @@ import net.minecraft.server.EntityArrow; import org.apache.commons.lang.Validate; import org.bukkit.block.Block; import org.bukkit.craftbukkit.CraftServer; -import org.bukkit.entity.Arrow; +import org.bukkit.entity.AbstractArrow; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.projectiles.ProjectileSource; -public class CraftArrow extends AbstractProjectile implements Arrow { +public class CraftArrow extends AbstractProjectile implements AbstractArrow { public CraftArrow(CraftServer server, EntityArrow entity) { super(server, entity); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index 9e7fc19129..46b3001439 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -46,7 +46,7 @@ import org.bukkit.craftbukkit.CraftWorld; import org.bukkit.craftbukkit.inventory.CraftEntityEquipment; import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.craftbukkit.potion.CraftPotionUtil; -import org.bukkit.entity.Arrow; +import org.bukkit.entity.AbstractArrow; import org.bukkit.entity.DragonFireball; import org.bukkit.entity.Egg; import org.bukkit.entity.EnderPearl; @@ -369,7 +369,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { } else if (EnderPearl.class.isAssignableFrom(projectile)) { launch = new EntityEnderPearl(world, getHandle()); ((EntityProjectile) launch).a(getHandle(), getHandle().pitch, getHandle().yaw, 0.0F, 1.5F, 1.0F); // ItemEnderPearl - } else if (Arrow.class.isAssignableFrom(projectile)) { + } else if (AbstractArrow.class.isAssignableFrom(projectile)) { if (TippedArrow.class.isAssignableFrom(projectile)) { launch = new EntityTippedArrow(world, getHandle()); ((EntityTippedArrow) launch).setType(CraftPotionUtil.fromBukkit(new PotionData(PotionType.WATER, false, false))); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTippedArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTippedArrow.java index dab0f75e10..ced99327c0 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTippedArrow.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTippedArrow.java @@ -9,14 +9,13 @@ import org.apache.commons.lang.Validate; import org.bukkit.Color; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.potion.CraftPotionUtil; +import org.bukkit.entity.Arrow; import org.bukkit.entity.EntityType; -import org.bukkit.entity.TippedArrow; import org.bukkit.potion.PotionData; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; -import org.bukkit.potion.PotionType; -public class CraftTippedArrow extends CraftArrow implements TippedArrow { +public class CraftTippedArrow extends CraftArrow implements Arrow { public CraftTippedArrow(CraftServer server, EntityTippedArrow entity) { super(server, entity); @@ -59,7 +58,6 @@ public class CraftTippedArrow extends CraftArrow implements TippedArrow { @Override public void clearCustomEffects() { - Validate.isTrue(getBasePotionData().getType() != PotionType.UNCRAFTABLE, "Tipped Arrows must have at least 1 effect"); getHandle().effects.clear(); getHandle().refreshEffects(); } @@ -100,7 +98,6 @@ public class CraftTippedArrow extends CraftArrow implements TippedArrow { if (existing == null) { return false; } - Validate.isTrue(getBasePotionData().getType() != PotionType.UNCRAFTABLE || !getHandle().effects.isEmpty(), "Tipped Arrows must have at least 1 effect"); getHandle().effects.remove(existing); getHandle().refreshEffects(); return true; @@ -109,7 +106,6 @@ public class CraftTippedArrow extends CraftArrow implements TippedArrow { @Override public void setBasePotionData(PotionData data) { Validate.notNull(data, "PotionData cannot be null"); - Validate.isTrue(data.getType() != PotionType.UNCRAFTABLE || !getHandle().effects.isEmpty(), "Tipped Arrows must have at least 1 effect"); getHandle().setType(CraftPotionUtil.fromBukkit(data)); } diff --git a/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java b/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java index 275cde801c..f7b48d1197 100644 --- a/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java +++ b/src/main/java/org/bukkit/craftbukkit/projectiles/CraftBlockProjectileSource.java @@ -25,6 +25,7 @@ import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.craftbukkit.potion.CraftPotionUtil; +import org.bukkit.entity.AbstractArrow; import org.bukkit.entity.Arrow; import org.bukkit.entity.Egg; import org.bukkit.entity.EnderPearl; @@ -89,7 +90,7 @@ public class CraftBlockProjectileSource implements BlockProjectileSource { launch = new EntityPotion(world, iposition.getX(), iposition.getY(), iposition.getZ()); ((EntityPotion) launch).setItem(CraftItemStack.asNMSCopy(new ItemStack(org.bukkit.Material.SPLASH_POTION, 1))); } - } else if (Arrow.class.isAssignableFrom(projectile)) { + } else if (AbstractArrow.class.isAssignableFrom(projectile)) { if (TippedArrow.class.isAssignableFrom(projectile)) { launch = new EntityTippedArrow(world, iposition.getX(), iposition.getY(), iposition.getZ()); ((EntityTippedArrow) launch).setType(CraftPotionUtil.fromBukkit(new PotionData(PotionType.WATER, false, false)));