diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java index 2cb26a7b..7cf5e4b7 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftVillager.java @@ -1,7 +1,7 @@ package org.bukkit.craftbukkit.entity; import net.minecraft.server.EntityVillager; - +import org.apache.commons.lang.Validate; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.EntityType; import org.bukkit.entity.Villager; @@ -24,4 +24,13 @@ public class CraftVillager extends CraftCreature implements Villager { public EntityType getType() { return EntityType.VILLAGER; } + + public Profession getProfession() { + return Profession.getProfession(getHandle().getProfession()); + } + + public void setProfession(Profession profession) { + Validate.notNull(profession); + getHandle().setProfession(profession.getId()); + } } |