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 Packet200Statistic extends Packet 008 { 009 public int statisticId; 010 public int amount; 011 012 public Packet200Statistic() {} 013 014 public Packet200Statistic(int par1, int par2) 015 { 016 this.statisticId = par1; 017 this.amount = par2; 018 } 019 020 /** 021 * Passes this Packet on to the NetHandler for processing. 022 */ 023 public void processPacket(NetHandler par1NetHandler) 024 { 025 par1NetHandler.handleStatistic(this); 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.statisticId = par1DataInputStream.readInt(); 034 this.amount = par1DataInputStream.readByte(); 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.statisticId); 043 par1DataOutputStream.writeByte(this.amount); 044 } 045 046 /** 047 * Abstract. Return the size of the packet (not counting the header). 048 */ 049 public int getPacketSize() 050 { 051 return 6; 052 } 053 054 /** 055 * If this returns true, the packet may be processed on any thread; otherwise it is queued for the main thread to 056 * handle. 057 */ 058 public boolean canProcessAsync() 059 { 060 return true; 061 } 062 }