mirror of
https://github.com/libraryaddict/LibsDisguises.git
synced 2024-11-04 08:59:47 +01:00
Fix zombie villager watcher
This commit is contained in:
parent
cc06600a0b
commit
ed52576277
@ -1,9 +1,8 @@
|
|||||||
package me.libraryaddict.disguise.disguisetypes.watchers;
|
package me.libraryaddict.disguise.disguisetypes.watchers;
|
||||||
|
|
||||||
import org.bukkit.entity.Villager.Profession;
|
|
||||||
|
|
||||||
import me.libraryaddict.disguise.disguisetypes.Disguise;
|
import me.libraryaddict.disguise.disguisetypes.Disguise;
|
||||||
import me.libraryaddict.disguise.disguisetypes.MetaIndex;
|
import me.libraryaddict.disguise.disguisetypes.MetaIndex;
|
||||||
|
import org.bukkit.entity.Villager.Profession;
|
||||||
|
|
||||||
public class ZombieVillagerWatcher extends ZombieWatcher {
|
public class ZombieVillagerWatcher extends ZombieWatcher {
|
||||||
|
|
||||||
@ -35,7 +34,12 @@ public class ZombieVillagerWatcher extends ZombieWatcher {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Profession getProfession() {
|
public Profession getProfession() {
|
||||||
return Profession.values()[getData(MetaIndex.ZOMBIE_VILLAGER_PROFESSION)];
|
int ord = getData(MetaIndex.ZOMBIE_VILLAGER_PROFESSION);
|
||||||
|
|
||||||
|
if (ord == 1)
|
||||||
|
return Profession.HUSK;
|
||||||
|
|
||||||
|
return Profession.NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -45,7 +49,7 @@ public class ZombieVillagerWatcher extends ZombieWatcher {
|
|||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public void setProfession(int id) {
|
public void setProfession(int id) {
|
||||||
setData(MetaIndex.ZOMBIE_VILLAGER_PROFESSION, id);
|
setData(MetaIndex.ZOMBIE_VILLAGER_PROFESSION, id % 2);
|
||||||
sendData(MetaIndex.ZOMBIE_VILLAGER_PROFESSION);
|
sendData(MetaIndex.ZOMBIE_VILLAGER_PROFESSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,8 +59,6 @@ public class ZombieVillagerWatcher extends ZombieWatcher {
|
|||||||
* @param profession
|
* @param profession
|
||||||
*/
|
*/
|
||||||
public void setProfession(Profession profession) {
|
public void setProfession(Profession profession) {
|
||||||
setData(MetaIndex.ZOMBIE_VILLAGER_PROFESSION, profession.ordinal());
|
setProfession(profession.ordinal());
|
||||||
sendData(MetaIndex.ZOMBIE_VILLAGER_PROFESSION);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user