@@ -173,7 +173,7 @@ public void preInitialiseControlify() {
173173 });
174174
175175 PlatformClientUtil .addHudLayer (CUtil .rl ("button_guide" ), (graphics , deltaTracker ) ->
176- inGameButtonGuide ().ifPresent (guide -> guide .renderHud (graphics , deltaTracker .getGameTimeDeltaPartialTick (false ))));
176+ inGameButtonGuide ().ifPresent (guide -> guide .extractRenderState (graphics , deltaTracker .getGameTimeDeltaPartialTick (false ))));
177177
178178 PlatformMainUtil .applyToControlifyEntrypoint (entrypoint -> {
179179 try {
@@ -386,7 +386,7 @@ private void onControllerAdded(ControllerEntity controller, boolean hotplugged)
386386 );
387387
388388 if (hotplugged ) {
389- ToastUtils .sendToast (
389+ MinecraftUtil .sendToast (
390390 Component .translatable ("controlify.toast.controller_connected.title" ),
391391 Component .translatable ("controlify.toast.controller_connected.description" , controller .name ()),
392392 false
@@ -410,7 +410,7 @@ private void onControllerRemoved(ControllerEntity controller) {
410410 this .selectFirstConnectedController ();
411411 }
412412
413- ToastUtils .sendToast (
413+ MinecraftUtil .sendToast (
414414 Component .translatable ("controlify.toast.controller_disconnected.title" ),
415415 Component .translatable ("controlify.toast.controller_disconnected.description" , controller .name ()),
416416 false
@@ -429,14 +429,14 @@ private void selectFirstConnectedController() {
429429 * Only the current controller ticks.
430430 */
431431 public void tick (Minecraft client ) {
432- if (minecraft .getOverlay () == null ) {
432+ if (MinecraftUtil .getOverlay () == null ) {
433433 if (currentSetupWizard != null && currentSetupWizard .isDone ()) {
434434 currentSetupWizard = null ;
435435 }
436436
437- if (!setupWizards .isEmpty () && !(minecraft . screen instanceof DontInteruptScreen )) {
437+ if (!setupWizards .isEmpty () && !(MinecraftUtil . getScreen () instanceof DontInteruptScreen )) {
438438 currentSetupWizard = setupWizards .poll ();
439- minecraft .setScreen (currentSetupWizard .start (minecraft . screen ));
439+ MinecraftUtil .setScreen (currentSetupWizard .start (MinecraftUtil . getScreen () ));
440440 }
441441 }
442442
@@ -493,8 +493,8 @@ private void tickActiveController(ControllerEntity controller, boolean outOfFocu
493493 ControllerStateView state = input .stateNow ();
494494 Optional <RumbleManager > rumbleManager = controller .rumble ().map (RumbleComponent ::rumbleManager );
495495
496- boolean isPaused = minecraft .isPaused () || minecraft . screen instanceof PauseScreen ;
497- boolean isConfigScreen = minecraft . screen instanceof YACLScreen ;
496+ boolean isPaused = minecraft .isPaused () || MinecraftUtil . getScreen () instanceof PauseScreen ;
497+ boolean isConfigScreen = MinecraftUtil . getScreen () instanceof YACLScreen ;
498498
499499 rumbleManager .ifPresent (rumble -> rumble .setSilent (outOfFocus || (isPaused && !isConfigScreen ) || currentInputMode () == InputMode .KEYBOARD_MOUSE ));
500500 if (outOfFocus ) {
@@ -515,7 +515,7 @@ private void tickActiveController(ControllerEntity controller, boolean outOfFocu
515515
516516 if (consecutiveInputSwitches > 100 ) {
517517 CUtil .LOGGER .warn ("Controlify detected current controller to be constantly giving input and has been disabled." );
518- ToastUtils .sendToast (
518+ MinecraftUtil .sendToast (
519519 Component .translatable ("controlify.toast.faulty_input.title" ),
520520 Component .translatable ("controlify.toast.faulty_input.description" ),
521521 true
@@ -530,8 +530,8 @@ private void tickActiveController(ControllerEntity controller, boolean outOfFocu
530530 }
531531
532532 if (this .currentInputMode ().isController ()) {
533- if (minecraft . screen != null ) {
534- ScreenProcessorProvider .provide (minecraft . screen ).onControllerUpdate (controller );
533+ if (MinecraftUtil . getScreen () != null ) {
534+ ScreenProcessorProvider .provide (MinecraftUtil . getScreen () ).onControllerUpdate (controller );
535535 }
536536
537537 ControlifyEvents .ACTIVE_CONTROLLER_TICKED .invoke (new ControlifyEvents .ControllerStateUpdate (controller ));
@@ -611,8 +611,8 @@ public boolean setInputMode(@NotNull InputMode newInputMode) {
611611 }
612612
613613 // notify current screen of input mode change
614- if (minecraft . screen != null ) {
615- ScreenProcessorProvider .provide (minecraft . screen ).onInputModeChanged (newInputMode );
614+ if (MinecraftUtil . getScreen () != null ) {
615+ ScreenProcessorProvider .provide (MinecraftUtil . getScreen () ).onInputModeChanged (newInputMode );
616616 }
617617
618618 // notify event listeners of input mode change
@@ -673,12 +673,12 @@ public void hideMouse(boolean hide, boolean moveMouse) {
673673 ? GLFW .GLFW_CURSOR_HIDDEN
674674 : GLFW .GLFW_CURSOR_NORMAL
675675 );
676- if (minecraft . screen != null ) {
676+ if (MinecraftUtil . getScreen () != null ) {
677677 var mouseHandlerAccessor = (MouseHandlerAccessor ) minecraft .mouseHandler ;
678678 if (hide && !virtualMouseHandler ().isVirtualMouseEnabled () && moveMouse ) {
679679 // stop mouse hovering over last element before hiding cursor but don't actually move it
680680 // so when the user switches back to mouse it will be in the same place
681- mouseHandlerAccessor .invokeOnMove (handle , -50 , -50 );
681+ mouseHandlerAccessor .controlify$ invokeOnMove (handle , -50 , -50 );
682682 }
683683 }
684684 }
@@ -722,7 +722,7 @@ public void notifyNewServer(ServerData data) {
722722 return ;
723723
724724 if (config ().getSettings ().globalSettings ().seenServers .add (data .ip )) {
725- ToastUtils .sendToast (
725+ MinecraftUtil .sendToast (
726726 Component .translatable ("controlify.toast.new_server.title" ),
727727 Component .translatable ("controlify.toast.new_server.description" , data .name ),
728728 true
0 commit comments