Fixes zombie villager disguise, fixed #391

This commit is contained in:
libraryaddict 2019-09-16 14:30:16 +12:00
parent 80b11bfc6a
commit ceb10171c9
3 changed files with 6 additions and 8 deletions

View File

@ -35,12 +35,12 @@ public class ZombieVillagerWatcher extends ZombieWatcher {
}
public VillagerData getVillagerData() {
return getData(MetaIndex.VILLAGER_DATA);
return getData(MetaIndex.ZOMBIE_VILLAGER_PROFESSION);
}
public void setVillagerData(VillagerData villagerData) {
setData(MetaIndex.VILLAGER_DATA, villagerData);
sendData(MetaIndex.VILLAGER_DATA);
setData(MetaIndex.ZOMBIE_VILLAGER_PROFESSION, villagerData);
sendData(MetaIndex.ZOMBIE_VILLAGER_PROFESSION);
}
public Profession getProfession() {

View File

@ -1132,7 +1132,6 @@ public class DisguiseUtilities {
return;
}
try {
if (selfDisguised.contains(disguise.getEntity().getUniqueId()) && disguise.isDisguiseInUse()) {
removeSelfDisguise((Player) disguise.getEntity());
@ -1791,9 +1790,10 @@ public class DisguiseUtilities {
if (watchableObject.getValue() == null)
continue;
MetaIndex metaIndex = MetaIndex.getMetaIndex(disguiseWatcher, watchableObject.getIndex());
WrappedDataWatcher.WrappedDataWatcherObject obj = ReflectionManager
.createDataWatcherObject(MetaIndex.getMetaIndex(disguiseWatcher, watchableObject.getIndex()),
watchableObject.getValue());
.createDataWatcherObject(metaIndex, watchableObject.getValue());
newWatcher.setObject(obj, watchableObject.getValue());
}

View File

@ -1004,8 +1004,6 @@ public class ReflectionManager {
if (value == null)
return null;
value = convertInvalidMeta(value);
return new WrappedDataWatcherObject(index.getIndex(), index.getSerializer());
}