2121import dev .terminalmc .clientsort .client .interaction .InteractionManager ;
2222import dev .terminalmc .clientsort .client .order .CreativeSearchOrder ;
2323import net .minecraft .client .player .LocalPlayer ;
24+ import net .minecraft .world .level .GameType ;
2425import org .spongepowered .asm .mixin .Mixin ;
2526import org .spongepowered .asm .mixin .injection .At ;
2627import org .spongepowered .asm .mixin .injection .Inject ;
@@ -36,7 +37,7 @@ public abstract class LocalPlayerMixin {
3637 method = "clientSideCloseContainer" ,
3738 at = @ At ("HEAD" )
3839 )
39- public void beforeContainerClose (CallbackInfo callbackInfo ) {
40+ private void beforeContainerClose (CallbackInfo callbackInfo ) {
4041 InteractionManager .clear ();
4142 ClientSort .operatingClient = false ;
4243 }
@@ -45,10 +46,18 @@ public void beforeContainerClose(CallbackInfo callbackInfo) {
4546 method = "setPermissionLevel" ,
4647 at = @ At ("RETURN" )
4748 )
48- public void afterPermissionLevelChange (int level , CallbackInfo ci ) {
49+ private void afterPermissionLevelChange (int level , CallbackInfo ci ) {
4950 if (!ClientSort .searchOrderUpdated ) {
5051 ClientSort .searchOrderUpdated = true ;
5152 CreativeSearchOrder .tryRefreshStackPositionMap ();
5253 }
5354 }
55+
56+ @ Inject (
57+ method = "onGameModeChanged" ,
58+ at = @ At ("RETURN" )
59+ )
60+ private void afterGameModeChange (GameType gameMode , CallbackInfo ci ) {
61+ CreativeSearchOrder .tryRefreshStackPositionMap ();
62+ }
5463}
0 commit comments