package net.md_5.bungee.protocol.packet;

import io.netty.buffer.ByteBuf;

public class Packet2CEntityProperties extends DefinedPacket
{

    public Packet2CEntityProperties()
    {
        super( 0x2C );
    }

    @Override
    public String toString() {
        return "Packet2CEntityProperties{}";
    }

    @Override
    public void read(ByteBuf buf)
    {
        buf.readInt();
        int recordCount = buf.readInt();
        for ( int i = 0; i < recordCount; i++ )
        {
            readString( buf );
            buf.readDouble();
            short size = buf.readShort();
            for ( short s = 0; s < size; s++ )
            {
                buf.skipBytes( 25 ); // long, long, double, byte
            }
        }
    }

    @Override
    public void write(ByteBuf buf)
    {
        throw new UnsupportedOperationException();
    }

    @Override
    public void handle(AbstractPacketHandler handler) throws Exception
    {
        handler.handle( this );
    }

    @Override
    public boolean equals(Object o) {
        if (o == this) {
            return true;
        }
        else if(!(o instanceof PacketCEScoreboardObjective)) {
            return false;
        }
        else {
            return false;
        }
    }

    @Override
    public int hashCode() {
        final int PRIME = 31;
        int result = 1;
        final Object $name = this.hashCode();
        result = result * 31 + (($name == null) ? 0 : $name.hashCode());
        return result;
    }
}
