[Feature Request] Add client branding for OptiFine
I'm creating currently a server resource pack that's using some features from Optifine and I somehow need to verify if the client has Optifine installed or not. Some Mods do send a plugin message/packet to the server during the login process but I couldn't figure out if Optifine does something similar?
Is there a way to check/verify on the server side (spigot/bukkit) if the client has Optifine installed? If not, is there any chance that something like that gets added?
If optifine is installed directly, the client brand (sent via the channel "MC|Brand") is changed to "optifine", so that could be detected on the server. If optifine is installed via forge "MC|Brand" is set to "fml/forge", so you can't detect optifine directly. But since forge informs the server which mods are installed on the client (ModList-Message on Channel "FML|HS"), it might be possible to request that from the client. Besides that, I'm not sure why it could be necessary to know if the client has optifine installed.
Because I plan to add custom GUI textures, item models and Icons to my GUIs based on NBT tags/item displayname/lore in my resource pack that works with my custom plugins, and that requires optifine and would kinda look strange/odd without the texture pack/cit feature. I was looking for a way to force players to install optifine and/or reward those who use the server texturepack + optifine.
Edit: @SetantaLP
I've tested it. The client brand remains "vanilla" even with optifine installed. Tested with optifine for 1.12 and the 1.13 alpha version. This is the debug output I've received when listening on the "minecraft:brand" channel:
[02:42:05 INFO]: Received on channel: minecraft:brand
[02:42:05 INFO]: Debug output: vanilla
This would be useful for my plugin SkyChanger. It works optimally when users have optifine installed (to block rain particles). I could potentially add an option to disable the effects for users without optifine.
Because I plan to add custom GUI textures, item models and Icons to my GUIs based on NBT tags/item displayname/lore in my resource pack that works with my custom plugins, and that requires optifine and would kinda look strange/odd without the texture pack/cit feature. I was looking for a way to force players to install optifine and/or reward those who use the server texturepack + optifine.
Edit: @SetantaLP
I've tested it. The client brand remains "vanilla" even with optifine installed. Tested with optifine for 1.12 and the 1.13 alpha version. This is the debug output I've received when listening on the "minecraft:brand" channel:
[02:42:05 INFO]: Received on channel: minecraft:brand [02:42:05 INFO]: Debug output: vanilla
Tried the same thing in 1.15.2. Still not getting the desired output.
If this theme is actual. I found something. https://github.com/Mas281/ForgeModBlocker/blob/master/src/main/java/me/itsmas/forgemodblocker/messaging/JoinListener.java
@ifxory-plugins Optifine does not announce itself to the server like forge client does.
Would be amazing to have this added!!
That would be amazing.
Any progress on this? It would be very helpful for plugin developers!
This would really help!
Bumped, please add something like this!
agreed, more developers are trying to make modless servers (think origin realms), and Optifine adds so many useful options. For me, it would be awesome to serve a specific texture pack to a client that has or doesn't have optifine. I know this might be a lot of work, but it would greatly help the community!
The easiest way to implement this would be to just change MC|Brand to “optifine”, and the rest could be implemented with plugins using NMS or ProtocolLib.
What I was thinking (and wouldn’t mess with any mod loader) would be a packet sent by optifine that would just say the version it’s running
So the best solution would be to send the OF version in the “OF|Version” channel, this would not mess with mod loaders and other plugins, and this wouldn’t get you false banned (as custom/invalid packets can get you banned by some anticheats)
This is a very good Feature. It would be cool to have it in 1.20
A technical explanation of the request (somewhat adapted from #5300) would be to change the brand value for OptiFine standalone installs to optifine or something of the sort, in order for developers to differentiate between OF and Vanilla users.
Correct, but Plugin Messaging would still be possible when using OF in mod loaders, and just sending the current OF version in optifine:version could make for an easy way to differentiate users in a server-side plugin/mod.
Edit: To clarify, changing the brand to OF would only work for standalone installs.
Changed client branding to "optifine". Coming in pre8.
@sp614x How would this work when using OptiFine with a mod loader? The mod loader usually changes this to the name of the ML, sending a “custom” packet (don’t make your own, use MCs packet named “custom” something) on a channel specifically dedicated for OptiFine would be better imo as that works both with and without a mod loader.
Edit: See my previous comment:
Correct, but Plugin Messaging would still be possible when using OF in mod loaders, and just sending the current OF version in
optifine:versioncould make for an easy way to differentiate users in a server-side plugin/mod. Edit: To clarify, changing the brand to OF would only work for standalone installs.
@sp614x bumped
@sp614xbumped
There's no need to bump this. This feature is in I5 pre8 and newer.
@Ari-RERA-43 wrong, read my last comment before I bumped this thread
@Ari-RERA-43 wrong, read my last comment before I bumped this thread
Apologies, GitHub had it hidden automatically.
Do you know if this is working?
Reopening for the previous conversation