001    package net.minecraft.network.packet;
002    
003    import java.io.DataInputStream;
004    import java.io.DataOutputStream;
005    import java.io.IOException;
006    
007    public class Packet38EntityStatus extends Packet
008    {
009        public int entityId;
010    
011        /** 2 for hurt, 3 for dead */
012        public byte entityStatus;
013    
014        public Packet38EntityStatus() {}
015    
016        public Packet38EntityStatus(int par1, byte par2)
017        {
018            this.entityId = par1;
019            this.entityStatus = par2;
020        }
021    
022        /**
023         * Abstract. Reads the raw packet data from the data stream.
024         */
025        public void readPacketData(DataInputStream par1DataInputStream) throws IOException
026        {
027            this.entityId = par1DataInputStream.readInt();
028            this.entityStatus = par1DataInputStream.readByte();
029        }
030    
031        /**
032         * Abstract. Writes the raw packet data to the data stream.
033         */
034        public void writePacketData(DataOutputStream par1DataOutputStream) throws IOException
035        {
036            par1DataOutputStream.writeInt(this.entityId);
037            par1DataOutputStream.writeByte(this.entityStatus);
038        }
039    
040        /**
041         * Passes this Packet on to the NetHandler for processing.
042         */
043        public void processPacket(NetHandler par1NetHandler)
044        {
045            par1NetHandler.handleEntityStatus(this);
046        }
047    
048        /**
049         * Abstract. Return the size of the packet (not counting the header).
050         */
051        public int getPacketSize()
052        {
053            return 5;
054        }
055    }