diff --git a/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java b/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java index 19c3fb90a..5711e3026 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/disguise/DisguiseManager.java @@ -6,11 +6,20 @@ import java.util.Collection; import java.util.HashSet; import java.util.List; +import net.minecraft.server.v1_7_R4.AttributeSnapshot; +import net.minecraft.server.v1_7_R4.PacketPlayOutAbilities; import net.minecraft.server.v1_7_R4.PacketPlayOutAnimation; import net.minecraft.server.v1_7_R4.ChunkAddEntityEvent; import net.minecraft.server.v1_7_R4.EntityPlayer; import net.minecraft.server.v1_7_R4.Packet; +import net.minecraft.server.v1_7_R4.PacketPlayOutBlockChange; +import net.minecraft.server.v1_7_R4.PacketPlayOutEntityHeadRotation; +import net.minecraft.server.v1_7_R4.PacketPlayOutEntityLook; +import net.minecraft.server.v1_7_R4.PacketPlayOutKeepAlive; +import net.minecraft.server.v1_7_R4.PacketPlayOutMapChunkBulk; import net.minecraft.server.v1_7_R4.PacketPlayOutNamedEntitySpawn; +import net.minecraft.server.v1_7_R4.PacketPlayOutScoreboardObjective; +import net.minecraft.server.v1_7_R4.PacketPlayOutScoreboardScore; import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntity; import net.minecraft.server.v1_7_R4.PacketPlayOutEntityVelocity; import net.minecraft.server.v1_7_R4.PacketPlayOutEntityDestroy; @@ -19,9 +28,13 @@ import net.minecraft.server.v1_7_R4.PacketPlayOutRelEntityMoveLook; import net.minecraft.server.v1_7_R4.PacketPlayOutEntityTeleport; import net.minecraft.server.v1_7_R4.PacketPlayOutEntityMetadata; import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving; +import net.minecraft.server.v1_7_R4.PacketPlayOutTileEntityData; import net.minecraft.server.v1_7_R4.PacketPlayOutUpdateAttributes; import net.minecraft.server.v1_7_R4.PacketPlayOutEntityEquipment; import net.minecraft.server.v1_7_R4.PacketPlayOutNamedSoundEffect; +import net.minecraft.server.v1_7_R4.PacketPlayOutUpdateSign; +import net.minecraft.server.v1_7_R4.PacketPlayOutUpdateTime; +import net.minecraft.server.v1_7_R4.PacketPlayOutWorldEvent; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity; @@ -62,6 +75,7 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler private boolean _handlingPacket = false; private Field _attributesA; + private Field _attributesB; private Field _soundB; private Field _soundC; private Field _soundD; @@ -76,6 +90,8 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler { _attributesA = PacketPlayOutUpdateAttributes.class.getDeclaredField("a"); _attributesA.setAccessible(true); + _attributesB = PacketPlayOutUpdateAttributes.class.getDeclaredField("b"); + _attributesB.setAccessible(true); _soundB = PacketPlayOutNamedSoundEffect.class.getDeclaredField("b"); _soundB.setAccessible(true); _soundC = PacketPlayOutNamedSoundEffect.class.getDeclaredField("c"); @@ -371,6 +387,53 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler { if (_handlingPacket) return; + + /* + if (packetInfo.getPlayer().getName().equalsIgnoreCase("jRayx") + && !(packetInfo.getPacket() instanceof PacketPlayOutEntityVelocity) + && !(packetInfo.getPacket() instanceof PacketPlayOutEntityHeadRotation) + && !(packetInfo.getPacket() instanceof PacketPlayOutRelEntityMove) + && !(packetInfo.getPacket() instanceof PacketPlayOutRelEntityMoveLook) + && !(packetInfo.getPacket() instanceof PacketPlayOutTileEntityData) + && !(packetInfo.getPacket() instanceof PacketPlayOutUpdateTime) + && !(packetInfo.getPacket() instanceof PacketPlayOutAbilities) + && !(packetInfo.getPacket() instanceof PacketPlayOutSpawnEntityLiving) + && !(packetInfo.getPacket() instanceof PacketPlayOutEntityMetadata) + && !(packetInfo.getPacket() instanceof PacketPlayOutEntityEquipment) + && !(packetInfo.getPacket() instanceof PacketPlayOutEntityLook) + && !(packetInfo.getPacket() instanceof PacketPlayOutEntityDestroy) + && !(packetInfo.getPacket() instanceof PacketPlayOutScoreboardScore) + && !(packetInfo.getPacket() instanceof PacketPlayOutScoreboardObjective) + && !(packetInfo.getPacket() instanceof PacketPlayOutKeepAlive) + && !(packetInfo.getPacket() instanceof PacketPlayOutEntityTeleport) + && !(packetInfo.getPacket() instanceof PacketPlayOutBlockChange) + && !(packetInfo.getPacket() instanceof PacketPlayOutMapChunkBulk) + && !(packetInfo.getPacket() instanceof PacketPlayOutNamedSoundEffect) + && !(packetInfo.getPacket() instanceof PacketPlayOutUpdateSign) + && !(packetInfo.getPacket() instanceof PacketPlayOutWorldEvent)) + { + System.out.println(packetInfo.getPacket().getClass().toString()); + + if (packetInfo.getPacket() instanceof PacketPlayOutUpdateAttributes) + { + try + { + for (Object attrObject : (List)_attributesB.get(packetInfo.getPacket())) + { + AttributeSnapshot attribute = (AttributeSnapshot)attrObject; + System.out.println(attribute.a()); + System.out.println(attribute.b()); + System.out.println(attribute.c()); + } + } + catch (IllegalArgumentException | IllegalAccessException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + */ final Packet packet = packetInfo.getPacket(); Player owner = packetInfo.getPlayer();