File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/main/java/net/raphimc/b2rplugin Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 1818package net .raphimc .b2rplugin ;
1919
2020import com .github .dirtpowered .betatorelease .network .session .BetaPlayer ;
21+ import com .mojang .authlib .GameProfile ;
22+ import com .mojang .util .UUIDTypeAdapter ;
2123import io .netty .buffer .ByteBuf ;
2224import io .netty .channel .ChannelHandlerContext ;
2325import io .netty .channel .SimpleChannelInboundHandler ;
@@ -97,7 +99,9 @@ private void onShouldVerifyOnlineModeEvent(final ShouldVerifyOnlineModeEvent eve
9799 final String username = event .getProxyConnection ().getGameProfile ().getName ();
98100 if (username == null ) return ;
99101
100- if (this .b2rPlayers .stream ().anyMatch (p -> p .getSession ().getPlayerName ().equals (username ))) {
102+ final BetaPlayer player = this .b2rPlayers .stream ().filter (p -> p .getSession ().getPlayerName ().equals (username )).findFirst ().orElse (null );
103+ if (player != null && player .getUuid () != null ) {
104+ event .getProxyConnection ().setGameProfile (new GameProfile (UUIDTypeAdapter .fromString (player .getUuid ()), username ));
101105 event .setCancelled (true );
102106 }
103107 }
You can’t perform that action at this time.
0 commit comments