Fix CustomTagFix applying to holograms under certain conditions

This commit is contained in:
Shaun Bennett 2016-05-28 09:20:33 -07:00
parent 4bbf39ca1c
commit e00009a6d1

View File

@ -23,7 +23,6 @@ import net.minecraft.server.v1_8_R3.Entity;
import net.minecraft.server.v1_8_R3.EntityArmorStand;
import net.minecraft.server.v1_8_R3.Packet;
import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity;
import net.minecraft.server.v1_8_R3.PacketPlayInUseEntity.EnumEntityUseAction;
import net.minecraft.server.v1_8_R3.PacketPlayOutAttachEntity;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityDestroy;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityMetadata;
@ -59,7 +58,7 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
private NautHashMap<String, NautHashMap<Integer, Integer>> _entityRiding = new NautHashMap<String, NautHashMap<Integer, Integer>>();
private HashSet<String> _loggedIn = new HashSet<String>();
private HashSet<Integer> _ignoreSkulls = new HashSet<Integer>();
private HashSet<Integer> _ignoreIds = new HashSet<Integer>();
private NautHashMap<UUID, Long> _exemptTimeMap = new NautHashMap<UUID, Long>();
private NautHashMap<UUID, NautHashMap<CheckType, Long>> _doubleStrike = new NautHashMap<UUID, NautHashMap<CheckType, Long>>();
@ -220,12 +219,11 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
PacketPlayOutSpawnEntityLiving spawnPacket = (PacketPlayOutSpawnEntityLiving) packet;
// Ignore Armor stand packets
if (spawnPacket.b == EntityType.ARMOR_STAND.getTypeId() || spawnPacket.l == null || spawnPacket.l.c() == null
|| spawnPacket.a == 777777)
if (spawnPacket.b == EntityType.ARMOR_STAND.getTypeId() || spawnPacket.l == null || spawnPacket.l.c() == null)
{
if (spawnPacket.b == EntityType.ARMOR_STAND.getTypeId())
{
_ignoreSkulls.add(spawnPacket.a);
_ignoreIds.add(spawnPacket.a);
}
return;
@ -322,7 +320,7 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
{
PacketPlayOutEntityMetadata metaPacket = (PacketPlayOutEntityMetadata) packet;
if (metaPacket.a != 777777 && !_ignoreSkulls.contains(metaPacket.a) && metaPacket.a != owner.getEntityId())
if (metaPacket.a != 777777 && !_ignoreIds.contains(metaPacket.a) && metaPacket.a != owner.getEntityId())
{
boolean isDisplaying = _entityMap.get(owner.getName()).containsKey(metaPacket.a);
String currentName = _entityNameMap.get(owner.getName()).get(metaPacket.a);
@ -423,9 +421,9 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler, NCPHook
else if (packet instanceof PacketPlayOutSpawnEntity)
{
PacketPlayOutSpawnEntity spawnPacket = (PacketPlayOutSpawnEntity) packet;
if (spawnPacket.j == 66 && spawnPacket.a != 777777)
if (spawnPacket.j == 78) // Armor Stand Object ID
{
_ignoreSkulls.add(spawnPacket.a);
_ignoreIds.add(spawnPacket.a);
}
}
else if (packet instanceof PacketPlayInUseEntity)