001package net.minecraft.network.packet;
002
003import java.io.DataInputStream;
004import java.io.DataOutputStream;
005import java.io.IOException;
006import net.minecraft.scoreboard.Score;
007
008public class Packet207SetScore extends Packet
009{
010    public String field_96488_a = "";
011    public String field_96486_b = "";
012    public int field_96487_c = 0;
013    public int field_96485_d = 0;
014
015    public Packet207SetScore() {}
016
017    public Packet207SetScore(Score par1, int par2)
018    {
019        this.field_96488_a = par1.func_96653_e();
020        this.field_96486_b = par1.func_96645_d().func_96679_b();
021        this.field_96487_c = par1.func_96652_c();
022        this.field_96485_d = par2;
023    }
024
025    public Packet207SetScore(String par1)
026    {
027        this.field_96488_a = par1;
028        this.field_96486_b = "";
029        this.field_96487_c = 0;
030        this.field_96485_d = 1;
031    }
032
033    /**
034     * Abstract. Reads the raw packet data from the data stream.
035     */
036    public void readPacketData(DataInputStream par1DataInputStream) throws IOException
037    {
038        this.field_96488_a = readString(par1DataInputStream, 16);
039        this.field_96485_d = par1DataInputStream.readByte();
040
041        if (this.field_96485_d != 1)
042        {
043            this.field_96486_b = readString(par1DataInputStream, 16);
044            this.field_96487_c = par1DataInputStream.readInt();
045        }
046    }
047
048    /**
049     * Abstract. Writes the raw packet data to the data stream.
050     */
051    public void writePacketData(DataOutputStream par1DataOutputStream) throws IOException
052    {
053        writeString(this.field_96488_a, par1DataOutputStream);
054        par1DataOutputStream.writeByte(this.field_96485_d);
055
056        if (this.field_96485_d != 1)
057        {
058            writeString(this.field_96486_b, par1DataOutputStream);
059            par1DataOutputStream.writeInt(this.field_96487_c);
060        }
061    }
062
063    /**
064     * Passes this Packet on to the NetHandler for processing.
065     */
066    public void processPacket(NetHandler par1NetHandler)
067    {
068        par1NetHandler.func_96437_a(this);
069    }
070
071    /**
072     * Abstract. Return the size of the packet (not counting the header).
073     */
074    public int getPacketSize()
075    {
076        return 2 + this.field_96488_a.length() + 2 + this.field_96486_b.length() + 4 + 1;
077    }
078}