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 Packet31RelEntityMove extends Packet30Entity
008 {
009 public Packet31RelEntityMove() {}
010
011 public Packet31RelEntityMove(int par1, byte par2, byte par3, byte par4)
012 {
013 super(par1);
014 this.xPosition = par2;
015 this.yPosition = par3;
016 this.zPosition = par4;
017 }
018
019 /**
020 * Abstract. Reads the raw packet data from the data stream.
021 */
022 public void readPacketData(DataInputStream par1DataInputStream) throws IOException
023 {
024 super.readPacketData(par1DataInputStream);
025 this.xPosition = par1DataInputStream.readByte();
026 this.yPosition = par1DataInputStream.readByte();
027 this.zPosition = par1DataInputStream.readByte();
028 }
029
030 /**
031 * Abstract. Writes the raw packet data to the data stream.
032 */
033 public void writePacketData(DataOutputStream par1DataOutputStream) throws IOException
034 {
035 super.writePacketData(par1DataOutputStream);
036 par1DataOutputStream.writeByte(this.xPosition);
037 par1DataOutputStream.writeByte(this.yPosition);
038 par1DataOutputStream.writeByte(this.zPosition);
039 }
040
041 /**
042 * Abstract. Return the size of the packet (not counting the header).
043 */
044 public int getPacketSize()
045 {
046 return 7;
047 }
048 }