mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-09-11 01:38:07 +02:00
Fix Bukkit's mistake with villager professions
This commit is contained in:
parent
bdad4c3f1d
commit
7e18b96186
@ -1,10 +1,9 @@
|
||||
package me.libraryaddict.disguise.disguisetypes.watchers;
|
||||
|
||||
import org.bukkit.entity.Villager.Profession;
|
||||
|
||||
import me.libraryaddict.disguise.disguisetypes.Disguise;
|
||||
import me.libraryaddict.disguise.disguisetypes.MetaIndex;
|
||||
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
|
||||
import org.bukkit.entity.Villager.Profession;
|
||||
|
||||
public class VillagerWatcher extends AgeableWatcher {
|
||||
|
||||
@ -19,7 +18,7 @@ public class VillagerWatcher extends AgeableWatcher {
|
||||
|
||||
@Deprecated
|
||||
public void setProfession(int professionId) {
|
||||
setData(MetaIndex.VILLAGER_PROFESSION, professionId);
|
||||
setData(MetaIndex.VILLAGER_PROFESSION, Math.max(1, Math.min(professionId, Profession.BUTCHER.ordinal()) - 1));
|
||||
sendData(MetaIndex.VILLAGER_PROFESSION);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user