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 net.minecraft.server.EntityLiving;
import net.minecraft.server.EntitySnowball;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Snowball;
/**
* A snowball.
*
* @author sk89q
*/
public class CraftSnowball extends CraftEntity implements Snowball {
public CraftSnowball(CraftServer server, EntitySnowball entity) {
@@ -18,4 +19,18 @@ public class CraftSnowball extends CraftEntity implements Snowball {
public String toString() {
return "CraftSnowball";
}
public LivingEntity getShooter() {
if (((EntitySnowball) getHandle()).shooter != null) {
return (LivingEntity) ((EntitySnowball) getHandle()).shooter.getBukkitEntity();
}
return null;
}
public void setShooter(LivingEntity shooter) {
if (shooter instanceof CraftLivingEntity) {
((EntitySnowball) getHandle()).shooter = (EntityLiving) ((CraftLivingEntity) shooter).entity;
}
}
}