Add methods to set and reset max health. Adds BUKKIT-266

By: feildmaster <admin@feildmaster.com>
This commit is contained in:
Bukkit/Spigot
2012-12-23 03:28:01 -06:00
parent ea74fb0bf1
commit cf6e899830
3 changed files with 61 additions and 40 deletions

View File

@@ -13,30 +13,7 @@ import org.bukkit.potion.PotionEffectType;
/**
* Represents a living entity, such as a monster or player
*/
public interface LivingEntity extends Entity {
/**
* Gets the entity's health from 0 to {@link #getMaxHealth()}, where 0 is dead
*
* @return Health represented from 0 to max
*/
public int getHealth();
/**
* Sets the entity's health from 0 to {@link #getMaxHealth()}, where 0 is dead
*
* @param health New health represented from 0 to max
* @throws IllegalArgumentException Thrown if the health is < 0 or > max
*/
public void setHealth(int health);
/**
* Gets the maximum health this entity may have
*
* @return Maximum health
*/
public int getMaxHealth();
public interface LivingEntity extends Entity, Damageable {
/**
* Gets the height of the entity's head above its Location
*
@@ -152,21 +129,6 @@ public interface LivingEntity extends Entity {
*/
public void setMaximumAir(int ticks);
/**
* Deals the given amount of damage to this entity
*
* @param amount Amount of damage to deal
*/
public void damage(int amount);
/**
* Deals the given amount of damage to this entity, from a specified entity
*
* @param amount Amount of damage to deal
* @param source Entity which to attribute this damage from
*/
public void damage(int amount, Entity source);
/**
* Returns the entities current maximum noDamageTicks
* This is the time in ticks the entity will become unable to take