From b2156bae0d9c287dddc56aa8a874b7ee6de248f7 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sun, 14 May 2017 12:00:00 +1000 Subject: [PATCH] Remove _INVALID_ methods By: md_5 --- .../src/main/java/org/bukkit/Bukkit.java | 15 ----- .../src/main/java/org/bukkit/Server.java | 13 ---- .../java/org/bukkit/entity/Damageable.java | 63 ------------------- .../java/org/bukkit/entity/LivingEntity.java | 20 ------ .../main/java/org/bukkit/entity/Minecart.java | 20 ------ .../java/org/bukkit/entity/Projectile.java | 20 ------ .../event/entity/EntityDamageEvent.java | 24 ------- .../event/entity/EntityRegainHealthEvent.java | 24 ------- .../event/vehicle/VehicleDamageEvent.java | 30 --------- 9 files changed, 229 deletions(-) diff --git a/paper-api/src/main/java/org/bukkit/Bukkit.java b/paper-api/src/main/java/org/bukkit/Bukkit.java index 75b0a9a4b2..34363f6962 100644 --- a/paper-api/src/main/java/org/bukkit/Bukkit.java +++ b/paper-api/src/main/java/org/bukkit/Bukkit.java @@ -109,21 +109,6 @@ public final class Bukkit { return server.getBukkitVersion(); } - /** - * Gets an array copy of all currently logged in players. - *

- * 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 superseded by {@link #getOnlinePlayers()} - * @return an array of Players that are currently online - */ - @Deprecated - public static Player[] _INVALID_getOnlinePlayers() { - return server._INVALID_getOnlinePlayers(); - } - /** * Gets a view of all currently logged in players. This {@linkplain * Collections#unmodifiableCollection(Collection) view} is a reused diff --git a/paper-api/src/main/java/org/bukkit/Server.java b/paper-api/src/main/java/org/bukkit/Server.java index 9468c4a678..a327527ea7 100644 --- a/paper-api/src/main/java/org/bukkit/Server.java +++ b/paper-api/src/main/java/org/bukkit/Server.java @@ -89,19 +89,6 @@ public interface Server extends PluginMessageRecipient { */ public String getBukkitVersion(); - /** - * Gets an array copy of all currently logged in players. - *

- * 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 superseded by {@link #getOnlinePlayers()} - * @return an array of Players that are currently online - */ - @Deprecated - public Player[] _INVALID_getOnlinePlayers(); - /** * Gets a view of all currently logged in players. This {@linkplain * Collections#unmodifiableCollection(Collection) view} is a reused diff --git a/paper-api/src/main/java/org/bukkit/entity/Damageable.java b/paper-api/src/main/java/org/bukkit/entity/Damageable.java index bd601bb60b..e173cf0114 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Damageable.java +++ b/paper-api/src/main/java/org/bukkit/entity/Damageable.java @@ -13,16 +13,6 @@ public interface Damageable extends Entity { */ 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. - * - * @param amount Amount of damage to deal - */ - @Deprecated - void _INVALID_damage(int amount); - /** * Deals the given amount of damage to this entity, from a specified * entity. @@ -32,17 +22,6 @@ public interface Damageable extends Entity { */ 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. - * - * @param amount Amount of damage to deal - * @param source Entity which to attribute this damage from - */ - @Deprecated - void _INVALID_damage(int amount, Entity source); - /** * Gets the entity's health from 0 to {@link #getMaxHealth()}, where 0 is dead. * @@ -50,16 +29,6 @@ public interface Damageable extends Entity { */ 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. - * - * @return Health represented from 0 to max - */ - @Deprecated - int _INVALID_getHealth(); - /** * Sets the entity's health from 0 to {@link #getMaxHealth()}, where 0 is * dead. @@ -70,18 +39,6 @@ public interface Damageable extends Entity { */ 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. - * - * @param health New health represented from 0 to max - * @throws IllegalArgumentException Thrown if the health is {@literal < 0 or >} - * {@link #getMaxHealth()} - */ - @Deprecated - void _INVALID_setHealth(int health); - /** * Gets the maximum health this entity has. * @@ -91,16 +48,6 @@ public interface Damageable extends Entity { @Deprecated 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. - * - * @return Maximum health - */ - @Deprecated - int _INVALID_getMaxHealth(); - /** * Sets the maximum health this entity can have. *

@@ -116,16 +63,6 @@ public interface Damageable extends Entity { @Deprecated 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. - * - * @param health amount of health to set the maximum to - */ - @Deprecated - void _INVALID_setMaxHealth(int health); - /** * Resets the max health to the original amount. * @deprecated use {@link Attribute#GENERIC_MAX_HEALTH}. diff --git a/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java b/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java index 12a5593494..5423af84fe 100644 --- a/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java +++ b/paper-api/src/main/java/org/bukkit/entity/LivingEntity.java @@ -168,16 +168,6 @@ public interface LivingEntity extends Attributable, Entity, Damageable, Projecti */ 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. - * - * @return damage taken since the last no damage ticks time period - */ - @Deprecated - public int _INVALID_getLastDamage(); - /** * Sets the damage dealt within the current no damage ticks time period. * @@ -185,16 +175,6 @@ public interface LivingEntity extends Attributable, Entity, Damageable, Projecti */ 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. - * - * @param damage amount of damage - */ - @Deprecated - public void _INVALID_setLastDamage(int damage); - /** * Returns the living entity's current no damage ticks. * diff --git a/paper-api/src/main/java/org/bukkit/entity/Minecart.java b/paper-api/src/main/java/org/bukkit/entity/Minecart.java index ea64114221..904d84cb53 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Minecart.java +++ b/paper-api/src/main/java/org/bukkit/entity/Minecart.java @@ -9,16 +9,6 @@ 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. - * - * @param damage over 40 to "kill" a minecart - */ - @Deprecated - public void _INVALID_setDamage(int damage); - /** * Sets a minecart's damage. * @@ -26,16 +16,6 @@ public interface Minecart extends Vehicle { */ 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. - * - * @return The damage - */ - @Deprecated - public int _INVALID_getDamage(); - /** * Gets a minecart's damage. * diff --git a/paper-api/src/main/java/org/bukkit/entity/Projectile.java b/paper-api/src/main/java/org/bukkit/entity/Projectile.java index a5599fa36f..4ab2332fa3 100644 --- a/paper-api/src/main/java/org/bukkit/entity/Projectile.java +++ b/paper-api/src/main/java/org/bukkit/entity/Projectile.java @@ -7,16 +7,6 @@ import org.bukkit.projectiles.ProjectileSource; */ public interface Projectile extends Entity { - /** - * This method exists for legacy reasons to provide backwards - * compatibility. It will not exist at runtime and should not be used - * under any circumstances. - * - * @return the {@link LivingEntity} that shot this projectile - */ - @Deprecated - public LivingEntity _INVALID_getShooter(); - /** * Retrieve the shooter of this projectile. * @@ -24,16 +14,6 @@ public interface Projectile extends Entity { */ public ProjectileSource getShooter(); - /** - * This method exists for legacy reasons to provide backwards - * compatibility. It will not exist at runtime and should not be used - * under any circumstances. - * - * @param shooter the {@link LivingEntity} that shot this projectile - */ - @Deprecated - public void _INVALID_setShooter(LivingEntity shooter); - /** * Set the shooter of this projectile. * diff --git a/paper-api/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java index ed9387c1a5..bd1cc6fc66 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/EntityDamageEvent.java @@ -145,18 +145,6 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable { return 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. - * - * @return the (rounded) damage - */ - @Deprecated - public int _INVALID_getDamage() { - return NumberConversions.ceil(getDamage()); - } - /** * Sets the raw amount of damage caused by the event. *

@@ -194,18 +182,6 @@ public class EntityDamageEvent extends EntityEvent implements Cancellable { setDamage(DamageModifier.BASE, 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. - * - * @param damage the new damage value - */ - @Deprecated - public void _INVALID_setDamage(int damage) { - setDamage(damage); - } - /** * Gets the cause of the damage. * diff --git a/paper-api/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java index c7e9ba6ffb..1dd50c5631 100644 --- a/paper-api/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java @@ -29,18 +29,6 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable return 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. - * - * @return the (rounded) amount regained - */ - @Deprecated - public int _INVALID_getAmount() { - return NumberConversions.ceil(getAmount()); - } - /** * Sets the amount of regained health * @@ -50,18 +38,6 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable this.amount = 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. - * - * @param amount the amount that will be regained - */ - @Deprecated - public void _INVALID_setAmount(int amount) { - setAmount(amount); - } - @Override public boolean isCancelled() { return cancelled; diff --git a/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleDamageEvent.java b/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleDamageEvent.java index c7b9c1a691..dec18b8337 100644 --- a/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleDamageEvent.java +++ b/paper-api/src/main/java/org/bukkit/event/vehicle/VehicleDamageEvent.java @@ -4,7 +4,6 @@ import org.bukkit.entity.Entity; import org.bukkit.entity.Vehicle; import org.bukkit.event.Cancellable; import org.bukkit.event.HandlerList; -import org.bukkit.util.NumberConversions; /** * Raised when a vehicle receives damage. @@ -15,11 +14,6 @@ public class VehicleDamageEvent extends VehicleEvent implements Cancellable { private double damage; private boolean cancelled; - @Deprecated - public VehicleDamageEvent(final Vehicle vehicle, final Entity attacker, final int damage) { - this(vehicle, attacker, (double) damage); - } - public VehicleDamageEvent(final Vehicle vehicle, final Entity attacker, final double damage) { super(vehicle); this.attacker = attacker; @@ -44,18 +38,6 @@ public class VehicleDamageEvent extends VehicleEvent implements Cancellable { return 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. - * - * @return the damage - */ - @Deprecated - public int _INVALID_getDamage() { - return NumberConversions.ceil(getDamage()); - } - /** * Sets the damage done to the vehicle * @@ -65,18 +47,6 @@ public class VehicleDamageEvent extends VehicleEvent implements Cancellable { this.damage = 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. - * - * @param damage the damage - */ - @Deprecated - public void _INVALID_setDamage(int damage) { - setDamage(damage); - } - public boolean isCancelled() { return cancelled; }