blob: 7c79928b20e91bd094aae78e2cffbbccb4ca4bbf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
package org.bukkit.craftbukkit.entity;
import net.minecraft.server.EntityLiving;
import net.minecraft.server.EntityProjectile;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Projectile;
public abstract class CraftProjectile extends AbstractProjectile implements Projectile {
public CraftProjectile(CraftServer server, net.minecraft.server.Entity entity) {
super(server, entity);
}
public LivingEntity getShooter() {
if (getHandle().shooter instanceof EntityLiving) {
return (LivingEntity) getHandle().shooter.getBukkitEntity();
}
return null;
}
public void setShooter(LivingEntity shooter) {
if (shooter instanceof CraftLivingEntity) {
getHandle().shooter = (EntityLiving) ((CraftLivingEntity) shooter).entity;
}
}
@Override
public EntityProjectile getHandle() {
return (EntityProjectile) entity;
}
@Override
public String toString() {
return "CraftProjectile";
}
}
|