001package net.minecraft.network.packet;
002
003import java.io.DataInputStream;
004import java.io.DataOutputStream;
005import java.io.IOException;
006
007public class Packet254ServerPing extends Packet
008{
009    /** Always 1, unless readByte threw an exception. */
010    public int readSuccessfully = 0;
011
012    /**
013     * Abstract. Reads the raw packet data from the data stream.
014     */
015    public void readPacketData(DataInputStream par1DataInputStream) throws IOException
016    {
017        try
018        {
019            this.readSuccessfully = par1DataInputStream.readByte();
020        }
021        catch (Throwable throwable)
022        {
023            this.readSuccessfully = 0;
024        }
025    }
026
027    /**
028     * Abstract. Writes the raw packet data to the data stream.
029     */
030    public void writePacketData(DataOutputStream par1DataOutputStream) throws IOException {}
031
032    /**
033     * Passes this Packet on to the NetHandler for processing.
034     */
035    public void processPacket(NetHandler par1NetHandler)
036    {
037        par1NetHandler.handleServerPing(this);
038    }
039
040    /**
041     * Abstract. Return the size of the packet (not counting the header).
042     */
043    public int getPacketSize()
044    {
045        return 0;
046    }
047}