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