From 4af24f3d03123fc9b49415b33e9a3e7d4678fa18 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Tue, 19 Jul 2011 13:26:00 -0700 Subject: [PATCH] Retiring EntityDamageByProjectileEvent in favor of EntityDamageEvent. By: sunkid --- .../entity/AbstractProjectile.java | 23 +++++++++++++++++++ .../bukkit/craftbukkit/entity/CraftArrow.java | 3 ++- .../bukkit/craftbukkit/entity/CraftEgg.java | 3 ++- .../craftbukkit/entity/CraftFireball.java | 2 +- .../bukkit/craftbukkit/entity/CraftFish.java | 2 +- .../craftbukkit/entity/CraftSnowball.java | 2 +- 6 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 paper-server/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java new file mode 100644 index 0000000000..7c1625519b --- /dev/null +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/AbstractProjectile.java @@ -0,0 +1,23 @@ +package org.bukkit.craftbukkit.entity; + +import org.bukkit.craftbukkit.CraftServer; +import org.bukkit.entity.Projectile; + +public abstract class AbstractProjectile extends CraftEntity implements Projectile { + + private boolean doesBounce; + + public AbstractProjectile(CraftServer server, net.minecraft.server.Entity entity) { + super(server, entity); + doesBounce = false; + } + + public boolean doesBounce() { + return doesBounce; + } + + public void setBounce(boolean doesBounce) { + this.doesBounce = doesBounce; + } + +} diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java index 84b820c55b..b23cdc4a49 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java @@ -7,7 +7,8 @@ import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Arrow; import org.bukkit.entity.LivingEntity; -public class CraftArrow extends CraftEntity implements Arrow { +public class CraftArrow extends AbstractProjectile implements Arrow { + public CraftArrow(CraftServer server, EntityArrow entity) { super(server, entity); } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEgg.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEgg.java index 66e1ad5743..215a8f2b75 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEgg.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEgg.java @@ -7,7 +7,8 @@ import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Egg; import org.bukkit.entity.LivingEntity; -public class CraftEgg extends CraftEntity implements Egg { +public class CraftEgg extends AbstractProjectile implements Egg { + public CraftEgg(CraftServer server, EntityEgg entity) { super(server, entity); } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java index 853ac1ab2e..cdc8b3969c 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java @@ -8,7 +8,7 @@ import org.bukkit.entity.Fireball; import org.bukkit.entity.LivingEntity; import org.bukkit.util.Vector; -public class CraftFireball extends CraftEntity implements Fireball { +public class CraftFireball extends AbstractProjectile implements Fireball { public CraftFireball(CraftServer server, EntityFireball entity) { super(server, entity); } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftFish.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftFish.java index 43ec479dcb..61ccd0de0b 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftFish.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftFish.java @@ -7,7 +7,7 @@ import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.Fish; import org.bukkit.entity.LivingEntity; -public class CraftFish extends CraftEntity implements Fish { +public class CraftFish extends AbstractProjectile implements Fish { public CraftFish(CraftServer server, EntityFish entity) { super(server, entity); } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowball.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowball.java index 488b78690f..4120ac400b 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowball.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftSnowball.java @@ -7,7 +7,7 @@ import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Snowball; -public class CraftSnowball extends CraftEntity implements Snowball { +public class CraftSnowball extends AbstractProjectile implements Snowball { public CraftSnowball(CraftServer server, EntitySnowball entity) { super(server, entity); }