Fixed the wrong constructor when a self disguise is removed

This commit is contained in:
libraryaddict 2013-11-23 15:50:10 +13:00
parent 26770e5b7a
commit 2f85d35df1

View File

@ -107,8 +107,11 @@ public class DisguiseUtilities {
try { try {
ProtocolLibrary.getProtocolManager().sendServerPacket( ProtocolLibrary.getProtocolManager().sendServerPacket(
player, player,
ProtocolLibrary.getProtocolManager().createPacketConstructor(Packets.Server.ENTITY_METADATA, player) ProtocolLibrary
.createPacket(player)); .getProtocolManager()
.createPacketConstructor(Packets.Server.ENTITY_METADATA, player.getEntityId(),
WrappedDataWatcher.getEntityWatcher(player), true)
.createPacket(player.getEntityId(), WrappedDataWatcher.getEntityWatcher(player), true));
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@ -206,13 +209,6 @@ public class DisguiseUtilities {
loc.getBlockY(), loc.getBlockZ()).createPacket(player, 0, loc.getBlockX(), loc.getBlockY(), loc.getBlockY(), loc.getBlockZ()).createPacket(player, 0, loc.getBlockX(), loc.getBlockY(),
loc.getBlockZ())); loc.getBlockZ()));
} }
// TODO Fix this cos it doesn't move the disguise?
byte yaw = (byte) (loc.getYaw() * 256.0F / 360.0F);
byte pitch = (byte) (loc.getPitch() * 256.0F / 360.0F);
manager.sendServerPacket(
player,
manager.createPacketConstructor(Packets.Server.ENTITY_LOOK, player.getEntityId(), yaw, pitch).createPacket(
player.getEntityId(), yaw, pitch));
// Resend any active potion effects // Resend any active potion effects
Iterator iterator = player.getActivePotionEffects().iterator(); Iterator iterator = player.getActivePotionEffects().iterator();