Compare commits

..
1 Commits
Author SHA1 Message Date
miozune 1f4c5b0058 Fix inventory slots not being highlighted (#9) 2022-09-01 16:07:31 +02:00
2 changed files with 13 additions and 7 deletions

No files matched your search

@@ -1,6 +1,5 @@
package com.gtnh.findit;
import codechicken.nei.guihook.GuiContainerManager;
import com.gtnh.findit.service.blockfinder.BlockFindService;
import com.gtnh.findit.service.blockfinder.ClientBlockFindService;
import com.gtnh.findit.service.cooldown.SearchCooldownService;
@@ -48,11 +47,6 @@ public class FindIt {
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent event) {
if (event.getSide() == Side.CLIENT && FindIt.isExtraUtilitiesLoaded()) {
GuiContainerManager.inputHandlers.removeIf((inputHandler) ->
inputHandler.getClass().getName().equals("com.rwtema.extrautils.nei.ping.NEIPing")
);
}
}
public static SearchCooldownService getCooldownService() {
@@ -1,7 +1,7 @@
package com.gtnh.findit.service.itemfinder;
import codechicken.nei.NEIClientUtils;
import codechicken.nei.api.API;
import codechicken.nei.event.NEIConfigsLoadedEvent;
import codechicken.nei.guihook.GuiContainerManager;
import com.gtnh.findit.FindIt;
import com.gtnh.findit.FindItNetwork;
@@ -38,6 +38,7 @@ public class ClientItemFindService extends ItemFindService {
GuiContainerManager.addInputHandler(new ItemFindInputHandler());
MinecraftForge.EVENT_BUS.register(new GuiListener());
MinecraftForge.EVENT_BUS.register(new NEIEventListener());
FMLCommonHandler.instance().bus().register(new TickListener());
}
@@ -141,6 +142,17 @@ public class ClientItemFindService extends ItemFindService {
}
}
public static class NEIEventListener {
@SubscribeEvent
public void onNEIConfigsLoaded(NEIConfigsLoadedEvent event) {
if (FindIt.isExtraUtilitiesLoaded()) {
GuiContainerManager.inputHandlers.removeIf((inputHandler) ->
inputHandler.getClass().getName().equals("com.rwtema.extrautils.nei.ping.NEIPing")
);
}
}
}
public static ClientItemFindService getInstance() {
return (ClientItemFindService) FindIt.getItemFindService();
}