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() { public VillagerData getVillagerData() {
return getData(MetaIndex.VILLAGER_DATA); return getData(MetaIndex.ZOMBIE_VILLAGER_PROFESSION);
} }
public void setVillagerData(VillagerData villagerData) { public void setVillagerData(VillagerData villagerData) {
setData(MetaIndex.VILLAGER_DATA, villagerData); setData(MetaIndex.ZOMBIE_VILLAGER_PROFESSION, villagerData);
sendData(MetaIndex.VILLAGER_DATA); sendData(MetaIndex.ZOMBIE_VILLAGER_PROFESSION);
} }
public Profession getProfession() { public Profession getProfession() {

View File

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

View File

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