Update for 1.0.0

This commit is contained in:
Erik Broes
2011-11-20 00:01:14 -08:00
committed by Erik Broes
parent 589f66bd1b
commit 345ea36c7b
153 changed files with 6128 additions and 4617 deletions

View File

@@ -32,19 +32,23 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
}
public int getHealth() {
return getHandle().health;
return getHandle().getHealth();
}
public void setHealth(int health) {
if ((health < 0) || (health > 200)) {
throw new IllegalArgumentException("Health must be between 0 and 200");
if ((health < 0) || (health > getMaxHealth())) {
throw new IllegalArgumentException("Health must be between 0 and " + getMaxHealth());
}
if (entity instanceof EntityPlayer && health == 0) {
((EntityPlayer) entity).die(DamageSource.GENERIC);
}
getHandle().health = health;
getHandle().setHealth(health);
}
public int getMaxHealth() {
return getHandle().getMaxHealth();
}
@Override