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 Packet17Sleep extends Packet 008 { 009 public int entityID; 010 public int bedX; 011 public int bedY; 012 public int bedZ; 013 public int field_73622_e; 014 015 public Packet17Sleep() {} 016 017 public Packet17Sleep(Entity par1Entity, int par2, int par3, int par4, int par5) 018 { 019 this.field_73622_e = par2; 020 this.bedX = par3; 021 this.bedY = par4; 022 this.bedZ = par5; 023 this.entityID = par1Entity.entityId; 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.entityID = par1DataInputStream.readInt(); 032 this.field_73622_e = par1DataInputStream.readByte(); 033 this.bedX = par1DataInputStream.readInt(); 034 this.bedY = par1DataInputStream.readByte(); 035 this.bedZ = 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.entityID); 044 par1DataOutputStream.writeByte(this.field_73622_e); 045 par1DataOutputStream.writeInt(this.bedX); 046 par1DataOutputStream.writeByte(this.bedY); 047 par1DataOutputStream.writeInt(this.bedZ); 048 } 049 050 /** 051 * Passes this Packet on to the NetHandler for processing. 052 */ 053 public void processPacket(NetHandler par1NetHandler) 054 { 055 par1NetHandler.handleSleep(this); 056 } 057 058 /** 059 * Abstract. Return the size of the packet (not counting the header). 060 */ 061 public int getPacketSize() 062 { 063 return 14; 064 } 065 }