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

@@ -4,16 +4,17 @@ package org.bukkit.entity;
* Represents a villager NPC
*/
public interface Villager extends Ageable, NPC {
/**
* Gets the current profession of this villager.
*
* @return Current profession.
*/
public Profession getProfession();
/**
* Sets the new profession of this villager.
*
*
* @param profession New profession.
*/
public void setProfession(Profession profession);
@@ -46,7 +47,9 @@ public interface Villager extends Ageable, NPC {
* Gets the ID of this profession.
*
* @return Profession ID.
* @deprecated Magic value
*/
@Deprecated
public int getId() {
return id;
}
@@ -56,7 +59,9 @@ public interface Villager extends Ageable, NPC {
*
* @param id ID of the profession to get.
* @return Resulting profession, or null if not found.
* @deprecated Magic value
*/
@Deprecated
public static Profession getProfession(int id) {
return (id >= professions.length) ? null : professions[id];
}