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 some component bugs in login disconnect packet #10090

Merged
merged 2 commits into from
Dec 29, 2023

Conversation

LemonCaramel
Copy link
Contributor

Fixes an issue in ClientboundLoginDisconnectPacket where Adventure translate components are not rendered
and Serialized components having a maximum length of 32767.

TestPlugin.java

public final class TestPlugin extends JavaPlugin implements Listener {

    @Override
    public void onEnable() {
        final GlobalTranslator translator = GlobalTranslator.translator();
        final TranslationRegistry registry = TranslationRegistry.create(Key.key("paper", "test-plugin"));
        registry.register("paper.kittens", Locale.US, new MessageFormat("Kittens!!!!!!"));
        translator.addSource(registry);

        this.getServer().getPluginManager().registerEvents(this, this);
    }

    @EventHandler
    void onAsyncPlayerPreLogin(final AsyncPlayerPreLoginEvent event) {
        // 35096 lengths (Translated: 33596 lengths)
        event.disallow(AsyncPlayerPreLoginEvent.Result.KICK_OTHER, MiniMessage.miniMessage().deserialize(
            "<rainbow>" + "<click:run_command:kittens><lang:paper.kittens> ".repeat(300)
        ));
    }
}

@LemonCaramel LemonCaramel requested a review from a team as a code owner December 28, 2023 18:30
Copy link
Member

@Machine-Maker Machine-Maker left a comment

Choose a reason for hiding this comment

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

The javadoc comment applies to the other modified javadocs from the API

patches/api/0006-Adventure.patch Outdated Show resolved Hide resolved
patches/server/0010-Adventure.patch Outdated Show resolved Hide resolved
@lynxplay lynxplay force-pushed the fix-adventure-serialize branch from dcec737 to 51c3335 Compare December 29, 2023 19:17
@lynxplay lynxplay merged commit e56e53f into PaperMC:master Dec 29, 2023
3 checks passed
lynxplay pushed a commit to lynxplay/paper that referenced this pull request Feb 23, 2024
@LemonCaramel LemonCaramel deleted the fix-adventure-serialize branch April 28, 2024 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants