Deprecate magic values

By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
Bukkit/Spigot
2013-08-19 13:32:18 -05:00
parent d9f3848e22
commit f9bec6eadd
108 changed files with 1194 additions and 11 deletions

View File

@@ -370,6 +370,11 @@ public class Potion {
private static final int TIER_SHIFT = 5;
private static final int NAME_BIT = 0x3F;
/**
*
* @deprecated Magic value
*/
@Deprecated
public static Potion fromDamage(int damage) {
PotionType type = PotionType.getByDamageValue(damage & POTION_BIT);
Potion potion;
@@ -417,6 +422,11 @@ public class Potion {
brewer = other;
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public int getNameId() {
return name;
}

View File

@@ -23,6 +23,8 @@ public interface PotionBrewer {
*
* @param damage The data value of the potion
* @return The list of effects
* @deprecated Magic value
*/
@Deprecated
public Collection<PotionEffect> getEffectsFromDamage(int damage);
}

View File

@@ -154,7 +154,9 @@ public abstract class PotionEffectType {
* Returns the unique ID of this type.
*
* @return Unique ID
* @deprecated Magic value
*/
@Deprecated
public int getId() {
return id;
}
@@ -208,7 +210,9 @@ public abstract class PotionEffectType {
*
* @param id Unique ID to fetch
* @return Resulting type, or null if not found.
* @deprecated Magic value
*/
@Deprecated
public static PotionEffectType getById(int id) {
if (id >= byId.length || id < 0)
return null;

View File

@@ -28,6 +28,11 @@ public enum PotionType {
return effect;
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public int getDamageValue() {
return damageValue;
}
@@ -40,6 +45,11 @@ public enum PotionType {
return effect == null ? true : effect.isInstant();
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public static PotionType getByDamageValue(int damage) {
for (PotionType type : PotionType.values()) {
if (type.damageValue == damage)
@@ -48,6 +58,11 @@ public enum PotionType {
return null;
}
/**
*
* @deprecated Magic value
*/
@Deprecated
public static PotionType getByEffect(PotionEffectType effectType) {
if (effectType == null)
return WATER;