File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
src/main/java/net/lenni0451/miniconnect/proxy/event Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 1010import net .lenni0451 .miniconnect .utils .ChannelUtils ;
1111import net .raphimc .netminecraft .util .MinecraftServerAddress ;
1212import net .raphimc .viaproxy .ViaProxy ;
13+ import net .raphimc .viaproxy .plugins .events .ConnectEvent ;
1314import net .raphimc .viaproxy .plugins .events .PreConnectEvent ;
1415import net .raphimc .viaproxy .plugins .events .ViaProxyLoadedEvent ;
16+ import net .raphimc .viaproxy .proxy .session .UserOptions ;
1517
1618import java .net .InetAddress ;
1719
@@ -51,4 +53,12 @@ public void onPreConnect(final PreConnectEvent event) {
5153 }
5254 }
5355
56+ @ EventHandler
57+ public void onConnect (final ConnectEvent event ) {
58+ ConnectionInfo connectionInfo = event .getProxyConnection ().getC2P ().attr (AttributeKeys .CONNECTION_INFO ).get ();
59+ if (connectionInfo != null ) {
60+ event .getProxyConnection ().setUserOptions (new UserOptions (null , connectionInfo .account ()));
61+ }
62+ }
63+
5464}
You can’t perform that action at this time.
0 commit comments