@@ -39,7 +39,6 @@ public MinecraftServer(String host,int port)throws Exception {
3939 try {
4040 response = new Gson ().fromJson (new PacketRecv (dataInputStream ).popString (), Response .class );
4141 }catch (EOFException e ){//To change protocol.
42- System .out .println ("ChangeProtocol" );
4342 socket =new Socket (host ,port );
4443 dataInputStream =new DataInputStream (socket .getInputStream ());
4544 dataOutputStream =new DataOutputStream (socket .getOutputStream ());
@@ -56,7 +55,6 @@ public MinecraftServer(String host,int port)throws Exception {
5655 ByteBase bbase =new ByteBase (b );
5756 byte [] end =new byte []{0 ,0 };
5857 if (new String (bbase .pop (end ),StandardCharsets .UTF_16BE ).equals ("§1" )){
59- System .out .println ("packingResponse." );
6058 response =new Response ();
6159 response .version =new Response .version ();
6260 response .version .protocol =Integer .parseInt
@@ -77,24 +75,11 @@ private short len(String l){
7775 String utf16be =new String (l .getBytes (StandardCharsets .UTF_8 ),StandardCharsets .UTF_16BE );
7876 return (short )utf16be .length ();
7977 }
80- private void listByte (byte [] bytes ){
81- System .out .print ("list:" );
82- for (byte b :bytes ){
83- System .out .print (b +" " );
84- }
85- System .out .println ();
86- }
8778 private class ByteBase {
8879 byte [] arr ;
8980 int index =0 ;
9081 ByteBase (byte [] byteArr ){
9182 this .arr =byteArr ;
92- for (byte b :byteArr ){
93- System .out .print (b +" " );
94- }
95- System .out .println ();
96- String s =new String (arr ,StandardCharsets .UTF_16BE );
97- System .out .println (s );
9883 }
9984 public byte [] pop (byte [] end ){
10085 ArrayList <Byte > byteArrayList =new ArrayList <>();
@@ -112,7 +97,6 @@ public byte[] pop(byte[] end){
11297 for (int i =0 ;i <len ;i ++){
11398 result [i ]=byteArrayList .get (i );
11499 }
115- listByte (result );
116100 return result ;
117101 }
118102 public byte pop (){
0 commit comments