Closed wMarciano closed 4 months ago
Join screen is impossible but chat, tab list or server motd could be But i think only on chat link is clickable, or mojang removed it?
Chat probably makes the most sense then, links are clickable with a simple tellraw like this:
tellraw @s ["Hey, you're unmodded! Click this ",{"text":"link","clickEvent":{"action":"open_url","value":"https://github.com/Skidamek/AutoModpack-Installer/releases/download/Latest/automodpack-fabric-installer-0.11.2.jar"}}," to get a the one-click installer."]
So then the "nagMessage" config variable could take in the part in brackets, and the mod simply would run tellraw unmoddedPlayer [nagMessage]
Hey, I ended up implementing it alongside 1.21 fabric compatibility in a fork... I'd submit a PR but the 1.21 changes break the older versions (probably a way around this, i just didn't quite understand your multi-version setup), so I only targeted 1.21-fabric. There also is probably a better event to tie the chat message to (I'm not very knowledgable in that department)...I just have it sent 10 seconds after the automodpack handshake occurs for my own ease of implementation.
Thanks I've seen, its helpful, you actually motivated to work on it. I am getting to it, hopefully in next few days you can expect official beta 2 with 1.21, 1.20.6, 1.20.4, fixes and custom message :)
Ok, I've implemented it my way see the default text and link are different than proposed, can you check it and leave feedback? Pull request with some better ideas are appreciated as well! And i set it enabled by default because i though its maybe better when its shown only to non automodpack players anyway...
Looks great! If you're still at your desk, a good QOL feature would be allowing the user to customize the link (for example, to link directly to the bundled fabric installer, a specific version, etc.)
In Jsons.java:
public String nagLink= "https://modrinth.com/project/automodpack"; // leave blank for no link
and in PlayerManagerMixin.java:
if (serverConfig.nagLink.isEmpty()) {
Text nagText = VersionedText.literal(serverConfig.nagMessage);
} else {
Text nagText = VersionedText.literal(serverConfig.nagMessage).styled(style -> style.withClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, serverConfig.nagLink)));
}
If not, I can PR this. Otherwise, great work! Thanks for being receptive.
Do you think its intuitive that you can click into this message? Because it just look like normal blank message its something i am concerned about. And you can make PR sure, currently i am not available.
Hmm... as long as the message makes it clear, it shouldn't be a big deal. You could switch to tellraw and leave it up to the user to format the link:
server.getCommandManager().executeWithPrefix(server.getCommandSource(), "tellraw " + playerName + " [\"" + serverConfig.nagMessage + "\"]");
which should support any tellraw formatting as long as all internal "
are escaped:
nagMessage = "This server provides a dedicated modpack through AutoModpack!\",{\"text\":\"Check it out\",\"underlined\":true,\"color\":\"yellow\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://github.com/Skidamek/AutoModpack\"}},\"!"
But that's not super intuitive. Honestly you can probably just leave it as is, or give the nag message an underline/color.
Ok, see https://github.com/Skidamek/AutoModpack/commit/f48df6b4d8706b0e80b0a919f880e11be30c90d1 By default it should look like this
Solid! Well solved!
Motivation
Firstly, I love this mod, and thank you for being considerate of un-modded players with the '
requireAutoModpackOnClient
' config option!That said, it would be awesome to be able to let un-modded players know that they are missing out on the full experience.
Description
Ideally, this would be exposed in server config with some simple settings like:
And presented on either the server join screen (if possible) or in the chat.
Other information
No response