@@ -9,7 +9,15 @@ public interface Damageable extends Entity {
|
||||
*
|
||||
* @param amount Amount of damage to deal
|
||||
*/
|
||||
void damage(int amount);
|
||||
void damage(double amount);
|
||||
|
||||
/**
|
||||
* This method exists for legacy reasons to provide backwards
|
||||
* compatibility. It will not exist at runtime and should not be used
|
||||
* under any circumstances.
|
||||
*/
|
||||
@Deprecated
|
||||
void _INVALID_damage(int amount);
|
||||
|
||||
/**
|
||||
* Deals the given amount of damage to this entity, from a specified entity.
|
||||
@@ -17,14 +25,30 @@ public interface Damageable extends Entity {
|
||||
* @param amount Amount of damage to deal
|
||||
* @param source Entity which to attribute this damage from
|
||||
*/
|
||||
void damage(int amount, Entity source);
|
||||
void damage(double amount, Entity source);
|
||||
|
||||
/**
|
||||
* This method exists for legacy reasons to provide backwards
|
||||
* compatibility. It will not exist at runtime and should not be used
|
||||
* under any circumstances.
|
||||
*/
|
||||
@Deprecated
|
||||
void _INVALID_damage(int amount, Entity source);
|
||||
|
||||
/**
|
||||
* Gets the entity's health from 0 to {@link #getMaxHealth()}, where 0 is dead.
|
||||
*
|
||||
* @return Health represented from 0 to max
|
||||
*/
|
||||
int getHealth();
|
||||
double getHealth();
|
||||
|
||||
/**
|
||||
* This method exists for legacy reasons to provide backwards
|
||||
* compatibility. It will not exist at runtime and should not be used
|
||||
* under any circumstances.
|
||||
*/
|
||||
@Deprecated
|
||||
int _INVALID_getHealth();
|
||||
|
||||
/**
|
||||
* Sets the entity's health from 0 to {@link #getMaxHealth()}, where 0 is dead.
|
||||
@@ -32,14 +56,30 @@ public interface Damageable extends Entity {
|
||||
* @param health New health represented from 0 to max
|
||||
* @throws IllegalArgumentException Thrown if the health is < 0 or > {@link #getMaxHealth()}
|
||||
*/
|
||||
void setHealth(int health);
|
||||
void setHealth(double health);
|
||||
|
||||
/**
|
||||
* This method exists for legacy reasons to provide backwards
|
||||
* compatibility. It will not exist at runtime and should not be used
|
||||
* under any circumstances.
|
||||
*/
|
||||
@Deprecated
|
||||
void _INVALID_setHealth(int health);
|
||||
|
||||
/**
|
||||
* Gets the maximum health this entity has.
|
||||
*
|
||||
* @return Maximum health
|
||||
*/
|
||||
int getMaxHealth();
|
||||
double getMaxHealth();
|
||||
|
||||
/**
|
||||
* This method exists for legacy reasons to provide backwards
|
||||
* compatibility. It will not exist at runtime and should not be used
|
||||
* under any circumstances.
|
||||
*/
|
||||
@Deprecated
|
||||
int _INVALID_getMaxHealth();
|
||||
|
||||
/**
|
||||
* Sets the maximum health this entity can have.
|
||||
@@ -50,7 +90,15 @@ public interface Damageable extends Entity {
|
||||
*
|
||||
* @param health amount of health to set the maximum to
|
||||
*/
|
||||
void setMaxHealth(int health);
|
||||
void setMaxHealth(double health);
|
||||
|
||||
/**
|
||||
* This method exists for legacy reasons to provide backwards
|
||||
* compatibility. It will not exist at runtime and should not be used
|
||||
* under any circumstances.
|
||||
*/
|
||||
@Deprecated
|
||||
void _INVALID_setMaxHealth(int health);
|
||||
|
||||
/**
|
||||
* Resets the max health to the original amount.
|
||||
|
||||
Reference in New Issue
Block a user