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 Packet61DoorChange extends Packet
008    {
009        public int sfxID;
010        public int auxData;
011        public int posX;
012        public int posY;
013        public int posZ;
014    
015        public Packet61DoorChange() {}
016    
017        public Packet61DoorChange(int par1, int par2, int par3, int par4, int par5)
018        {
019            this.sfxID = par1;
020            this.posX = par2;
021            this.posY = par3;
022            this.posZ = par4;
023            this.auxData = par5;
024        }
025    
026        /**
027         * Abstract. Reads the raw packet data from the data stream.
028         */
029        public void readPacketData(DataInputStream par1DataInputStream) throws IOException
030        {
031            this.sfxID = par1DataInputStream.readInt();
032            this.posX = par1DataInputStream.readInt();
033            this.posY = par1DataInputStream.readByte() & 255;
034            this.posZ = par1DataInputStream.readInt();
035            this.auxData = par1DataInputStream.readInt();
036        }
037    
038        /**
039         * Abstract. Writes the raw packet data to the data stream.
040         */
041        public void writePacketData(DataOutputStream par1DataOutputStream) throws IOException
042        {
043            par1DataOutputStream.writeInt(this.sfxID);
044            par1DataOutputStream.writeInt(this.posX);
045            par1DataOutputStream.writeByte(this.posY & 255);
046            par1DataOutputStream.writeInt(this.posZ);
047            par1DataOutputStream.writeInt(this.auxData);
048        }
049    
050        /**
051         * Passes this Packet on to the NetHandler for processing.
052         */
053        public void processPacket(NetHandler par1NetHandler)
054        {
055            par1NetHandler.handleDoorChange(this);
056        }
057    
058        /**
059         * Abstract. Return the size of the packet (not counting the header).
060         */
061        public int getPacketSize()
062        {
063            return 20;
064        }
065    }