diff options
Diffstat (limited to 'src/main/java/org/bukkit')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java | 5 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java | 1 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java index 04919b2c..5fcf81c4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java @@ -39,12 +39,13 @@ public class CraftVillager extends CraftAgeable implements Villager, InventoryHo } public Profession getProfession() { - return Profession.values()[getHandle().getProfession()]; + return Profession.values()[getHandle().getProfession() + 1]; // Offset by 1 from the zombie types } public void setProfession(Profession profession) { Validate.notNull(profession); - getHandle().setProfession(profession.ordinal()); + Validate.isTrue(0 < profession.ordinal() && profession.ordinal() < Profession.HUSK.ordinal(), "This profession is reserved for Zombies: ", profession); + getHandle().setProfession(profession.ordinal() - 1); } @Override diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java index 3e1fc532..ebae86f1 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java @@ -51,7 +51,6 @@ public class CraftZombie extends CraftMonster implements Zombie { @Override public Villager.Profession getVillagerProfession() { - if (!isVillager()) return Villager.Profession.NORMAL; return Villager.Profession.values()[getHandle().getVillagerType().ordinal()]; } } |