Fix Craft Entity constructors and toStrings.

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.
This commit is contained in:
Andrew Ardill 2011-11-29 21:22:35 +11:00
parent a51eb9c3ca
commit 2759809ecb
57 changed files with 588 additions and 305 deletions

View File

@ -12,6 +12,7 @@ import org.bukkit.event.vehicle.VehicleEnterEvent;
import org.bukkit.event.vehicle.VehicleEntityCollisionEvent; import org.bukkit.event.vehicle.VehicleEntityCollisionEvent;
import org.bukkit.event.vehicle.VehicleMoveEvent; import org.bukkit.event.vehicle.VehicleMoveEvent;
import org.bukkit.event.vehicle.VehicleUpdateEvent; import org.bukkit.event.vehicle.VehicleUpdateEvent;
import org.bukkit.util.Vector;
// CraftBukkit end // CraftBukkit end
public class EntityMinecart extends Entity implements IInventory { public class EntityMinecart extends Entity implements IInventory {
@ -32,12 +33,12 @@ public class EntityMinecart extends Entity implements IInventory {
// CraftBukkit start // CraftBukkit start
public boolean slowWhenEmpty = true; public boolean slowWhenEmpty = true;
public double derailedX = 0.5; private double derailedX = 0.5;
public double derailedY = 0.5; private double derailedY = 0.5;
public double derailedZ = 0.5; private double derailedZ = 0.5;
public double flyingX = 0.95; private double flyingX = 0.95;
public double flyingY = 0.95; private double flyingY = 0.95;
public double flyingZ = 0.95; private double flyingZ = 0.95;
public double maxSpeed = 0.4D; public double maxSpeed = 0.4D;
public ItemStack[] getContents() { public ItemStack[] getContents() {
@ -934,4 +935,26 @@ public class EntityMinecart extends Entity implements IInventory {
public int m() { public int m() {
return this.datawatcher.getInt(18); return this.datawatcher.getInt(18);
} }
// CraftBukkit start - methods for getting and setting flying and derailed velocity modifiers
public Vector getFlyingVelocityMod() {
return new Vector(flyingX, flyingY, flyingZ);
}
public void setFlyingVelocityMod(Vector flying) {
flyingX = flying.getX();
flyingY = flying.getY();
flyingZ = flying.getZ();
}
public Vector getDerailedVelocityMod() {
return new Vector(derailedX, derailedY, derailedZ);
}
public void setDerailedVelocityMod(Vector derailed) {
derailedX = derailed.getX();
derailedY = derailed.getY();
derailedZ = derailed.getZ();
}
// CraftBukkit end
} }

View File

@ -0,0 +1,87 @@
package net.minecraft.server;
import java.util.Iterator;
import java.util.List;
public class EntityPotion extends EntityProjectile {
private int d;
public EntityPotion(World world) {
super(world);
}
public EntityPotion(World world, EntityLiving entityliving, int i) {
super(world, entityliving);
this.d = i;
}
public EntityPotion(World world, double d0, double d1, double d2, int i) {
super(world, d0, d1, d2);
this.d = i;
}
protected float e() {
return 0.05F;
}
protected float c() {
return 0.5F;
}
protected float d() {
return -20.0F;
}
public int f() {
return this.d;
}
protected void a(MovingObjectPosition movingobjectposition) {
if (!this.world.isStatic) {
List list = Item.POTION.b(this.d);
if (list != null && !list.isEmpty()) {
AxisAlignedBB axisalignedbb = this.boundingBox.b(4.0D, 2.0D, 4.0D);
List list1 = this.world.a(EntityLiving.class, axisalignedbb);
if (list1 != null && !list1.isEmpty()) {
Iterator iterator = list1.iterator();
while (iterator.hasNext()) {
Entity entity = (Entity) iterator.next();
double d0 = this.i(entity);
if (d0 < 16.0D) {
double d1 = 1.0D - Math.sqrt(d0) / 4.0D;
if (entity == movingobjectposition.entity) {
d1 = 1.0D;
}
Iterator iterator1 = list.iterator();
while (iterator1.hasNext()) {
MobEffect mobeffect = (MobEffect) iterator1.next();
int i = mobeffect.getEffectId();
if (MobEffectList.byId[i].b()) {
MobEffectList.byId[i].a(this.shooter, (EntityLiving) entity, mobeffect.getAmplifier(), d1);
} else {
int j = (int) (d1 * (double) mobeffect.getDuration() + 0.5D);
if (j > 20) {
((EntityLiving) entity).addEffect(new MobEffect(i, j, mobeffect.getAmplifier()));
}
}
}
}
}
}
}
this.world.f(2002, (int) Math.round(this.locX), (int) Math.round(this.locY), (int) Math.round(this.locZ), this.d);
this.die();
}
}
}

View File

@ -10,16 +10,6 @@ public class CraftAnimals extends CraftCreature implements Animals {
super(server, entity); super(server, entity);
} }
@Override
public String toString() {
return "CraftAnimals";
}
@Override
public EntityAnimal getHandle() {
return (EntityAnimal) entity;
}
public int getAge() { public int getAge() {
return getHandle().getAge(); return getHandle().getAge();
} }
@ -27,4 +17,14 @@ public class CraftAnimals extends CraftCreature implements Animals {
public void setAge(int age) { public void setAge(int age) {
getHandle().setAge(age); getHandle().setAge(age);
} }
@Override
public EntityAnimal getHandle() {
return (EntityAnimal) entity;
}
@Override
public String toString() {
return "CraftAnimals";
}
} }

View File

@ -7,29 +7,35 @@ import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.Arrow; import org.bukkit.entity.Arrow;
import org.bukkit.entity.LivingEntity; import org.bukkit.entity.LivingEntity;
import javax.swing.text.html.parser.Entity;
public class CraftArrow extends AbstractProjectile implements Arrow { public class CraftArrow extends AbstractProjectile implements Arrow {
public CraftArrow(CraftServer server, EntityArrow entity) { public CraftArrow(CraftServer server, EntityArrow entity) {
super(server, entity); super(server, entity);
} }
@Override
public String toString() {
return "CraftArrow";
}
public LivingEntity getShooter() { public LivingEntity getShooter() {
if (((EntityArrow) getHandle()).shooter != null) { if (getHandle().shooter != null) {
return (LivingEntity) ((EntityArrow) getHandle()).shooter.getBukkitEntity(); return (LivingEntity) getHandle().shooter.getBukkitEntity();
} }
return null; return null;
} }
public void setShooter(LivingEntity shooter) { public void setShooter(LivingEntity shooter) {
if (shooter instanceof CraftLivingEntity) { if (shooter instanceof CraftLivingEntity) {
((EntityArrow) getHandle()).shooter = (EntityLiving) ((CraftLivingEntity) shooter).entity; getHandle().shooter = ((CraftLivingEntity) shooter).getHandle();
} }
} }
@Override
public EntityArrow getHandle(){
return (EntityArrow) entity;
}
@Override
public String toString() {
return "CraftArrow";
}
} }

View File

@ -1,11 +1,22 @@
package org.bukkit.craftbukkit.entity; package org.bukkit.craftbukkit.entity;
import net.minecraft.server.EntityBlaze;
import net.minecraft.server.EntityMonster; import net.minecraft.server.EntityMonster;
import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.Blaze; import org.bukkit.entity.Blaze;
public class CraftBlaze extends CraftMonster implements Blaze { public class CraftBlaze extends CraftMonster implements Blaze {
public CraftBlaze(CraftServer server, EntityMonster entity) { public CraftBlaze(CraftServer server, EntityBlaze entity) {
super(server, entity); super(server, entity);
} }
@Override
public EntityBlaze getHandle() {
return (EntityBlaze) entity;
}
@Override
public String toString() {
return "CraftBlaze";
}
} }

View File

@ -5,47 +5,50 @@ import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.Boat; import org.bukkit.entity.Boat;
public class CraftBoat extends CraftVehicle implements Boat { public class CraftBoat extends CraftVehicle implements Boat {
protected EntityBoat boat;
public CraftBoat(CraftServer server, EntityBoat entity) { public CraftBoat(CraftServer server, EntityBoat entity) {
super(server, entity); super(server, entity);
boat = entity;
} }
public double getMaxSpeed() { public double getMaxSpeed() {
return boat.maxSpeed; return getHandle().maxSpeed;
} }
public void setMaxSpeed(double speed) { public void setMaxSpeed(double speed) {
if (speed >= 0D) { if (speed >= 0D) {
boat.maxSpeed = speed; getHandle().maxSpeed = speed;
} }
} }
public double getOccupiedDeceleration() { public double getOccupiedDeceleration() {
return boat.occupiedDeceleration; return getHandle().occupiedDeceleration;
} }
public void setOccupiedDeceleration(double speed) { public void setOccupiedDeceleration(double speed) {
if (speed >= 0D) { if (speed >= 0D) {
boat.occupiedDeceleration = speed; getHandle().occupiedDeceleration = speed;
} }
} }
public double getUnoccupiedDeceleration() { public double getUnoccupiedDeceleration() {
return boat.unoccupiedDeceleration; return getHandle().unoccupiedDeceleration;
} }
public void setUnoccupiedDeceleration(double speed) { public void setUnoccupiedDeceleration(double speed) {
boat.unoccupiedDeceleration = speed; getHandle().unoccupiedDeceleration = speed;
} }
public boolean getWorkOnLand() { public boolean getWorkOnLand() {
return boat.landBoats; return getHandle().landBoats;
} }
public void setWorkOnLand(boolean workOnLand) { public void setWorkOnLand(boolean workOnLand) {
boat.landBoats = workOnLand; getHandle().landBoats = workOnLand;
}
@Override
public EntityBoat getHandle() {
return (EntityBoat) entity;
} }
@Override @Override

View File

@ -11,7 +11,7 @@ public class CraftCaveSpider extends CraftSpider implements CaveSpider {
@Override @Override
public EntityCaveSpider getHandle() { public EntityCaveSpider getHandle() {
return (EntityCaveSpider) super.getHandle(); return (EntityCaveSpider) entity;
} }
@Override @Override

View File

@ -10,6 +10,11 @@ public class CraftChicken extends CraftAnimals implements Chicken {
super(server, entity); super(server, entity);
} }
@Override
public EntityChicken getHandle() {
return (EntityChicken) entity;
}
@Override @Override
public String toString() { public String toString() {
return "CraftChicken"; return "CraftChicken";

View File

@ -6,12 +6,17 @@ import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.ComplexLivingEntity; import org.bukkit.entity.ComplexLivingEntity;
public abstract class CraftComplexLivingEntity extends CraftLivingEntity implements ComplexLivingEntity { public abstract class CraftComplexLivingEntity extends CraftLivingEntity implements ComplexLivingEntity {
public CraftComplexLivingEntity(CraftServer server, EntityLiving entity) { public CraftComplexLivingEntity(CraftServer server, EntityComplex entity) {
super(server, entity); super(server, entity);
} }
@Override @Override
public EntityComplex getHandle() { public EntityComplex getHandle() {
return (EntityComplex)super.getHandle(); return (EntityComplex) entity;
}
@Override
public String toString() {
return "CraftComplexLivingEntity";
} }
} }

View File

@ -7,7 +7,7 @@ import org.bukkit.entity.ComplexEntityPart;
import org.bukkit.entity.ComplexLivingEntity; import org.bukkit.entity.ComplexLivingEntity;
public class CraftComplexPart extends CraftEntity implements ComplexEntityPart { public class CraftComplexPart extends CraftEntity implements ComplexEntityPart {
public CraftComplexPart(CraftServer server, Entity entity) { public CraftComplexPart(CraftServer server, EntityComplexPart entity) {
super(server, entity); super(server, entity);
} }
@ -17,6 +17,11 @@ public class CraftComplexPart extends CraftEntity implements ComplexEntityPart {
@Override @Override
public EntityComplexPart getHandle() { public EntityComplexPart getHandle() {
return (EntityComplexPart)super.getHandle(); return (EntityComplexPart) entity;
}
@Override
public String toString() {
return "CraftComplexPart";
} }
} }

View File

@ -10,6 +10,11 @@ public class CraftCow extends CraftAnimals implements Cow {
super(server, entity); super(server, entity);
} }
@Override
public EntityCow getHandle() {
return (EntityCow) entity;
}
@Override @Override
public String toString() { public String toString() {
return "CraftCow"; return "CraftCow";

View File

@ -12,16 +12,6 @@ public class CraftCreeper extends CraftMonster implements Creeper {
super(server, entity); super(server, entity);
} }
@Override
public EntityCreeper getHandle() {
return (EntityCreeper) super.getHandle();
}
@Override
public String toString() {
return "CraftCreeper";
}
public boolean isPowered() { public boolean isPowered() {
return getHandle().isPowered(); return getHandle().isPowered();
} }
@ -51,4 +41,13 @@ public class CraftCreeper extends CraftMonster implements Creeper {
} }
@Override
public EntityCreeper getHandle() {
return (EntityCreeper) entity;
}
@Override
public String toString() {
return "CraftCreeper";
}
} }

View File

@ -9,6 +9,11 @@ public class CraftEgg extends CraftProjectile implements Egg {
super(server, entity); super(server, entity);
} }
@Override
public EntityEgg getHandle() {
return (EntityEgg) entity;
}
@Override @Override
public String toString() { public String toString() {
return "CraftEgg"; return "CraftEgg";

View File

@ -1,16 +1,21 @@
package org.bukkit.craftbukkit.entity; package org.bukkit.craftbukkit.entity;
import net.minecraft.server.Entity; import net.minecraft.server.EntityEnderCrystal;
import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.EnderSignal; import org.bukkit.entity.EnderSignal;
public class CraftEnderCrystal extends CraftEntity implements EnderSignal { public class CraftEnderCrystal extends CraftEntity implements EnderSignal {
public CraftEnderCrystal(CraftServer server, Entity entity) { public CraftEnderCrystal(CraftServer server, EntityEnderCrystal entity) {
super(server, entity); super(server, entity);
} }
@Override
public EntityEnderCrystal getHandle() {
return (EntityEnderCrystal) entity;
}
@Override @Override
public String toString() { public String toString() {
return "CraftEnderSignal"; return "CraftEnderCrystal";
} }
} }

View File

@ -11,7 +11,7 @@ import org.bukkit.entity.ComplexEntityPart;
import org.bukkit.entity.EnderDragon; import org.bukkit.entity.EnderDragon;
public class CraftEnderDragon extends CraftComplexLivingEntity implements EnderDragon { public class CraftEnderDragon extends CraftComplexLivingEntity implements EnderDragon {
public CraftEnderDragon(CraftServer server, EntityLiving entity) { public CraftEnderDragon(CraftServer server, EntityEnderDragon entity) {
super(server, entity); super(server, entity);
} }
@ -27,6 +27,11 @@ public class CraftEnderDragon extends CraftComplexLivingEntity implements EnderD
@Override @Override
public EntityEnderDragon getHandle() { public EntityEnderDragon getHandle() {
return (EntityEnderDragon)super.getHandle(); return (EntityEnderDragon) entity;
}
@Override
public String toString() {
return "CraftEnderDragon";
} }
} }

View File

@ -1,12 +1,12 @@
package org.bukkit.craftbukkit.entity; package org.bukkit.craftbukkit.entity;
import net.minecraft.server.Entity; import net.minecraft.server.EntityComplexPart;
import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.EnderDragon; import org.bukkit.entity.EnderDragon;
import org.bukkit.entity.EnderDragonPart; import org.bukkit.entity.EnderDragonPart;
public class CraftEnderDragonPart extends CraftComplexPart implements EnderDragonPart { public class CraftEnderDragonPart extends CraftComplexPart implements EnderDragonPart {
public CraftEnderDragonPart(CraftServer server, Entity entity) { public CraftEnderDragonPart(CraftServer server, EntityComplexPart entity) {
super(server, entity); super(server, entity);
} }
@ -14,4 +14,14 @@ public class CraftEnderDragonPart extends CraftComplexPart implements EnderDrago
public EnderDragon getParent() { public EnderDragon getParent() {
return (EnderDragon) super.getParent(); return (EnderDragon) super.getParent();
} }
@Override
public EntityComplexPart getHandle() {
return (EntityComplexPart) entity;
}
@Override
public String toString() {
return "CraftEnderDragonPart";
}
} }

View File

@ -1,14 +1,19 @@
package org.bukkit.craftbukkit.entity; package org.bukkit.craftbukkit.entity;
import net.minecraft.server.Entity; import net.minecraft.server.EntityEnderPearl;
import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.EnderPearl; import org.bukkit.entity.EnderPearl;
public class CraftEnderPearl extends CraftProjectile implements EnderPearl { public class CraftEnderPearl extends CraftProjectile implements EnderPearl {
public CraftEnderPearl(CraftServer server, Entity entity) { public CraftEnderPearl(CraftServer server, EntityEnderPearl entity) {
super(server, entity); super(server, entity);
} }
@Override
public EntityEnderPearl getHandle() {
return (EntityEnderPearl) entity;
}
@Override @Override
public String toString() { public String toString() {
return "CraftEnderPearl"; return "CraftEnderPearl";

View File

@ -1,14 +1,19 @@
package org.bukkit.craftbukkit.entity; package org.bukkit.craftbukkit.entity;
import net.minecraft.server.Entity; import net.minecraft.server.EntityEnderSignal;
import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.EnderSignal; import org.bukkit.entity.EnderSignal;
public class CraftEnderSignal extends CraftEntity implements EnderSignal { public class CraftEnderSignal extends CraftEntity implements EnderSignal {
public CraftEnderSignal(CraftServer server, Entity entity) { public CraftEnderSignal(CraftServer server, EntityEnderSignal entity) {
super(server, entity); super(server, entity);
} }
@Override
public EntityEnderSignal getHandle() {
return (EntityEnderSignal) entity;
}
@Override @Override
public String toString() { public String toString() {
return "CraftEnderSignal"; return "CraftEnderSignal";

View File

@ -12,16 +12,6 @@ public class CraftEnderman extends CraftMonster implements Enderman {
super(server, entity); super(server, entity);
} }
@Override
public EntityEnderman getHandle() {
return (EntityEnderman) super.getHandle();
}
@Override
public String toString() {
return "CraftEnderman";
}
public MaterialData getCarriedMaterial() { public MaterialData getCarriedMaterial() {
return Material.getMaterial(getHandle().getCarriedId()).getNewData((byte) getHandle().getCarriedData()); return Material.getMaterial(getHandle().getCarriedId()).getNewData((byte) getHandle().getCarriedData());
} }
@ -30,4 +20,14 @@ public class CraftEnderman extends CraftMonster implements Enderman {
getHandle().setCarriedId(data.getItemTypeId()); getHandle().setCarriedId(data.getItemTypeId());
getHandle().setCarriedData(data.getData()); getHandle().setCarriedData(data.getData());
} }
@Override
public EntityEnderman getHandle() {
return (EntityEnderman) entity;
}
@Override
public String toString() {
return "CraftEnderman";
}
} }

View File

@ -75,7 +75,7 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
if (entity instanceof EntitySquid) { return new CraftSquid(server, (EntitySquid) entity); } if (entity instanceof EntitySquid) { return new CraftSquid(server, (EntitySquid) entity); }
else { return new CraftWaterMob(server, (EntityWaterAnimal) entity); } else { return new CraftWaterMob(server, (EntityWaterAnimal) entity); }
} }
else if (entity instanceof EntitySnowman) { return new CraftSnowman(server, (EntityCreature) entity); } else if (entity instanceof EntitySnowman) { return new CraftSnowman(server, (EntitySnowman) entity); }
else if (entity instanceof EntityVillager) { return new CraftVillager(server, (EntityVillager) entity); } else if (entity instanceof EntityVillager) { return new CraftVillager(server, (EntityVillager) entity); }
else { return new CraftCreature(server, (EntityCreature) entity); } else { return new CraftCreature(server, (EntityCreature) entity); }
} }
@ -118,21 +118,14 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
else if (entity instanceof EntityFishingHook) { return new CraftFish(server, (EntityFishingHook) entity); } else if (entity instanceof EntityFishingHook) { return new CraftFish(server, (EntityFishingHook) entity); }
else if (entity instanceof EntityItem) { return new CraftItem(server, (EntityItem) entity); } else if (entity instanceof EntityItem) { return new CraftItem(server, (EntityItem) entity); }
else if (entity instanceof EntityWeather) { else if (entity instanceof EntityWeather) {
if (entity instanceof EntityWeatherStorm) { if (entity instanceof EntityWeatherStorm) { return new CraftLightningStrike(server, (EntityWeatherStorm) entity); }
return new CraftLightningStrike(server, (EntityWeatherStorm)entity); else { return new CraftWeather(server, (EntityWeather) entity); }
} else {
return new CraftWeather(server, (EntityWeather)entity);
}
} }
else if (entity instanceof EntityMinecart) { else if (entity instanceof EntityMinecart) {
EntityMinecart mc = (EntityMinecart) entity; EntityMinecart mc = (EntityMinecart) entity;
if (mc.type == CraftMinecart.Type.StorageMinecart.getId()) { if (mc.type == CraftMinecart.Type.StorageMinecart.getId()) { return new CraftStorageMinecart(server, mc); }
return new CraftStorageMinecart(server, mc); else if (mc.type == CraftMinecart.Type.PoweredMinecart.getId()) { return new CraftPoweredMinecart(server, mc); }
} else if (mc.type == CraftMinecart.Type.PoweredMinecart.getId()) { else { return new CraftMinecart(server, mc); }
return new CraftPoweredMinecart(server, mc);
} else {
return new CraftMinecart(server, mc);
}
} }
else if (entity instanceof EntityPainting) { return new CraftPainting(server, (EntityPainting) entity); } else if (entity instanceof EntityPainting) { return new CraftPainting(server, (EntityPainting) entity); }
else if (entity instanceof EntityTNTPrimed) { return new CraftTNTPrimed(server, (EntityTNTPrimed) entity); } else if (entity instanceof EntityTNTPrimed) { return new CraftTNTPrimed(server, (EntityTNTPrimed) entity); }
@ -205,14 +198,6 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
return !entity.aj(); return !entity.aj();
} }
public Entity getHandle() {
return entity;
}
public void setHandle(final Entity entity) {
this.entity = entity;
}
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (obj == null) { if (obj == null) {
@ -231,19 +216,6 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
return true; return true;
} }
@Override
public int hashCode() {
int hash = 7;
hash = 89 * hash + (this.server != null ? this.server.hashCode() : 0);
hash = 89 * hash + (this.entity != null ? this.entity.hashCode() : 0);
return hash;
}
@Override
public String toString() {
return "CraftEntity{" + "id=" + getEntityId() + '}';
}
public Server getServer() { public Server getServer() {
return server; return server;
} }
@ -325,4 +297,25 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
} }
getHandle().ticksLived = value; getHandle().ticksLived = value;
} }
public Entity getHandle() {
return entity;
}
public void setHandle(final Entity entity) {
this.entity = entity;
}
@Override
public String toString() {
return "CraftEntity{" + "id=" + getEntityId() + '}';
}
@Override
public int hashCode() {
int hash = 7;
hash = 89 * hash + (this.server != null ? this.server.hashCode() : 0);
hash = 89 * hash + (this.entity != null ? this.entity.hashCode() : 0);
return hash;
}
} }

View File

@ -10,11 +10,6 @@ public class CraftExperienceOrb extends CraftEntity implements ExperienceOrb {
super(server, entity); super(server, entity);
} }
@Override
public EntityExperienceOrb getHandle() {
return (EntityExperienceOrb) super.getHandle();
}
public int getExperience() { public int getExperience() {
return getHandle().value; return getHandle().value;
} }
@ -22,4 +17,14 @@ public class CraftExperienceOrb extends CraftEntity implements ExperienceOrb {
public void setExperience(int value) { public void setExperience(int value) {
getHandle().value = value; getHandle().value = value;
} }
@Override
public EntityExperienceOrb getHandle() {
return (EntityExperienceOrb) entity;
}
@Override
public String toString() {
return "CraftExperienceOrb";
}
} }

View File

@ -12,6 +12,11 @@ public class CraftFallingSand extends CraftEntity implements FallingSand {
super(server, entity); super(server, entity);
} }
@Override
public EntityFallingSand getHandle() {
return (EntityFallingSand) entity;
}
@Override @Override
public String toString() { public String toString() {
return "CraftFallingSand"; return "CraftFallingSand";

View File

@ -13,47 +13,51 @@ public class CraftFireball extends AbstractProjectile implements Fireball {
super(server, entity); super(server, entity);
} }
@Override
public String toString() {
return "CraftFireball";
}
public float getYield() { public float getYield() {
return ((EntityFireball) getHandle()).yield; return getHandle().yield;
} }
public boolean isIncendiary() { public boolean isIncendiary() {
return ((EntityFireball) getHandle()).isIncendiary; return getHandle().isIncendiary;
} }
public void setIsIncendiary(boolean isIncendiary) { public void setIsIncendiary(boolean isIncendiary) {
((EntityFireball) getHandle()).isIncendiary = isIncendiary; getHandle().isIncendiary = isIncendiary;
} }
public void setYield(float yield) { public void setYield(float yield) {
((EntityFireball) getHandle()).yield = yield; getHandle().yield = yield;
} }
public LivingEntity getShooter() { public LivingEntity getShooter() {
if (((EntityFireball) getHandle()).shooter != null) { if (getHandle().shooter != null) {
return (LivingEntity) ((EntityFireball) getHandle()).shooter.getBukkitEntity(); return (LivingEntity) getHandle().shooter.getBukkitEntity();
} }
return null; return null;
} }
public void setShooter(LivingEntity shooter) { public void setShooter(LivingEntity shooter) {
if (shooter instanceof CraftLivingEntity) { if (shooter instanceof CraftLivingEntity) {
((EntityFireball) getHandle()).shooter = (EntityLiving) ((CraftLivingEntity) shooter).entity; getHandle().shooter = (EntityLiving) ((CraftLivingEntity) shooter).entity;
} }
} }
public Vector getDirection() { public Vector getDirection() {
return new Vector(((EntityFireball) getHandle()).dirX, ((EntityFireball) getHandle()).dirY, ((EntityFireball) getHandle()).dirZ); return new Vector(getHandle().dirX, getHandle().dirY, getHandle().dirZ);
} }
public void setDirection(Vector direction) { public void setDirection(Vector direction) {
((EntityFireball) getHandle()).setDirection(direction.getX(), direction.getY(), direction.getZ()); getHandle().setDirection(direction.getX(), direction.getY(), direction.getZ());
}
@Override
public EntityFireball getHandle() {
return (EntityFireball) entity;
}
@Override
public String toString() {
return "CraftFireball";
} }
} }

View File

@ -12,24 +12,27 @@ public class CraftFish extends AbstractProjectile implements Fish {
super(server, entity); super(server, entity);
} }
@Override
public String toString() {
return "CraftFish";
}
public LivingEntity getShooter() { public LivingEntity getShooter() {
if (((EntityFishingHook) getHandle()).owner != null) { if (getHandle().owner != null) {
return (LivingEntity) ((EntityFishingHook) getHandle()).owner.getBukkitEntity(); return (LivingEntity) getHandle().owner.getBukkitEntity();
} }
return null; return null;
} }
public void setShooter(LivingEntity shooter) { public void setShooter(LivingEntity shooter) {
if (shooter instanceof CraftHumanEntity) { if (shooter instanceof CraftHumanEntity) {
((EntityFishingHook) getHandle()).owner = (EntityHuman) ((CraftHumanEntity) shooter).entity; getHandle().owner = (EntityHuman) ((CraftHumanEntity) shooter).entity;
} }
} }
@Override
public EntityFishingHook getHandle() {
return (EntityFishingHook) entity;
}
@Override
public String toString() {
return "CraftFish";
}
} }

View File

@ -10,9 +10,13 @@ public class CraftFlying extends CraftLivingEntity implements Flying {
super(server, entity); super(server, entity);
} }
@Override
public EntityFlying getHandle() {
return (EntityFlying) entity;
}
@Override @Override
public String toString() { public String toString() {
return "CraftFlying"; return "CraftFlying";
} }
} }

View File

@ -10,9 +10,13 @@ public class CraftGhast extends CraftFlying implements Ghast {
super(server, entity); super(server, entity);
} }
@Override
public EntityGhast getHandle() {
return (EntityGhast) entity;
}
@Override @Override
public String toString() { public String toString() {
return "CraftGhast"; return "CraftGhast";
} }
} }

View File

@ -11,9 +11,13 @@ public class CraftGiant extends CraftMonster implements Giant {
super(server, entity); super(server, entity);
} }
@Override
public EntityGiantZombie getHandle() {
return (EntityGiantZombie) entity;
}
@Override @Override
public String toString() { public String toString() {
return "CraftGiant"; return "CraftGiant";
} }
} }

View File

@ -31,17 +31,6 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
return getHandle().name; return getHandle().name;
} }
@Override
public EntityHuman getHandle() {
return (EntityHuman) entity;
}
public void setHandle(final EntityHuman entity) {
super.setHandle((EntityHuman) entity);
this.entity = entity;
this.inventory = new CraftInventoryPlayer(entity.inventory);
}
public PlayerInventory getInventory() { public PlayerInventory getInventory() {
return inventory; return inventory;
} }
@ -54,11 +43,6 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
getInventory().setItemInHand(item); getInventory().setItemInHand(item);
} }
@Override
public String toString() {
return "CraftHumanEntity{" + "id=" + getEntityId() + "name=" + getName() + '}';
}
public boolean isSleeping() { public boolean isSleeping() {
return getHandle().sleeping; return getHandle().sleeping;
} }
@ -131,4 +115,19 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity {
this.mode = mode; this.mode = mode;
} }
@Override
public EntityHuman getHandle() {
return (EntityHuman) entity;
}
public void setHandle(final EntityHuman entity) {
super.setHandle(entity);
this.inventory = new CraftInventoryPlayer(entity.inventory);
}
@Override
public String toString() {
return "CraftHumanEntity{" + "id=" + getEntityId() + "name=" + getName() + '}';
}
} }

View File

@ -30,6 +30,11 @@ public class CraftItem extends CraftEntity implements Item {
item.pickupDelay = delay; item.pickupDelay = delay;
} }
@Override
public EntityItem getHandle() {
return (EntityItem) entity;
}
@Override @Override
public String toString() { public String toString() {
return "CraftItem"; return "CraftItem";

View File

@ -9,12 +9,17 @@ public class CraftLightningStrike extends CraftEntity implements LightningStrike
super(server, entity); super(server, entity);
} }
@Override
public EntityWeatherStorm getHandle() {
return (EntityWeatherStorm) super.getHandle();
}
public boolean isEffect() { public boolean isEffect() {
return ((EntityWeatherStorm) super.getHandle()).isEffect; return ((EntityWeatherStorm) super.getHandle()).isEffect;
} }
@Override
public EntityWeatherStorm getHandle() {
return (EntityWeatherStorm) entity;
}
@Override
public String toString() {
return "CraftLightningStrik";
}
} }

View File

@ -51,21 +51,6 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
return getHandle().getMaxHealth(); return getHandle().getMaxHealth();
} }
@Override
public EntityLiving getHandle() {
return (EntityLiving) entity;
}
public void setHandle(final EntityLiving entity) {
super.setHandle((Entity) entity);
this.entity = entity;
}
@Override
public String toString() {
return "CraftLivingEntity{" + "id=" + getEntityId() + '}';
}
public Egg throwEgg() { public Egg throwEgg() {
net.minecraft.server.World world = ((CraftWorld) getWorld()).getHandle(); net.minecraft.server.World world = ((CraftWorld) getWorld()).getHandle();
EntityEgg egg = new EntityEgg(world, getHandle()); EntityEgg egg = new EntityEgg(world, getHandle());
@ -224,4 +209,18 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
public void setNoDamageTicks(int ticks) { public void setNoDamageTicks(int ticks) {
getHandle().noDamageTicks = ticks; getHandle().noDamageTicks = ticks;
} }
@Override
public EntityLiving getHandle() {
return (EntityLiving) entity;
}
public void setHandle(final EntityLiving entity) {
super.setHandle(entity);
}
@Override
public String toString() {
return "CraftLivingEntity{" + "id=" + getEntityId() + '}';
}
} }

View File

@ -11,12 +11,12 @@ public class CraftMagmaCube extends CraftSlime implements MagmaCube {
super(server, entity); super(server, entity);
} }
public EntityLavaSlime getHandle() {
return (EntityLavaSlime) entity;
}
@Override @Override
public String toString() { public String toString() {
return "CraftMagmaCube"; return "CraftMagmaCube";
} }
public EntityLavaSlime getHandle() {
return (EntityLavaSlime) super.getHandle();
}
} }

View File

@ -26,62 +26,59 @@ public class CraftMinecart extends CraftVehicle implements Minecart {
} }
} }
protected EntityMinecart minecart;
public CraftMinecart(CraftServer server, EntityMinecart entity) { public CraftMinecart(CraftServer server, EntityMinecart entity) {
super(server, entity); super(server, entity);
minecart = entity;
} }
public void setDamage(int damage) { public void setDamage(int damage) {
minecart.setDamage(damage); getHandle().setDamage(damage);
} }
public int getDamage() { public int getDamage() {
return minecart.getDamage(); return getHandle().getDamage();
} }
public double getMaxSpeed() { public double getMaxSpeed() {
return minecart.maxSpeed; return getHandle().maxSpeed;
} }
public void setMaxSpeed(double speed) { public void setMaxSpeed(double speed) {
if (speed >= 0D) { if (speed >= 0D) {
minecart.maxSpeed = speed; getHandle().maxSpeed = speed;
} }
} }
public boolean isSlowWhenEmpty() { public boolean isSlowWhenEmpty() {
return minecart.slowWhenEmpty; return getHandle().slowWhenEmpty;
} }
public void setSlowWhenEmpty(boolean slow) { public void setSlowWhenEmpty(boolean slow) {
minecart.slowWhenEmpty = slow; getHandle().slowWhenEmpty = slow;
} }
public Vector getFlyingVelocityMod() { public Vector getFlyingVelocityMod() {
return new Vector(minecart.flyingX, minecart.flyingY, minecart.flyingZ); return getHandle().getFlyingVelocityMod();
} }
public void setFlyingVelocityMod(Vector flying) { public void setFlyingVelocityMod(Vector flying) {
minecart.flyingX = flying.getX(); getHandle().setFlyingVelocityMod(flying);
minecart.flyingY = flying.getY();
minecart.flyingZ = flying.getZ();
} }
public Vector getDerailedVelocityMod() { public Vector getDerailedVelocityMod() {
return new Vector(minecart.derailedX, minecart.derailedY, minecart.derailedZ); return getHandle().getDerailedVelocityMod();
} }
public void setDerailedVelocityMod(Vector derailed) { public void setDerailedVelocityMod(Vector derailed) {
minecart.derailedX = derailed.getX(); getHandle().setDerailedVelocityMod(derailed);
minecart.derailedY = derailed.getY(); }
minecart.derailedZ = derailed.getZ();
@Override
public EntityMinecart getHandle() {
return (EntityMinecart) entity;
} }
@Override @Override
public String toString() { public String toString() {
return "CraftMinecart"; return "CraftMinecart";
} }
} }

View File

@ -11,13 +11,13 @@ public class CraftMonster extends CraftCreature implements Monster {
super(server, entity); super(server, entity);
} }
@Override
public String toString() {
return "CraftMonster";
}
@Override @Override
public EntityMonster getHandle() { public EntityMonster getHandle() {
return (EntityMonster) entity; return (EntityMonster) entity;
} }
@Override
public String toString() {
return "CraftMonster";
}
} }

View File

@ -1,11 +1,21 @@
package org.bukkit.craftbukkit.entity; package org.bukkit.craftbukkit.entity;
import net.minecraft.server.EntityCow; import net.minecraft.server.EntityMushroomCow;
import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.MushroomCow; import org.bukkit.entity.MushroomCow;
public class CraftMushroomCow extends CraftCow implements MushroomCow { public class CraftMushroomCow extends CraftCow implements MushroomCow {
public CraftMushroomCow(CraftServer server, EntityCow entity) { public CraftMushroomCow(CraftServer server, EntityMushroomCow entity) {
super(server, entity); super(server, entity);
} }
@Override
public EntityMushroomCow getHandle() {
return (EntityMushroomCow) entity;
}
@Override
public String toString() {
return "CraftMushroomCow";
}
} }

View File

@ -20,16 +20,6 @@ public class CraftPainting extends CraftEntity implements Painting {
super(server, entity); super(server, entity);
} }
@Override
public EntityPainting getHandle() {
return (EntityPainting) super.getHandle();
}
@Override
public String toString() {
return "CraftPainting[art=" + getArt() + "]";
}
public Art getArt() { public Art getArt() {
EnumArt art = getHandle().e; EnumArt art = getHandle().e;
return CraftArt.NotchToBukkit(art); return CraftArt.NotchToBukkit(art);
@ -124,4 +114,14 @@ public class CraftPainting extends CraftEntity implements Painting {
world.addEntity(painting); world.addEntity(painting);
this.entity = painting; this.entity = painting;
} }
@Override
public EntityPainting getHandle() {
return (EntityPainting) entity;
}
@Override
public String toString() {
return "CraftPainting{art=" + getArt() + "}";
}
} }

View File

@ -18,7 +18,7 @@ public class CraftPig extends CraftAnimals implements Pig {
} }
public EntityPig getHandle() { public EntityPig getHandle() {
return (EntityPig) super.getHandle(); return (EntityPig) entity;
} }
@Override @Override

View File

@ -11,16 +11,6 @@ public class CraftPigZombie extends CraftZombie implements PigZombie {
super(server, entity); super(server, entity);
} }
@Override
public EntityPigZombie getHandle() {
return (EntityPigZombie) super.getHandle();
}
@Override
public String toString() {
return "CraftPigZombie";
}
public int getAnger() { public int getAnger() {
return getHandle().angerLevel; return getHandle().angerLevel;
} }
@ -37,4 +27,13 @@ public class CraftPigZombie extends CraftZombie implements PigZombie {
return getAnger() > 0; return getAnger() > 0;
} }
@Override
public EntityPigZombie getHandle() {
return (EntityPigZombie) entity;
}
@Override
public String toString() {
return "CraftPigZombie";
}
} }

View File

@ -86,11 +86,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
} }
@Override
public EntityPlayer getHandle() {
return (EntityPlayer) entity;
}
public double getEyeHeight() { public double getEyeHeight() {
return getEyeHeight(false); return getEyeHeight(false);
} }
@ -107,11 +102,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
} }
} }
public void setHandle(final EntityPlayer entity) {
super.setHandle((EntityHuman) entity);
this.entity = entity;
}
public void sendRawMessage(String message) { public void sendRawMessage(String message) {
if (getHandle().netServerHandler == null) return; if (getHandle().netServerHandler == null) return;
@ -163,11 +153,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
server.getHandle().sendAll(new Packet201PlayerInfo(name, true, getHandle().i)); server.getHandle().sendAll(new Packet201PlayerInfo(name, true, getHandle().i));
} }
@Override
public String toString() {
return "CraftPlayer{" + "name=" + getName() + '}';
}
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
if (obj == null) { if (obj == null) {
@ -183,13 +168,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
return true; return true;
} }
@Override
public int hashCode() {
int hash = 5;
hash = 97 * hash + (this.getName() != null ? this.getName().hashCode() : 0);
return hash;
}
public void kickPlayer(String message) { public void kickPlayer(String message) {
if (getHandle().netServerHandler == null) return; if (getHandle().netServerHandler == null) return;
@ -552,4 +530,25 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public Player getPlayer() { public Player getPlayer() {
return this; return this;
} }
@Override
public EntityPlayer getHandle() {
return (EntityPlayer) entity;
}
public void setHandle(final EntityPlayer entity) {
super.setHandle(entity);
}
@Override
public String toString() {
return "CraftPlayer{" + "name=" + getName() + '}';
}
@Override
public int hashCode() {
int hash = 5;
hash = 97 * hash + (this.getName() != null ? this.getName().hashCode() : 0);
return hash;
}
} }

View File

@ -14,5 +14,4 @@ public class CraftPoweredMinecart extends CraftMinecart implements PoweredMineca
public String toString() { public String toString() {
return "CraftPoweredMinecart"; return "CraftPoweredMinecart";
} }
} }

View File

@ -29,4 +29,9 @@ public abstract class CraftProjectile extends AbstractProjectile implements Proj
public EntityProjectile getHandle() { public EntityProjectile getHandle() {
return (EntityProjectile) entity; return (EntityProjectile) entity;
} }
@Override
public String toString() {
return "CraftProjectile";
}
} }

View File

@ -11,16 +11,6 @@ public class CraftSheep extends CraftAnimals implements Sheep {
super(server, entity); super(server, entity);
} }
@Override
public EntitySheep getHandle() {
return (EntitySheep) entity;
}
@Override
public String toString() {
return "CraftSheep";
}
public DyeColor getColor() { public DyeColor getColor() {
return DyeColor.getByData((byte) getHandle().getColor()); return DyeColor.getByData((byte) getHandle().getColor());
} }
@ -37,4 +27,14 @@ public class CraftSheep extends CraftAnimals implements Sheep {
getHandle().setSheared(flag); getHandle().setSheared(flag);
} }
@Override
public EntitySheep getHandle() {
return (EntitySheep) entity;
}
@Override
public String toString() {
return "CraftSheep";
}
} }

View File

@ -11,7 +11,7 @@ public class CraftSilverfish extends CraftMonster implements Silverfish {
@Override @Override
public EntitySilverfish getHandle() { public EntitySilverfish getHandle() {
return (EntitySilverfish) super.getHandle(); return (EntitySilverfish) entity;
} }
@Override @Override

View File

@ -11,9 +11,13 @@ public class CraftSkeleton extends CraftMonster implements Skeleton {
super(server, entity); super(server, entity);
} }
@Override
public EntitySkeleton getHandle() {
return (EntitySkeleton) entity;
}
@Override @Override
public String toString() { public String toString() {
return "CraftSkeleton"; return "CraftSkeleton";
} }
} }

View File

@ -11,15 +11,6 @@ public class CraftSlime extends CraftLivingEntity implements Slime {
super(server, entity); super(server, entity);
} }
@Override
public String toString() {
return "CraftSlime";
}
public EntitySlime getHandle() {
return (EntitySlime) super.getHandle();
}
public int getSize() { public int getSize() {
return getHandle().getSize(); return getHandle().getSize();
} }
@ -27,4 +18,14 @@ public class CraftSlime extends CraftLivingEntity implements Slime {
public void setSize(int size) { public void setSize(int size) {
getHandle().setSize(size); getHandle().setSize(size);
} }
@Override
public EntitySlime getHandle() {
return (EntitySlime) entity;
}
@Override
public String toString() {
return "CraftSlime";
}
} }

View File

@ -1,12 +1,21 @@
package org.bukkit.craftbukkit.entity; package org.bukkit.craftbukkit.entity;
import net.minecraft.server.EntityFireball; import net.minecraft.server.EntitySmallFireball;
import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.SmallFireball; import org.bukkit.entity.SmallFireball;
public class CraftSmallFireball extends CraftFireball implements SmallFireball { public class CraftSmallFireball extends CraftFireball implements SmallFireball {
public CraftSmallFireball(CraftServer server, EntityFireball entity) { public CraftSmallFireball(CraftServer server, EntitySmallFireball entity) {
super(server, entity); super(server, entity);
} }
@Override
public EntitySmallFireball getHandle() {
return (EntitySmallFireball) entity;
}
@Override
public String toString() {
return "CraftSmallFireball";
}
} }

View File

@ -9,6 +9,11 @@ public class CraftSnowball extends CraftProjectile implements Snowball {
super(server, entity); super(server, entity);
} }
@Override
public EntitySnowball getHandle() {
return (EntitySnowball) entity;
}
@Override @Override
public String toString() { public String toString() {
return "CraftSnowball"; return "CraftSnowball";

View File

@ -1,11 +1,21 @@
package org.bukkit.craftbukkit.entity; package org.bukkit.craftbukkit.entity;
import net.minecraft.server.EntityCreature; import net.minecraft.server.EntitySnowman;
import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.Snowman; import org.bukkit.entity.Snowman;
public class CraftSnowman extends CraftCreature implements Snowman { public class CraftSnowman extends CraftCreature implements Snowman {
public CraftSnowman(CraftServer server, EntityCreature entity) { public CraftSnowman(CraftServer server, EntitySnowman entity) {
super(server, entity); super(server, entity);
} }
@Override
public EntitySnowman getHandle() {
return (EntitySnowman) entity;
}
@Override
public String toString() {
return "CraftSnowman";
}
} }

View File

@ -11,9 +11,13 @@ public class CraftSpider extends CraftMonster implements Spider {
super(server, entity); super(server, entity);
} }
@Override
public EntitySpider getHandle() {
return (EntitySpider) entity;
}
@Override @Override
public String toString() { public String toString() {
return "CraftSpider"; return "CraftSpider";
} }
} }

View File

@ -11,9 +11,13 @@ public class CraftSquid extends CraftWaterMob implements Squid {
super(server, entity); super(server, entity);
} }
@Override
public EntitySquid getHandle() {
return (EntitySquid) entity;
}
@Override @Override
public String toString() { public String toString() {
return "CraftSquid"; return "CraftSquid";
} }
} }

View File

@ -11,16 +11,6 @@ public class CraftTNTPrimed extends CraftEntity implements TNTPrimed {
super(server, entity); super(server, entity);
} }
@Override
public String toString() {
return "CraftTNTPrimed";
}
@Override
public EntityTNTPrimed getHandle() {
return (EntityTNTPrimed) super.getHandle();
}
public float getYield() { public float getYield() {
return getHandle().yield; return getHandle().yield;
} }
@ -45,4 +35,14 @@ public class CraftTNTPrimed extends CraftEntity implements TNTPrimed {
getHandle().fuseTicks = fuseTicks; getHandle().fuseTicks = fuseTicks;
} }
@Override
public EntityTNTPrimed getHandle() {
return (EntityTNTPrimed) entity;
}
@Override
public String toString() {
return "CraftTNTPrimed";
}
} }

View File

@ -1,14 +1,19 @@
package org.bukkit.craftbukkit.entity; package org.bukkit.craftbukkit.entity;
import net.minecraft.server.Entity; import net.minecraft.server.EntityPotion;
import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.ThrownPotion; import org.bukkit.entity.ThrownPotion;
public class CraftThrownPotion extends CraftProjectile implements ThrownPotion { public class CraftThrownPotion extends CraftProjectile implements ThrownPotion {
public CraftThrownPotion(CraftServer server, Entity entity) { public CraftThrownPotion(CraftServer server, EntityPotion entity) {
super(server, entity); super(server, entity);
} }
@Override
public EntityPotion getHandle() {
return (EntityPotion) entity;
}
@Override @Override
public String toString() { public String toString() {
return "CraftThrownPotion"; return "CraftThrownPotion";

View File

@ -1,6 +1,5 @@
package org.bukkit.craftbukkit.entity; package org.bukkit.craftbukkit.entity;
import net.minecraft.server.EntityCreature;
import net.minecraft.server.EntityVillager; import net.minecraft.server.EntityVillager;
import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.Villager; import org.bukkit.entity.Villager;
@ -12,6 +11,11 @@ public class CraftVillager extends CraftCreature implements Villager {
@Override @Override
public EntityVillager getHandle() { public EntityVillager getHandle() {
return (EntityVillager)super.getHandle(); return (EntityVillager) entity;
}
@Override
public String toString() {
return "CraftVillager";
} }
} }

View File

@ -11,9 +11,13 @@ public class CraftWaterMob extends CraftCreature implements WaterMob {
super(server, entity); super(server, entity);
} }
@Override
public EntityWaterAnimal getHandle() {
return (EntityWaterAnimal) entity;
}
@Override @Override
public String toString() { public String toString() {
return "CraftWaterMob"; return "CraftWaterMob";
} }
} }

View File

@ -12,6 +12,11 @@ public class CraftWeather extends CraftEntity implements Weather {
@Override @Override
public EntityWeather getHandle() { public EntityWeather getHandle() {
return (EntityWeather) super.getHandle(); return (EntityWeather) entity;
}
@Override
public String toString() {
return "CraftWeather";
} }
} }

View File

@ -110,6 +110,6 @@ public class CraftWolf extends CraftAnimals implements Wolf {
@Override @Override
public String toString() { public String toString() {
return "CraftWolf[anger=" + isAngry() + ",owner=" + getOwner() + ",tame=" + isTamed() + ",sitting=" + isSitting() + "]"; return "CraftWolf{anger=" + isAngry() + ",owner=" + getOwner() + ",tame=" + isTamed() + ",sitting=" + isSitting() + "}";
} }
} }

View File

@ -11,6 +11,11 @@ public class CraftZombie extends CraftMonster implements Zombie {
super(server, entity); super(server, entity);
} }
@Override
public EntityZombie getHandle() {
return (EntityZombie) entity;
}
@Override @Override
public String toString() { public String toString() {
return "CraftZombie"; return "CraftZombie";