Fixed typo in InsentientWatcher, self disguises crashing on metachange
This commit is contained in:
		
							
								
								
									
										2
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								pom.xml
									
									
									
									
									
								
							| @@ -3,7 +3,7 @@ | |||||||
| 	<modelVersion>4.0.0</modelVersion> | 	<modelVersion>4.0.0</modelVersion> | ||||||
| 	<groupId>LibsDisguises</groupId> | 	<groupId>LibsDisguises</groupId> | ||||||
| 	<artifactId>LibsDisguises</artifactId> | 	<artifactId>LibsDisguises</artifactId> | ||||||
| 	<version>9.0.8</version> | 	<version>9.0.8-SNAPSHOT</version> | ||||||
|  |  | ||||||
| 	<build> | 	<build> | ||||||
| 		<sourceDirectory>src</sourceDirectory> | 		<sourceDirectory>src</sourceDirectory> | ||||||
|   | |||||||
| @@ -456,9 +456,19 @@ public class FlagWatcher | |||||||
|             for (Player player : DisguiseUtilities.getPerverts(getDisguise())) |             for (Player player : DisguiseUtilities.getPerverts(getDisguise())) | ||||||
|             { |             { | ||||||
|                 try |                 try | ||||||
|  |                 { | ||||||
|  |                     if (player == getDisguise().getEntity()) | ||||||
|  |                     { | ||||||
|  |                         PacketContainer temp = packet.shallowClone(); | ||||||
|  |                         temp.getIntegers().write(0, DisguiseAPI.getSelfDisguiseId()); | ||||||
|  |  | ||||||
|  |                         ProtocolLibrary.getProtocolManager().sendServerPacket(player, temp); | ||||||
|  |                     } | ||||||
|  |                     else | ||||||
|                     { |                     { | ||||||
|                         ProtocolLibrary.getProtocolManager().sendServerPacket(player, packet); |                         ProtocolLibrary.getProtocolManager().sendServerPacket(player, packet); | ||||||
|                     } |                     } | ||||||
|  |                 } | ||||||
|                 catch (InvocationTargetException e) |                 catch (InvocationTargetException e) | ||||||
|                 { |                 { | ||||||
|                     e.printStackTrace(); |                     e.printStackTrace(); | ||||||
|   | |||||||
| @@ -5,7 +5,6 @@ import me.libraryaddict.disguise.disguisetypes.FlagType; | |||||||
|  |  | ||||||
| public class AgeableWatcher extends InsentientWatcher | public class AgeableWatcher extends InsentientWatcher | ||||||
| { | { | ||||||
|  |  | ||||||
|     public AgeableWatcher(Disguise disguise) |     public AgeableWatcher(Disguise disguise) | ||||||
|     { |     { | ||||||
|         super(disguise); |         super(disguise); | ||||||
| @@ -36,5 +35,4 @@ public class AgeableWatcher extends InsentientWatcher | |||||||
|         setValue(FlagType.AGEABLE_BABY, isBaby); |         setValue(FlagType.AGEABLE_BABY, isBaby); | ||||||
|         sendData(FlagType.AGEABLE_BABY); |         sendData(FlagType.AGEABLE_BABY); | ||||||
|     } |     } | ||||||
|  |  | ||||||
| } | } | ||||||
|   | |||||||
| @@ -50,6 +50,6 @@ public class InsentientWatcher extends LivingWatcher | |||||||
|  |  | ||||||
|     private boolean getInsentientFlag(int i) |     private boolean getInsentientFlag(int i) | ||||||
|     { |     { | ||||||
|         return ((byte) getValue(FlagType.PLAYER_SKIN) & 1 << i) != 0; |         return ((byte) getValue(FlagType.INSENTIENT_META) & 1 << i) != 0; | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -894,7 +894,7 @@ public class PacketsManager | |||||||
|                         List<WrappedWatchableObject> watchableObjects = disguise.getWatcher() |                         List<WrappedWatchableObject> watchableObjects = disguise.getWatcher() | ||||||
|                                 .convert(packets[0].getWatchableCollectionModifier().read(0)); |                                 .convert(packets[0].getWatchableCollectionModifier().read(0)); | ||||||
|  |  | ||||||
|                         packets[0] = new PacketContainer(sentPacket.getType()); |                         packets[0] = new PacketContainer(Server.ENTITY_METADATA); | ||||||
|  |  | ||||||
|                         StructureModifier<Object> newMods = packets[0].getModifier(); |                         StructureModifier<Object> newMods = packets[0].getModifier(); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user