@@ -48,7 +48,7 @@ public MOTDBytesHolder(ComponentSerializer<Component, Component, String> inputSe
48
48
this .inputSerializer = inputSerializer ;
49
49
ServerPing .Builder compatServerPingBuilder = ServerPing .builder ();
50
50
51
- StringBuilder motd = new StringBuilder ("{\" players\" :{\" max\" : 0,\" online\" : 1,\" sample\" :[" );
51
+ StringBuilder motd = new StringBuilder ("{\" players\" :{\" max\" : 0,\" online\" : 1,\" sample\" :[" );
52
52
53
53
compatServerPingBuilder .maximumPlayers (0 );
54
54
compatServerPingBuilder .onlinePlayers (1 );
@@ -98,8 +98,8 @@ public MOTDBytesHolder(ComponentSerializer<Component, Component, String> inputSe
98
98
int lengthOfLength = ProtocolUtils .varIntBytes (length );
99
99
varIntLength += lengthOfLength ;
100
100
101
- this .maxOnlineDigit = Bytes .indexOf (bytes , " 0" .getBytes (StandardCharsets .UTF_8 )) + 1 + varIntLength ;
102
- this .onlineDigit = Bytes .indexOf (bytes , " 1" .getBytes (StandardCharsets .UTF_8 )) + 1 + varIntLength ;
101
+ this .maxOnlineDigit = Bytes .indexOf (bytes , " 0" .getBytes (StandardCharsets .UTF_8 )) + 1 + varIntLength ;
102
+ this .onlineDigit = Bytes .indexOf (bytes , " 1" .getBytes (StandardCharsets .UTF_8 )) + 1 + varIntLength ;
103
103
this .protocolDigit = Bytes .indexOf (bytes , "protocol\" : 1}" .getBytes (StandardCharsets .UTF_8 )) + 19 + varIntLength ;
104
104
105
105
this .byteBuf = Unpooled .directBuffer (length + lengthOfLength );
@@ -127,11 +127,14 @@ public void replaceOnline(int max, int online) {
127
127
}
128
128
129
129
private void localReplaceOnline (int digit , int to ) {
130
- this .byteBuf .setByte (digit , to >= 10000 ? (to / 10000 % 10 ) + '0' : ' ' );
131
- this .byteBuf .setByte (digit + 1 , to >= 1000 ? (to / 1000 % 10 ) + '0' : ' ' );
132
- this .byteBuf .setByte (digit + 2 , to >= 100 ? (to / 100 % 10 ) + '0' : ' ' );
133
- this .byteBuf .setByte (digit + 3 , to >= 10 ? (to / 10 % 10 ) + '0' : ' ' );
134
- this .byteBuf .setByte (digit + 4 , (to % 10 ) + '0' );
130
+ this .byteBuf .setByte (digit + 0 , to >= 10000000 ? (to / 10000000 % 10 ) + '0' : ' ' );
131
+ this .byteBuf .setByte (digit + 1 , to >= 1000000 ? (to / 1000000 % 10 ) + '0' : ' ' );
132
+ this .byteBuf .setByte (digit + 2 , to >= 100000 ? (to / 100000 % 10 ) + '0' : ' ' );
133
+ this .byteBuf .setByte (digit + 3 , to >= 10000 ? (to / 10000 % 10 ) + '0' : ' ' );
134
+ this .byteBuf .setByte (digit + 4 , to >= 1000 ? (to / 1000 % 10 ) + '0' : ' ' );
135
+ this .byteBuf .setByte (digit + 5 , to >= 100 ? (to / 100 % 10 ) + '0' : ' ' );
136
+ this .byteBuf .setByte (digit + 6 , to >= 10 ? (to / 10 % 10 ) + '0' : ' ' );
137
+ this .byteBuf .setByte (digit + 7 , (to % 10 ) + '0' );
135
138
}
136
139
137
140
public ServerPing getCompatPingInfo (ProtocolVersion version , boolean replaceProtocol ) {
0 commit comments