Implemented the concept of a projectile.

This commit is contained in:
sunkid
2011-06-18 08:10:31 -07:00
committed by EvilSeph
parent 546e1306d8
commit 155874eec9
12 changed files with 174 additions and 60 deletions

View File

@@ -1,13 +1,14 @@
package org.bukkit.craftbukkit.entity;
import org.bukkit.entity.Arrow;
import net.minecraft.server.EntityArrow;
import net.minecraft.server.EntityLiving;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.LivingEntity;
/**
* Represents an arrow.
*
* @author sk89q
*/
public class CraftArrow extends CraftEntity implements Arrow {
public CraftArrow(CraftServer server, EntityArrow entity) {
@@ -18,4 +19,19 @@ public class CraftArrow extends CraftEntity implements Arrow {
public String toString() {
return "CraftArrow";
}
public LivingEntity getShooter() {
if (((EntityArrow) getHandle()).shooter != null) {
return (LivingEntity) ((EntityArrow) getHandle()).shooter.getBukkitEntity();
}
return null;
}
public void setShooter(LivingEntity shooter) {
if (shooter instanceof CraftLivingEntity) {
((EntityArrow) getHandle()).shooter = (EntityLiving) ((CraftLivingEntity) shooter).entity;
}
}
}