PaperMC/paper-server/src/main/java/org/bukkit/craftbukkit/CraftLivingEntity.java
CraftBukkit/Spigot ae512460b8 Changed tabs to 4 spaces, removed unnecessary imports
By: durron597 <martin.jared@gmail.com>
2011-01-01 08:06:04 -05:00

42 lines
1,019 B
Java

package org.bukkit.craftbukkit;
import net.minecraft.server.Entity;
import net.minecraft.server.EntityLiving;
import org.bukkit.LivingEntity;
public class CraftLivingEntity extends CraftEntity implements LivingEntity {
private EntityLiving entity;
public CraftLivingEntity(final CraftServer server, final EntityLiving entity) {
super(server, entity);
this.entity = entity;
}
public int getHealth() {
return entity.ba;
}
public void setHealth(int health) {
if ((health < 0) || (health > 20)) {
throw new IllegalArgumentException("Health must be between 0 and 20");
}
entity.ba = health;
}
@Override
public EntityLiving getHandle() {
return entity;
}
public void setHandle(final EntityLiving entity) {
super.setHandle((Entity)entity);
this.entity = entity;
}
@Override
public String toString() {
return "CraftLivingEntity{" + "id=" + getEntityID() + '}';
}
}