@@ -50,13 +50,32 @@ private void onInit(CallbackInfo ci)
5050 if (!WurstClient .INSTANCE .isEnabled ())
5151 return ;
5252
53- lastServerButton =
54- addRenderableWidget (
55- Button
56- .builder (Component .literal ("Last Server" ),
57- b -> LastServerRememberer .joinLastServer (
58- (JoinMultiplayerScreen )(Object )this ))
59- .bounds (width / 2 - 154 , 10 , 100 , 20 ).build ());
53+ JoinMultiplayerScreen mpScreen = (JoinMultiplayerScreen )(Object )this ;
54+
55+ // Add Last Server button early for better tab navigation
56+ lastServerButton = Button
57+ .builder (Component .nullToEmpty ("Last Server" ),
58+ b -> LastServerRememberer .joinLastServer (mpScreen ))
59+ .width (100 ).build ();
60+ addRenderableWidget (lastServerButton );
61+ }
62+
63+ @ Inject (at = @ At (value = "INVOKE" ,
64+ target = "Lnet/minecraft/client/gui/screens/multiplayer/JoinMultiplayerScreen;repositionElements()V" ,
65+ ordinal = 0 ), method = "init()V" )
66+ private void afterVanillaButtons (CallbackInfo ci ,
67+ @ Local (ordinal = 1 ) LinearLayout footerTopRow ,
68+ @ Local (ordinal = 2 ) LinearLayout footerBottomRow )
69+ {
70+ if (!WurstClient .INSTANCE .isEnabled ())
71+ return ;
72+ // Footer buttons are not added here to avoid duplicates; corner buttons
73+ // are created/positioned in `repositionElements()` instead.
74+ }
75+
76+ @ Inject (at = @ At ("TAIL" ), method = "repositionElements()V" )
77+ private void onRefreshWidgetPositions (CallbackInfo ci )
78+ {
6079 updateLastServerButton ();
6180
6281 if (!WurstClient .INSTANCE .isEnabled ())
0 commit comments