Skip to content

Commit

Permalink
changing the injection point
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreArcil committed Nov 12, 2023
1 parent 02caa38 commit e7e2993
Showing 1 changed file with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,23 +184,19 @@ public abstract class ServerLoginPacketListenerImplMixin implements ServerLoginP
return event.isCancelled();
}

@Inject(method = "startClientVerification(Lcom/mojang/authlib/GameProfile;)V", at = @At("HEAD"), cancellable = true)
private void impl$fireAuthEventOffline(final GameProfile gameProfile, final CallbackInfo ci) {
@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
/*if (!this.authenticatedProfile.isComplete()) {
this.authenticatedProfile = this.shadow$createFakeProfile(this.authenticatedProfile);
}*/

if(gameProfile.equals(createOfflineProfile(gameProfile.getName()))) {
if (this.bridge$fireAuthEvent()) {
ci.cancel();
}
if (this.bridge$fireAuthEvent()) {
ci.cancel();
System.out.println("hello");
}
}

@Shadow protected static GameProfile createOfflineProfile(String $$0) {
throw new UnsupportedOperationException("Shadowed createOfflineProfile");
}

}

0 comments on commit e7e2993

Please sign in to comment.