
Also, standardise getHandle and clean up in general. getHandle is now using the 'entity' member variable instead of super.getHandle, as this reduces the number of chained calls needed.
64 lines
1.6 KiB
Java
64 lines
1.6 KiB
Java
package org.bukkit.craftbukkit.entity;
|
|
|
|
import net.minecraft.server.EntityFireball;
|
|
import net.minecraft.server.EntityLiving;
|
|
|
|
import org.bukkit.craftbukkit.CraftServer;
|
|
import org.bukkit.entity.Fireball;
|
|
import org.bukkit.entity.LivingEntity;
|
|
import org.bukkit.util.Vector;
|
|
|
|
public class CraftFireball extends AbstractProjectile implements Fireball {
|
|
public CraftFireball(CraftServer server, EntityFireball entity) {
|
|
super(server, entity);
|
|
}
|
|
|
|
public float getYield() {
|
|
return getHandle().yield;
|
|
}
|
|
|
|
public boolean isIncendiary() {
|
|
return getHandle().isIncendiary;
|
|
}
|
|
|
|
public void setIsIncendiary(boolean isIncendiary) {
|
|
getHandle().isIncendiary = isIncendiary;
|
|
}
|
|
|
|
public void setYield(float yield) {
|
|
getHandle().yield = yield;
|
|
}
|
|
|
|
public LivingEntity getShooter() {
|
|
if (getHandle().shooter != null) {
|
|
return (LivingEntity) getHandle().shooter.getBukkitEntity();
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
public void setShooter(LivingEntity shooter) {
|
|
if (shooter instanceof CraftLivingEntity) {
|
|
getHandle().shooter = (EntityLiving) ((CraftLivingEntity) shooter).entity;
|
|
}
|
|
}
|
|
|
|
public Vector getDirection() {
|
|
return new Vector(getHandle().dirX, getHandle().dirY, getHandle().dirZ);
|
|
}
|
|
|
|
public void setDirection(Vector direction) {
|
|
getHandle().setDirection(direction.getX(), direction.getY(), direction.getZ());
|
|
}
|
|
|
|
@Override
|
|
public EntityFireball getHandle() {
|
|
return (EntityFireball) entity;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return "CraftFireball";
|
|
}
|
|
}
|