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

Auth event called twice #3911

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.server.network.ServerLoginPacketListenerImpl;
import net.minecraft.server.players.PlayerList;
import org.objectweb.asm.Opcodes;
import org.spongepowered.api.Sponge;
import org.spongepowered.api.event.Cause;
import org.spongepowered.api.event.EventContext;
Expand Down Expand Up @@ -185,12 +184,8 @@ public abstract class ServerLoginPacketListenerImplMixin implements ServerLoginP
return event.isCancelled();
}

@Inject(method = "handleHello(Lnet/minecraft/network/protocol/login/ServerboundHelloPacket;)V",
at = @At(
value = "FIELD",
target = "Lnet/minecraft/server/network/ServerLoginPacketListenerImpl$State;KEY:Lnet/minecraft/server/network/ServerLoginPacketListenerImpl$State;",
opcode = Opcodes.GETSTATIC),
cancellable = true)
@Inject(method = "handleHello(Lnet/minecraft/network/protocol/login/ServerboundHelloPacket;)V", at = @At(value = "INVOKE", target =
"startClientVerification(Lcom/mojang/authlib/GameProfile;)V", ordinal = 1), cancellable = true)
private void impl$fireAuthEventOffline(final CallbackInfo ci) {
// Move this check up here, so that the UUID isn't null when we fire the event
// TODO broken
Expand All @@ -202,4 +197,5 @@ public abstract class ServerLoginPacketListenerImplMixin implements ServerLoginP
ci.cancel();
}
}

}
Loading