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 Packet6SpawnPosition extends Packet 008 { 009 /** X coordinate of spawn. */ 010 public int xPosition; 011 012 /** Y coordinate of spawn. */ 013 public int yPosition; 014 015 /** Z coordinate of spawn. */ 016 public int zPosition; 017 018 public Packet6SpawnPosition() {} 019 020 public Packet6SpawnPosition(int par1, int par2, int par3) 021 { 022 this.xPosition = par1; 023 this.yPosition = par2; 024 this.zPosition = par3; 025 } 026 027 /** 028 * Abstract. Reads the raw packet data from the data stream. 029 */ 030 public void readPacketData(DataInputStream par1DataInputStream) throws IOException 031 { 032 this.xPosition = par1DataInputStream.readInt(); 033 this.yPosition = par1DataInputStream.readInt(); 034 this.zPosition = par1DataInputStream.readInt(); 035 } 036 037 /** 038 * Abstract. Writes the raw packet data to the data stream. 039 */ 040 public void writePacketData(DataOutputStream par1DataOutputStream) throws IOException 041 { 042 par1DataOutputStream.writeInt(this.xPosition); 043 par1DataOutputStream.writeInt(this.yPosition); 044 par1DataOutputStream.writeInt(this.zPosition); 045 } 046 047 /** 048 * Passes this Packet on to the NetHandler for processing. 049 */ 050 public void processPacket(NetHandler par1NetHandler) 051 { 052 par1NetHandler.handleSpawnPosition(this); 053 } 054 055 /** 056 * Abstract. Return the size of the packet (not counting the header). 057 */ 058 public int getPacketSize() 059 { 060 return 12; 061 } 062 063 /** 064 * only false for the abstract Packet class, all real packets return true 065 */ 066 public boolean isRealPacket() 067 { 068 return true; 069 } 070 071 /** 072 * eg return packet30entity.entityId == entityId; WARNING : will throw if you compare a packet to a different packet 073 * class 074 */ 075 public boolean containsSameEntityIDAs(Packet par1Packet) 076 { 077 return true; 078 } 079 080 /** 081 * If this returns true, the packet may be processed on any thread; otherwise it is queued for the main thread to 082 * handle. 083 */ 084 public boolean canProcessAsync() 085 { 086 return false; 087 } 088 }