-
-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ping.setFavicon(WrappedServerPing.CompressedImage image) wont show favicon on 1.19-1.20.1 servers. #2511
Comments
Please, respond to topic. If you need any additional information, I am open to provide it by your request. I understand you may have a lot of work. However, your help is required and is strongly appreciated. |
@lukalt, hello! As far as I understand you are one of people who provide help with ProtocolLib. Currently, I am facing a problem, described above. However, I am afraid my issue could be missed since I got no replies for more than a week. This is the reason I am tagging you. If it's not a part of your responsibility to comment on this issue, passing it to right people would be higly appreciated by me. I am sorry if I am mistaken with the fact you can provide help. |
Hi, sorry, that no one responded so far. I am not part of the ProtocolLib team but I can help you anyways. |
I already have this code
Favicon is set like so:
But this does not work sadly :( |
Please, respond whether you are trying to solve my problem or there is something else I can do or if I should contact another people (mentioning whom is appreciated). Mentioned issue #2354 does describe the same problem. |
I currently do not have time to deeply investigate this. But please have a look at your Minecraft Client's Log file in der %appdata%/.minecraft folder and check if there are any errors |
I have this error:
This does not appear when tested, for example, with 1.18.2 server. |
Okay, could you please share the base64 you are setting as the favicon? |
Sure, here it is:
|
@dmulloy2, hello! I am sorry to interruprt you. However, the solution to my problem has been taking a long time, no progress is visible, so it apparently requires your participation. I understand that we can all be busy. Since lukalt is currently unable to assist me, I am attempting to contact you. Please, see above. If you need any additional information, I am always open to provide it. |
|
Why are you using ProtocolLib for this? The ServerListPingEvent from Bukkit should meet your needs You would just need something like so: /**
* Not set until needed, images are expensive!
*/
private static CachedServerIcon icon;
@EventHandler
public final void onServerPing(final ServerListPingEvent event) {
if (image == null) {
try {
icon = Bukkit.getServer().loadServerIcon(ImageIO.read(new ByteArrayInputStream(Base64.getDecoder().decode("YOUR_BASE_64_GOES_HERE"))));
} catch (IOException e) {
return; // failed to parse the base64
}
}
event.setServerIcon(icon);
} |
@BradBot1, Thank you for responding! This will not help me since I need an option to specify concrete icons to be displayed in pair with concrete motd.
Setting motd in event together with server icon will not help either since I need to set hover box and version motd with this motd together as well (and these stuff cannot be set via event, so I will still need to use ProtocolLib). I do not know whether Bukkit or ProtocolLib event will be called first. Even if I do there will be a problem of passing data (which motd configuration file was chosen) from one event to another one. |
Could you not just use the Bukkit implementation only for the favicons for now? This way you get what you want while this gets resolved? |
I will have to abandon the feature described above. Lukalt also pointed me to an issue page describing same problem #2354 opened about 5 months ago that still was not solved. This is why I will be glad if you could take a look at it now. |
Before I continue I want to make clear that ProtocolLib is an open source project. It is based on work done by people during their free time. So you cannot expect an enterprise grade support here... |
Having not received a response from you for a long time, a fear occured that you might have forgotten about my problem. Regardless of the misunderstanding that arose between us, I express my gratitude to you for your help. Fix solves the problem I described. I truly appreciate the work you do and the time you spend to make ProtocolLib better, knowing that you generally don't have to spend it. |
Okay, thank you for the confirmation. I will open a pull request for this problem so it will be available in the next release of ProtocolLib |
Describe the bug
Calling setFavicon method from WrappedServerPing class has no affect in changing server motd favicon.
Base64 string of favicon is generated here in getRandomFavicon method:
https://github.com/NamerPRO/AdvancedNMotd/blob/main/src/ru/namerpro/AdvancedNMotd/Templates/PluginMotdTemplate.java
Usage of setFavicon method could be found here:
https://github.com/NamerPRO/AdvancedNMotd/blob/main/src/ru/namerpro/AdvancedNMotd/Bukkit/ProtocolLibMotd.java
(line: ((WrappedServerPing) motdPingInstance).setFavicon(WrappedServerPing.CompressedImage.fromBase64Png(base64Favicon));)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Expected to see displaying favicon in motd.
Screenshots

1.18.2:
1.20.1:

Version Info
https://pastebin.com/9kbt6tGb
Additional context
Thank you for the great work you had done developing ProtocolLIB.
The text was updated successfully, but these errors were encountered: