diff options
author | md_5 <git@md-5.net> | 2016-06-11 12:07:12 +1000 |
---|---|---|
committer | md_5 <git@md-5.net> | 2016-06-11 12:07:12 +1000 |
commit | 82821325a6b1645d5607057e9656ef3689f5ae1a (patch) | |
tree | 01ef4fd5d16b11a83a9abfa43b3e49f583d4ef80 /src/main/java/org | |
parent | 32351955d81a12fa95006adb98d8c8030079248f (diff) | |
download | bukkit-82821325a6b1645d5607057e9656ef3689f5ae1a.tar bukkit-82821325a6b1645d5607057e9656ef3689f5ae1a.tar.gz bukkit-82821325a6b1645d5607057e9656ef3689f5ae1a.tar.lz bukkit-82821325a6b1645d5607057e9656ef3689f5ae1a.tar.xz bukkit-82821325a6b1645d5607057e9656ef3689f5ae1a.zip |
SPIGOT-2376: Way to distinguish Zombie professions.
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/entity/Villager.java | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java index dfabb460..1120330b 100644 --- a/src/main/java/org/bukkit/entity/Villager.java +++ b/src/main/java/org/bukkit/entity/Villager.java @@ -117,30 +117,44 @@ public interface Villager extends Ageable, NPC, InventoryHolder { /** * Normal. <b>Reserved for Zombies.</b> */ - NORMAL, + NORMAL(true), /** * Farmer profession. Wears a brown robe. */ - FARMER, + FARMER(false), /** * Librarian profession. Wears a white robe. */ - LIBRARIAN, + LIBRARIAN(false), /** * Priest profession. Wears a purple robe. */ - PRIEST, + PRIEST(false), /** * Blacksmith profession. Wears a black apron. */ - BLACKSMITH, + BLACKSMITH(false), /** * Butcher profession. Wears a white apron. */ - BUTCHER, + BUTCHER(false), /** * Husk. <b>Reserved for Zombies</b> */ - HUSK; + HUSK(true); + private final boolean zombie; + + private Profession(boolean zombie) { + this.zombie = zombie; + } + + /** + * Returns if this profession can only be used by zombies. + * + * @return zombie profession status + */ + public boolean isZombie() { + return zombie; + } } } |