@@ -66,7 +66,7 @@ private final void keybindCallback(IHotkey hotkey, Function<Screen, Boolean> all
6666 valueChangeCallback (Configs .Database .ADDRESS , ()->InitUtils .refreshRemoteServerSender (remoteSender ));
6767 valueChangeCallback (Configs .Database .CLIENT_ID , ()->InitUtils .refreshRemoteServerSender (remoteSender ));
6868 valueChangeCallback (Configs .Database .CLIENT_KEY , ()->InitUtils .refreshRemoteServerSender (remoteSender ));
69- valueChangeCallback (Configs .Database .BORROW_IGNORES , gameMessageFilter ::recomputeIgnoreLists );
69+ if ( gameMessageFilter != null ) valueChangeCallback (Configs .Database .BORROW_IGNORES , gameMessageFilter ::recomputeIgnoreLists );
7070 Configs .Database .EPEARL_OWNERS_BY_UUID .setValueChangeCallback (newValue -> {if (newValue .getBooleanValue ()) epearlLookup .loadEpearlCacheUUID ();});
7171 Configs .Database .EPEARL_OWNERS_BY_XZ .setValueChangeCallback (newValue -> {if (newValue .getBooleanValue ()) epearlLookup .loadEpearlCacheXZ ();});
7272
@@ -75,14 +75,20 @@ private final void keybindCallback(IHotkey hotkey, Function<Screen, Boolean> all
7575 valueChangeCallback (Configs .Generic .TEMP_BROADCAST_MSGS , ChatBroadcaster ::refreshBroadcast );
7676 valueChangeCallback (Configs .Generic .SCROLL_ORDER , kbHbScroll ::refreshColorLists );
7777
78- valueChangeCallback (Configs .Hotkeys .INV_RESTOCK_BLACKLIST , kbInvRestock ::refreshLists );
79- valueChangeCallback (Configs .Hotkeys .INV_RESTOCK_WHITELIST , kbInvRestock ::refreshLists );
80- valueChangeCallback (Configs .Generic .INV_RESTOCK_AUTO_FOR_INV_ORGS , ()->kbInvRestock .refreshLayouts (kbInvOrgs ));
81- Configs .Hotkeys .INV_ORGANIZE_1 .setValueChangeCallback (newValue -> kbInvOrgs [0 ].refreshLayout (newValue .getStrings ()));
82- Configs .Hotkeys .INV_ORGANIZE_2 .setValueChangeCallback (newValue -> kbInvOrgs [1 ].refreshLayout (newValue .getStrings ()));
83- Configs .Hotkeys .INV_ORGANIZE_3 .setValueChangeCallback (newValue -> kbInvOrgs [2 ].refreshLayout (newValue .getStrings ()));
84- valueChangeCallback (Configs .Generic .WHISPER_PLAY_SOUND , whisperPlaySound ::recomputeSound );
85- valueChangeCallback (Configs .Generic .WHISPER_PLAY_SOUND_UNFOCUSED , whisperPlaySound ::recomputeSoundUnfocused );
78+ if (kbInvRestock != null ){
79+ valueChangeCallback (Configs .Hotkeys .INV_RESTOCK_BLACKLIST , kbInvRestock ::refreshLists );
80+ valueChangeCallback (Configs .Hotkeys .INV_RESTOCK_WHITELIST , kbInvRestock ::refreshLists );
81+ valueChangeCallback (Configs .Generic .INV_RESTOCK_AUTO_FOR_INV_ORGS , ()->kbInvRestock .refreshLayouts (kbInvOrgs ));
82+ }
83+ if (kbInvOrgs != null ){
84+ Configs .Hotkeys .INV_ORGANIZE_1 .setValueChangeCallback (newValue -> kbInvOrgs [0 ].refreshLayout (newValue .getStrings ()));
85+ Configs .Hotkeys .INV_ORGANIZE_2 .setValueChangeCallback (newValue -> kbInvOrgs [1 ].refreshLayout (newValue .getStrings ()));
86+ Configs .Hotkeys .INV_ORGANIZE_3 .setValueChangeCallback (newValue -> kbInvOrgs [2 ].refreshLayout (newValue .getStrings ()));
87+ }
88+ if (whisperPlaySound != null ){
89+ valueChangeCallback (Configs .Generic .WHISPER_PLAY_SOUND , whisperPlaySound ::recomputeSound );
90+ valueChangeCallback (Configs .Generic .WHISPER_PLAY_SOUND_UNFOCUSED , whisperPlaySound ::recomputeSoundUnfocused );
91+ }
8692
8793 // Keybind callbacks
8894 keybindCallback (Configs .Hotkeys .TOGGLE_CAPE , null , ()->InitUtils .toggleSkinLayer (PlayerModelPart .CAPE ));
@@ -97,15 +103,19 @@ private final void keybindCallback(IHotkey hotkey, Function<Screen, Boolean> all
97103// keybindCallback(Configs.Hotkeys.EBOUNCE_TRAVEL_HELPER, null, kbEbounce::toggle);
98104 Configs .Hotkeys .AIE_TRAVEL_HELPER .setValueChangeCallback (newValue ->kbAIE .updateEnabled (newValue .getBooleanValue ()));
99105 Configs .Hotkeys .EBOUNCE_TRAVEL_HELPER .setValueChangeCallback (newValue ->kbEbounce .updateEnabled (newValue .getBooleanValue ()));
100- keybindCallback (Configs .Hotkeys .CRAFT_RESTOCK , null /*HandledScreen.class::isInstance*/ , kbCraftRestock ::restockInputSlots );
106+ if ( kbCraftRestock != null ) keybindCallback (Configs .Hotkeys .CRAFT_RESTOCK , null /*HandledScreen.class::isInstance*/ , kbCraftRestock ::restockInputSlots );
101107 keybindCallback (Configs .Hotkeys .EJECT_JUNK_ITEMS , s ->s ==null || s instanceof HandledScreen , kbej ::ejectJunkItems );
102108 keybindCallback (Configs .Hotkeys .HOTBAR_TYPE_INCR , null , ()->kbHbScroll .scrollHotbarSlot (true ));
103109 keybindCallback (Configs .Hotkeys .HOTBAR_TYPE_DECR , null , ()->kbHbScroll .scrollHotbarSlot (false ));
104110
105- keybindCallback (Configs .Hotkeys .TRIGGER_INV_ORGANIZE_1 , null , ()->kbInvOrgs [0 ].organizeInventory (false , null ));
106- keybindCallback (Configs .Hotkeys .TRIGGER_INV_ORGANIZE_2 , null , ()->kbInvOrgs [1 ].organizeInventory (false , null ));
107- keybindCallback (Configs .Hotkeys .TRIGGER_INV_ORGANIZE_3 , null , ()->kbInvOrgs [2 ].organizeInventory (false , null ));
108- keybindCallback (Configs .Hotkeys .INV_RESTOCK , s ->s instanceof HandledScreen && s instanceof InventoryScreen == false , kbInvRestock ::doRestock );
111+ if (kbInvOrgs != null ){
112+ keybindCallback (Configs .Hotkeys .TRIGGER_INV_ORGANIZE_1 , null , ()->kbInvOrgs [0 ].organizeInventory (false , null ));
113+ keybindCallback (Configs .Hotkeys .TRIGGER_INV_ORGANIZE_2 , null , ()->kbInvOrgs [1 ].organizeInventory (false , null ));
114+ keybindCallback (Configs .Hotkeys .TRIGGER_INV_ORGANIZE_3 , null , ()->kbInvOrgs [2 ].organizeInventory (false , null ));
115+ }
116+ if (kbInvRestock != null ){
117+ keybindCallback (Configs .Hotkeys .INV_RESTOCK , s ->s instanceof HandledScreen && s instanceof InventoryScreen == false , kbInvRestock ::doRestock );
118+ }
109119
110120 keybindCallback (Configs .Hotkeys .CHAT_MSG_1 , null , ()->InitUtils .sendChatMsg (Configs .Hotkeys .CHAT_MSG_1 .getStringValue ()));
111121 keybindCallback (Configs .Hotkeys .CHAT_MSG_2 , null , ()->InitUtils .sendChatMsg (Configs .Hotkeys .CHAT_MSG_2 .getStringValue ()));
0 commit comments