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 Packet25EntityPainting extends Packet
008 {
009 public int entityId;
010 public int xPosition;
011 public int yPosition;
012 public int zPosition;
013 public int direction;
014 public String title;
015
016 public Packet25EntityPainting() {}
017
018 public Packet25EntityPainting(EntityPainting par1EntityPainting)
019 {
020 this.entityId = par1EntityPainting.entityId;
021 this.xPosition = par1EntityPainting.xPosition;
022 this.yPosition = par1EntityPainting.yPosition;
023 this.zPosition = par1EntityPainting.zPosition;
024 this.direction = par1EntityPainting.field_82332_a;
025 this.title = par1EntityPainting.art.title;
026 }
027
028 /**
029 * Abstract. Reads the raw packet data from the data stream.
030 */
031 public void readPacketData(DataInputStream par1DataInputStream) throws IOException
032 {
033 this.entityId = par1DataInputStream.readInt();
034 this.title = readString(par1DataInputStream, EnumArt.maxArtTitleLength);
035 this.xPosition = par1DataInputStream.readInt();
036 this.yPosition = par1DataInputStream.readInt();
037 this.zPosition = par1DataInputStream.readInt();
038 this.direction = par1DataInputStream.readInt();
039 }
040
041 /**
042 * Abstract. Writes the raw packet data to the data stream.
043 */
044 public void writePacketData(DataOutputStream par1DataOutputStream) throws IOException
045 {
046 par1DataOutputStream.writeInt(this.entityId);
047 writeString(this.title, par1DataOutputStream);
048 par1DataOutputStream.writeInt(this.xPosition);
049 par1DataOutputStream.writeInt(this.yPosition);
050 par1DataOutputStream.writeInt(this.zPosition);
051 par1DataOutputStream.writeInt(this.direction);
052 }
053
054 /**
055 * Passes this Packet on to the NetHandler for processing.
056 */
057 public void processPacket(NetHandler par1NetHandler)
058 {
059 par1NetHandler.handleEntityPainting(this);
060 }
061
062 /**
063 * Abstract. Return the size of the packet (not counting the header).
064 */
065 public int getPacketSize()
066 {
067 return 24;
068 }
069 }