001package net.minecraft.network.packet; 002 003import java.io.DataInputStream; 004import java.io.DataOutputStream; 005import java.io.IOException; 006import net.minecraft.scoreboard.ScoreObjective; 007 008public class Packet208SetDisplayObjective extends Packet 009{ 010 public int field_96481_a; 011 public String field_96480_b; 012 013 public Packet208SetDisplayObjective() {} 014 015 public Packet208SetDisplayObjective(int par1, ScoreObjective par2ScoreObjective) 016 { 017 this.field_96481_a = par1; 018 019 if (par2ScoreObjective == null) 020 { 021 this.field_96480_b = ""; 022 } 023 else 024 { 025 this.field_96480_b = par2ScoreObjective.func_96679_b(); 026 } 027 } 028 029 /** 030 * Abstract. Reads the raw packet data from the data stream. 031 */ 032 public void readPacketData(DataInputStream par1DataInputStream) throws IOException 033 { 034 this.field_96481_a = par1DataInputStream.readByte(); 035 this.field_96480_b = readString(par1DataInputStream, 16); 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.writeByte(this.field_96481_a); 044 writeString(this.field_96480_b, par1DataOutputStream); 045 } 046 047 /** 048 * Passes this Packet on to the NetHandler for processing. 049 */ 050 public void processPacket(NetHandler par1NetHandler) 051 { 052 par1NetHandler.func_96438_a(this); 053 } 054 055 /** 056 * Abstract. Return the size of the packet (not counting the header). 057 */ 058 public int getPacketSize() 059 { 060 return 3 + this.field_96480_b.length(); 061 } 062}