From f332350969c89075de604e22f3b4c021694d8a67 Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 17 Mar 2016 14:42:58 -0400 Subject: [PATCH] Implement SpectralArrow entity --- .../craftbukkit/entity/CraftEntity.java | 1 + .../entity/CraftSpectralArrow.java | 28 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 src/main/java/org/bukkit/craftbukkit/entity/CraftSpectralArrow.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index 7f10a0f7c9..27c1851a38 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -142,6 +142,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity { if (((EntityTippedArrow) entity).isTipped()) { return new CraftTippedArrow(server, (EntityTippedArrow) entity); } else { return new CraftArrow(server, (EntityArrow) entity); } } + else if (entity instanceof EntitySpectralArrow) { return new CraftSpectralArrow(server, (EntitySpectralArrow) entity); } else if (entity instanceof EntityArrow) { return new CraftArrow(server, (EntityArrow) entity); } else if (entity instanceof EntityBoat) { return new CraftBoat(server, (EntityBoat) entity); } else if (entity instanceof EntityProjectile) { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSpectralArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSpectralArrow.java new file mode 100644 index 0000000000..c1cab93e03 --- /dev/null +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSpectralArrow.java @@ -0,0 +1,28 @@ +package org.bukkit.craftbukkit.entity; + +import net.minecraft.server.EntitySpectralArrow; +import org.bukkit.craftbukkit.CraftServer; +import org.bukkit.entity.EntityType; +import org.bukkit.entity.SpectralArrow; + +public class CraftSpectralArrow extends CraftArrow implements SpectralArrow { + + public CraftSpectralArrow(CraftServer server, EntitySpectralArrow entity) { + super(server, entity); + } + + @Override + public EntitySpectralArrow getHandle() { + return (EntitySpectralArrow) entity; + } + + @Override + public String toString() { + return "CraftSpectralArrow"; + } + + @Override + public EntityType getType() { + return EntityType.SPECTRAL_ARROW; + } +}