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 Packet22Collect extends Packet
008 {
009 /** The entity on the ground that was picked up. */
010 public int collectedEntityId;
011
012 /** The entity that picked up the one from the ground. */
013 public int collectorEntityId;
014
015 public Packet22Collect() {}
016
017 public Packet22Collect(int par1, int par2)
018 {
019 this.collectedEntityId = par1;
020 this.collectorEntityId = par2;
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.collectedEntityId = par1DataInputStream.readInt();
029 this.collectorEntityId = par1DataInputStream.readInt();
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.collectedEntityId);
038 par1DataOutputStream.writeInt(this.collectorEntityId);
039 }
040
041 /**
042 * Passes this Packet on to the NetHandler for processing.
043 */
044 public void processPacket(NetHandler par1NetHandler)
045 {
046 par1NetHandler.handleCollect(this);
047 }
048
049 /**
050 * Abstract. Return the size of the packet (not counting the header).
051 */
052 public int getPacketSize()
053 {
054 return 8;
055 }
056 }