optifine icon indicating copy to clipboard operation
optifine copied to clipboard

[Feature Request] Add client branding for OptiFine

Open crysis992 opened this issue 7 years ago • 26 comments

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?

crysis992 avatar Aug 11 '18 18:08 crysis992

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.

SetantaLP avatar Aug 11 '18 21:08 SetantaLP

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

crysis992 avatar Aug 11 '18 21:08 crysis992

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.

dscalzi avatar Aug 12 '18 09:08 dscalzi

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.

JayReturns avatar May 14 '20 20:05 JayReturns

If this theme is actual. I found something. https://github.com/Mas281/ForgeModBlocker/blob/master/src/main/java/me/itsmas/forgemodblocker/messaging/JoinListener.java

klochk avatar Feb 28 '21 13:02 klochk

@ifxory-plugins Optifine does not announce itself to the server like forge client does.

mk7a avatar Mar 02 '21 19:03 mk7a

Would be amazing to have this added!!

iGabyTM avatar Mar 11 '21 14:03 iGabyTM

That would be amazing.

jashscript avatar Apr 01 '21 04:04 jashscript

Any progress on this? It would be very helpful for plugin developers!

grahhnt avatar Oct 07 '21 23:10 grahhnt

This would really help!

ace0nion avatar Dec 28 '21 02:12 ace0nion

Bumped, please add something like this!

yolocat-dev avatar Sep 25 '22 08:09 yolocat-dev

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!

TravisC671 avatar Oct 27 '22 04:10 TravisC671

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.

yolocat-dev avatar Oct 27 '22 06:10 yolocat-dev

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

grahhnt avatar Oct 27 '22 16:10 grahhnt

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)

yolocat-dev avatar Oct 27 '22 16:10 yolocat-dev

This is a very good Feature. It would be cool to have it in 1.20

PlayerSchark avatar Feb 08 '23 00:02 PlayerSchark

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.

ZenIsBestWolf avatar Apr 25 '23 01:04 ZenIsBestWolf

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.

yolocat-dev avatar Apr 25 '23 06:04 yolocat-dev

Changed client branding to "optifine". Coming in pre8.

sp614x avatar Jun 30 '23 14:06 sp614x

@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: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.

yolocat-dev avatar Jun 30 '23 14:06 yolocat-dev

@sp614x bumped

yolocat-dev avatar Oct 12 '23 08:10 yolocat-dev

@sp614x bumped

There's no need to bump this. This feature is in I5 pre8 and newer.

Ari-43 avatar Oct 12 '23 11:10 Ari-43

@Ari-RERA-43 wrong, read my last comment before I bumped this thread

yolocat-dev avatar Oct 12 '23 20:10 yolocat-dev

@Ari-RERA-43 wrong, read my last comment before I bumped this thread

Apologies, GitHub had it hidden automatically.

Ari-43 avatar Oct 12 '23 20:10 Ari-43

Do you know if this is working?

AstralBaby avatar May 25 '24 15:05 AstralBaby

Reopening for the previous conversation

Jiingy avatar May 27 '24 16:05 Jiingy