Package org.kitteh.tag.api

Examples of org.kitteh.tag.api.TagInfo


    @Override
    protected void handlePacketAdd(Object o, Player owner) {
        if (o instanceof Packet20NamedEntitySpawn) {
            final Packet20NamedEntitySpawn packet = ((Packet20NamedEntitySpawn) o);
            final TagInfo info = this.handler.getNameForPacket20((String) null, packet.a, packet.b, owner);
            if (info != null) {
                packet.b = info.getName();
            }
        }
    }
View Full Code Here


    @Override
    protected void handlePacketAdd(Object o, Player owner) {
        if (o instanceof Packet20NamedEntitySpawn) {
            final Packet20NamedEntitySpawn packet = ((Packet20NamedEntitySpawn) o);
            final TagInfo info = this.handler.getNameForPacket20((String) null, packet.a, packet.b, owner);
            if (info != null) {
                packet.b = info.getName();
            }
        }
    }
View Full Code Here

    @Override
    protected void handlePacketAdd(Object o, Player owner) {
        if (o instanceof Packet20NamedEntitySpawn) {
            final Packet20NamedEntitySpawn packet = ((Packet20NamedEntitySpawn) o);
            final TagInfo info = this.handler.getNameForPacket20((String) null, packet.a, packet.b, owner);
            if (info != null) {
                packet.b = info.getName();
            }
        }
    }
View Full Code Here

                if (event.getPacketID() != Packets.Server.NAMED_ENTITY_SPAWN) {
                    return;
                }
                final PacketContainer packetContainer = event.getPacket();
                try {
                    final TagInfo info = ProtocolLibHandler.this.handler.getNameForPacket20((String) null, packetContainer.getSpecificModifier(int.class).read(0), packetContainer.getSpecificModifier(String.class).read(0), event.getPlayer());
                    if (info != null) {
                        packetContainer.getSpecificModifier(String.class).write(0, info.getName());
                    }
                } catch (final FieldAccessException e) {
                    e.printStackTrace();
                }
            }
View Full Code Here

        this.getServer().getPluginManager().callEvent(event);
        String name = event.getTag();
        if (name.length() > 16) {
            name = name.substring(0, 16);
        }
        return new TagInfo(event.getUUID(), name);
    }
View Full Code Here

    @Override
    protected void handlePacketAdd(Object o, Player owner) {
        if (o instanceof Packet20NamedEntitySpawn) {
            final Packet20NamedEntitySpawn packet = ((Packet20NamedEntitySpawn) o);
            final TagInfo info = this.handler.getNameForPacket20((String) null, packet.a, packet.b, owner);
            if (info != null) {
                packet.b = info.getName();
            }
        }
    }
View Full Code Here

        if (packet instanceof PacketPlayOutNamedEntitySpawn) {
            final PacketPlayOutNamedEntitySpawn p = (PacketPlayOutNamedEntitySpawn) packet;
            final GameProfile profile = (GameProfile) this.gameProfileField.get(p);
            final String oldName = profile.getName();
            final String oldID = profile.getId();
            final TagInfo newName = this.handler.getNameForPacket20(oldID, this.entityIDField.getInt(p), oldName, destination);
            if (newName != null) {
                this.gameProfileField.set(p, new GameProfile(newName.getUUID().toString().replaceAll("-", ""), newName.getName()));
            }
        }
    }
View Full Code Here

    @Override
    protected void handlePacketAdd(Object o, Player owner) {
        if (o instanceof Packet20NamedEntitySpawn) {
            final Packet20NamedEntitySpawn packet = ((Packet20NamedEntitySpawn) o);
            final TagInfo info = this.handler.getNameForPacket20((String) null, packet.a, packet.b, owner);
            if (info != null) {
                packet.b = info.getName();
            }
        }
    }
View Full Code Here

        if (packet instanceof PacketPlayOutNamedEntitySpawn) {
            final PacketPlayOutNamedEntitySpawn p = (PacketPlayOutNamedEntitySpawn) packet;
            final GameProfile profile = (GameProfile) this.gameProfileField.get(p);
            final String oldName = profile.getName();
            final UUID oldID = profile.getId();
            final TagInfo newName = this.handler.getNameForPacket20(oldID, this.entityIDField.getInt(p), oldName, destination);
            if (newName != null && !newName.getName().equals(oldName)) {
                int i = this.tastySnack++;
                this.gameProfileField.set(p, new GameProfile(UUID.nameUUIDFromBytes(new byte[]{(byte) (i >> 24), (byte) (i >> 16), (byte) (i >> 8), (byte) i}), newName.getName()));
            }
        }
    }
View Full Code Here

    @Override
    protected void handlePacketAdd(Object o, Player owner) {
        if (o instanceof Packet20NamedEntitySpawn) {
            final Packet20NamedEntitySpawn packet = ((Packet20NamedEntitySpawn) o);
            final TagInfo info = this.handler.getNameForPacket20((String) null, packet.a, packet.b, owner);
            if (info != null) {
                packet.b = info.getName();
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.kitteh.tag.api.TagInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.