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

[Fabric] Fix players getting kicked on long taking configuration and make setting the user run earlier #3863

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Patbox
Copy link

@Patbox Patbox commented Mar 25, 2024

First commit fixes the issues when mods try to check permissions which could happen before luckperm's event could be executed.
Second commit fixes issue where players that took too long to join (for example because of using big resource pack on slow connection), got kicked out because of luckperms

@Patbox Patbox changed the title Make setting the user run earlier on Fabric [Fabric] Fix players getting kicked on long taking configuration and make setting the user run earlier Mar 25, 2024
}

@Inject(method = "onReady", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/PlayerManager;onPlayerConnect(Lnet/minecraft/network/ClientConnection;Lnet/minecraft/server/network/ServerPlayerEntity;Lnet/minecraft/server/network/ConnectedClientData;)V", shift = At.Shift.BEFORE), cancellable = true)
private void beforeConnecttion(ReadyC2SPacket packet, CallbackInfo ci, @Local ServerPlayerEntity player) {
Copy link
Member

@lucko lucko Mar 28, 2024

Choose a reason for hiding this comment

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

Is there not a way to do this with Fabric API? :(

I would prefer to not have to maintain our own event for something as critical (to LuckPerms) as the login event.

Copy link
Author

Choose a reason for hiding this comment

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

All fabric events happen too late from my testing. This is the earliest point ServerPlayerEntity instance exists and it runs just before rest of server's initialization code does, which should cover all cases (as mods are also likely to check permissions with mixin at any point within the onPlayerConnect). Fabric is just a mixin-heavy platform, so there is no real way to avoid it.

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.

None yet

2 participants