Some commented out testing code in DisguiseManager
This commit is contained in:
parent
108421164c
commit
827fef535f
@ -6,11 +6,20 @@ import java.util.Collection;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
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.PacketPlayOutAnimation;
|
||||||
import net.minecraft.server.v1_7_R4.ChunkAddEntityEvent;
|
import net.minecraft.server.v1_7_R4.ChunkAddEntityEvent;
|
||||||
import net.minecraft.server.v1_7_R4.EntityPlayer;
|
import net.minecraft.server.v1_7_R4.EntityPlayer;
|
||||||
import net.minecraft.server.v1_7_R4.Packet;
|
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.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.PacketPlayOutSpawnEntity;
|
||||||
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityVelocity;
|
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityVelocity;
|
||||||
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityDestroy;
|
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.PacketPlayOutEntityTeleport;
|
||||||
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityMetadata;
|
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityMetadata;
|
||||||
import net.minecraft.server.v1_7_R4.PacketPlayOutSpawnEntityLiving;
|
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.PacketPlayOutUpdateAttributes;
|
||||||
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityEquipment;
|
import net.minecraft.server.v1_7_R4.PacketPlayOutEntityEquipment;
|
||||||
import net.minecraft.server.v1_7_R4.PacketPlayOutNamedSoundEffect;
|
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.Bukkit;
|
||||||
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity;
|
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 boolean _handlingPacket = false;
|
||||||
|
|
||||||
private Field _attributesA;
|
private Field _attributesA;
|
||||||
|
private Field _attributesB;
|
||||||
private Field _soundB;
|
private Field _soundB;
|
||||||
private Field _soundC;
|
private Field _soundC;
|
||||||
private Field _soundD;
|
private Field _soundD;
|
||||||
@ -76,6 +90,8 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler
|
|||||||
{
|
{
|
||||||
_attributesA = PacketPlayOutUpdateAttributes.class.getDeclaredField("a");
|
_attributesA = PacketPlayOutUpdateAttributes.class.getDeclaredField("a");
|
||||||
_attributesA.setAccessible(true);
|
_attributesA.setAccessible(true);
|
||||||
|
_attributesB = PacketPlayOutUpdateAttributes.class.getDeclaredField("b");
|
||||||
|
_attributesB.setAccessible(true);
|
||||||
_soundB = PacketPlayOutNamedSoundEffect.class.getDeclaredField("b");
|
_soundB = PacketPlayOutNamedSoundEffect.class.getDeclaredField("b");
|
||||||
_soundB.setAccessible(true);
|
_soundB.setAccessible(true);
|
||||||
_soundC = PacketPlayOutNamedSoundEffect.class.getDeclaredField("c");
|
_soundC = PacketPlayOutNamedSoundEffect.class.getDeclaredField("c");
|
||||||
@ -372,6 +388,53 @@ public class DisguiseManager extends MiniPlugin implements IPacketHandler
|
|||||||
if (_handlingPacket)
|
if (_handlingPacket)
|
||||||
return;
|
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();
|
final Packet packet = packetInfo.getPacket();
|
||||||
Player owner = packetInfo.getPlayer();
|
Player owner = packetInfo.getPlayer();
|
||||||
final PacketVerifier packetVerifier = packetInfo.getVerifier();
|
final PacketVerifier packetVerifier = packetInfo.getVerifier();
|
||||||
|
Loading…
Reference in New Issue
Block a user