Update Bukkit for Minecraft 1.6.1

By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
Bukkit/Spigot
2013-07-01 05:50:24 -05:00
parent 4a573b3312
commit 153cde6043
13 changed files with 225 additions and 27 deletions

View File

@@ -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.

View File

@@ -130,6 +130,7 @@ public enum EntityType {
SNOWMAN("SnowMan", Snowman.class, 97),
OCELOT("Ozelot", Ocelot.class, 98),
IRON_GOLEM("VillagerGolem", IronGolem.class, 99),
HORSE("EntityHorse", Horse.class, 100),
VILLAGER("Villager", Villager.class, 120),
ENDER_CRYSTAL("EnderCrystal", EnderCrystal.class, 200),
// These don't have an entity ID in nms.EntityTypes.

View File

@@ -0,0 +1,6 @@
package org.bukkit.entity;
/**
* Represents a Horse.
*/
public interface Horse extends Animals, Vehicle {}

View File

@@ -14,6 +14,7 @@ import org.bukkit.potion.PotionEffectType;
* Represents a living entity, such as a monster or player
*/
public interface LivingEntity extends Entity, Damageable {
/**
* Gets the height of the living entity's eyes above its Location.
*
@@ -170,14 +171,30 @@ public interface LivingEntity extends Entity, Damageable {
*
* @return damage taken since the last no damage ticks time period
*/
public int getLastDamage();
public double getLastDamage();
/**
* 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
public int _INVALID_getLastDamage();
/**
* Sets the damage dealt within the current no damage ticks time period.
*
* @param damage amount of damage
*/
public void setLastDamage(int damage);
public void setLastDamage(double damage);
/**
* 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
public void _INVALID_setLastDamage(int damage);
/**
* Returns the living entity's current no damage ticks.
@@ -316,7 +333,7 @@ public interface LivingEntity extends Entity, Damageable {
* <p>
* This value has no effect on players, they will always use their real
* name.
*
*
* @param name the name to set
*/
public void setCustomName(String name);
@@ -327,7 +344,7 @@ public interface LivingEntity extends Entity, Damageable {
* <p>
* This value has no effect on players, they will always use their real
* name.
*
*
* @return name of the mob or null
*/
public String getCustomName();
@@ -338,7 +355,7 @@ public interface LivingEntity extends Entity, Damageable {
* <p>
* This value has no effect on players, they will always display their
* name.
*
*
* @param flag custom name or not
*/
public void setCustomNameVisible(boolean flag);
@@ -348,7 +365,7 @@ public interface LivingEntity extends Entity, Damageable {
* <p>
* This value has no effect on players, they will always display their
* name.
*
*
* @return if the custom name is displayed
*/
public boolean isCustomNameVisible();

View File

@@ -7,19 +7,35 @@ import org.bukkit.util.Vector;
*/
public interface Minecart extends Vehicle {
/**
* 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
public void _INVALID_setDamage(int damage);
/**
* Sets a minecart's damage.
*
* @param damage over 40 to "kill" a minecart
*/
public void setDamage(int damage);
public void setDamage(double damage);
/**
* 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
public int _INVALID_getDamage();
/**
* Gets a minecart's damage.
*
* @return The damage
*/
public int getDamage();
public double getDamage();
/**
* Gets the maximum speed of a minecart. The speed is unrelated to the velocity.