Fixes zombie villager disguise, fixed #391
This commit is contained in:
		| @@ -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() { | ||||
|   | ||||
| @@ -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()); | ||||
|             } | ||||
|   | ||||
| @@ -1004,8 +1004,6 @@ public class ReflectionManager { | ||||
|         if (value == null) | ||||
|             return null; | ||||
|  | ||||
|         value = convertInvalidMeta(value); | ||||
|  | ||||
|         return new WrappedDataWatcherObject(index.getIndex(), index.getSerializer()); | ||||
|     } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user