File tree Expand file tree Collapse file tree 4 files changed +15
-13
lines changed
src/main/java/com/comphenix/protocol/wrappers Expand file tree Collapse file tree 4 files changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -134,16 +134,15 @@ public void setMotD(String message) {
134
134
* @return The favicon, or NULL if no favicon will be displayed.
135
135
*/
136
136
public CompressedImage getFavicon () {
137
- String favicon = impl .getFavicon ();
138
- return (favicon != null ) ? CompressedImage .fromEncodedText (favicon ) : null ;
137
+ return impl .getFavicon ();
139
138
}
140
139
141
140
/**
142
141
* Set the compressed PNG file that is being displayed.
143
142
* @param image - the new compressed image or NULL if no favicon should be displayed.
144
143
*/
145
144
public void setFavicon (CompressedImage image ) {
146
- impl .setFavicon (( image != null ) ? image . toEncodedText () : null );
145
+ impl .setFavicon (image );
147
146
}
148
147
149
148
/**
Original file line number Diff line number Diff line change @@ -155,17 +155,19 @@ public void setMotD(WrappedChatComponent description) {
155
155
* @return The favicon, or NULL if no favicon will be displayed.
156
156
*/
157
157
@ Override
158
- public String getFavicon () {
159
- return (String ) FAVICON .get (handle );
158
+ public WrappedServerPing .CompressedImage getFavicon () {
159
+
160
+ String favicon = (String ) FAVICON .get (handle );
161
+ return (favicon != null ) ? WrappedServerPing .CompressedImage .fromEncodedText (favicon ) : null ;
160
162
}
161
163
162
164
/**
163
165
* Set the compressed PNG file that is being displayed.
164
166
* @param image - the new compressed image or NULL if no favicon should be displayed.
165
167
*/
166
168
@ Override
167
- public void setFavicon (String image ) {
168
- FAVICON .set (handle , image );
169
+ public void setFavicon (WrappedServerPing . CompressedImage image ) {
170
+ FAVICON .set (handle , ( image != null ) ? image . toEncodedText () : null );
169
171
}
170
172
171
173
/**
Original file line number Diff line number Diff line change 2
2
3
3
import com .comphenix .protocol .wrappers .WrappedChatComponent ;
4
4
import com .comphenix .protocol .wrappers .WrappedGameProfile ;
5
+ import com .comphenix .protocol .wrappers .WrappedServerPing ;
5
6
import com .google .common .collect .ImmutableList ;
6
7
7
8
public interface ServerPingImpl extends Cloneable {
@@ -17,8 +18,8 @@ public interface ServerPingImpl extends Cloneable {
17
18
void setVersionName (String versionName );
18
19
int getVersionProtocol ();
19
20
void setVersionProtocol (int protocolVersion );
20
- String getFavicon ();
21
- void setFavicon (String favicon );
21
+ WrappedServerPing . CompressedImage getFavicon ();
22
+ void setFavicon (WrappedServerPing . CompressedImage favicon );
22
23
boolean isEnforceSecureChat ();
23
24
void setEnforceSecureChat (boolean safeChat );
24
25
Original file line number Diff line number Diff line change @@ -273,13 +273,13 @@ public void setVersionProtocol(int protocolVersion) {
273
273
}
274
274
275
275
@ Override
276
- public String getFavicon () {
277
- return new String ( favicon . iconBytes , StandardCharsets . UTF_8 );
276
+ public WrappedServerPing . CompressedImage getFavicon () {
277
+ return new WrappedServerPing . CompressedImage ( "data:image/png;base64" , favicon . iconBytes );
278
278
}
279
279
280
280
@ Override
281
- public void setFavicon (String favicon ) {
282
- this .favicon .iconBytes = favicon .getBytes ( StandardCharsets . UTF_8 );
281
+ public void setFavicon (WrappedServerPing . CompressedImage favicon ) {
282
+ this .favicon .iconBytes = favicon .getDataCopy ( );
283
283
}
284
284
285
285
@ Override
You can’t perform that action at this time.
0 commit comments