Skip to content
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

Fix message sending on legacy versions #5106

Merged

Conversation

APickledWalrus
Copy link
Member

Description

Title

It looks like players support advanced formatting. I tested on 1.9.4.
This fix is achieved by using the exact same logic as EffMessage.


Target Minecraft Versions: 1.12 and below
Requirements: N/A
Related Issues:

@APickledWalrus APickledWalrus added bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. 2.6 labels Sep 18, 2022
receivers.addAll(world.getPlayers());
}

for (Expression<?> message : getMessages()) {
if (message instanceof VariableString) {
BaseComponent[] components = BungeeConverter.convert(((VariableString) message).getMessageComponents(e));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the point of BungeeConverter when VariableString also stores the MessageComponents? Can't BungeeConverter just be removed entirely if we're not going to use it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MessageComponent is a custom Skript type. BungeeConverter converters our MessageComponent into Spigot/Bungee's component format

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So why was the old code you deleted in this pull request not used again with the BungeeConverter?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely sure what you mean, but EffBroadcast just hooks into the same behavior as EffMessage now. BungeeConverter is called each time those messages are sent though which probably isn't necessary (it has played-dependent behavior AFAIK)

@TheLimeGlass TheLimeGlass merged commit 0269fe2 into SkriptLang:dev/2.6 Oct 11, 2022
@TheLimeGlass TheLimeGlass removed their request for review December 24, 2022 03:34
@APickledWalrus APickledWalrus deleted the fix/eff-message-spigot branch September 6, 2023 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants