Just Enough Resources (JER)

Just Enough Resources (JER)

163M Downloads

Enigmatica 2 Expert Skyblock: Failed to register mod categories: class jeresources.jei.JEIConfig

mitchej123 opened this issue ยท 0 comments

commented

I'm running a slightly modified Enigmatica 2 Expert Skyblock via MultiMC and running into the following issue on the latest pack. Relevant versions - JustEnoughResources-1.12.2-0.9.0.53, forge-1.12.2-14.23.5.2824 & jei_1.12.2-4.15.0.273.jar:

 9140 java.lang.NullPointerException: null
 9141         at jeresources.jei.JEIConfig.hideCategories(JEIConfig.java:79) ~[JEIConfig.class:?]
 9142         at jeresources.jei.JEIConfig.registerCategories(JEIConfig.java:69) ~[JEIConfig.class:?]
 9143         at mezz.jei.startup.JeiStarter.registerCategories(JeiStarter.java:180) [JeiStarter.class:?]
 9144         at mezz.jei.startup.JeiStarter.start(JeiStarter.java:69) [JeiStarter.class:?]
 9145         at mezz.jei.startup.ProxyCommonClient.loadComplete(ProxyCommonClient.java:136) [ProxyCommonClient.class:?]
 9146         at mezz.jei.JustEnoughItems.loadComplete(JustEnoughItems.java:55) [JustEnoughItems.class:?]
 9147         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]
 9148         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_201]
 9149         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201]
 9150         at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201]
 9151         at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:624) [FMLModContainer.class:?]
 9152         at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source) ~[?:?]
 9153         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201]
 9154         at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201]
 9155         at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) [guava-21.0.jar:?]
 9156         at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) [guava-21.0.jar:?]
 9157         at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) [guava-21.0.jar:?]
 9158         at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) [guava-21.0.jar:?]
 9159         at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) [guava-21.0.jar:?]
 9160         at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) [guava-21.0.jar:?]
 9161         at com.google.common.eventbus.EventBus.post(EventBus.java:217) [guava-21.0.jar:?]
 9162         at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219) [LoadController.class:?]
 9163         at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197) [LoadController.class:?]
 9164         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]
 9165         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_201]
 9166         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201]
 9167         at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201]
 9168         at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) [guava-21.0.jar:?]
 9169         at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) [guava-21.0.jar:?]
 9170         at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) [guava-21.0.jar:?]
 9171         at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) [guava-21.0.jar:?]
 9172         at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) [guava-21.0.jar:?]
 9173         at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) [guava-21.0.jar:?]
 9174         at com.google.common.eventbus.EventBus.post(EventBus.java:217) [guava-21.0.jar:?]
 9175         at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136) [LoadController.class:?]
 9176         at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:752) [Loader.class:?]
 9177         at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:336) [FMLClientHandler.class:?]
 9178         at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:535) [bib.class:?]
 9179         at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:378) [bib.class:?]
 9180         at net.minecraft.client.main.Main.main(SourceFile:123) [Main.class:?]
 9181         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]
 9182         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_201]
 9183         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201]
 9184         at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201]
 9185         at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
 9186         at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
 9187         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]
 9188         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_201]
 9189         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201]
 9190         at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201]
 9191         at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:196) [NewLaunch.jar:?]
 9192         at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:231) [NewLaunch.jar:?]
 9193         at org.multimc.EntryPoint.listen(EntryPoint.java:143) [NewLaunch.jar:?]
 9194         at org.multimc.EntryPoint.main(EntryPoint.java:34) [NewLaunch.jar:?]

A "fix" that I've locally used is:

Index: src/main/java/jeresources/jei/JEIConfig.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/main/java/jeresources/jei/JEIConfig.java	(revision 75edca80187d9a5ea6d71a6d292913d68026ec1d)
+++ src/main/java/jeresources/jei/JEIConfig.java	(date 1554568417000)
@@ -70,13 +70,29 @@
     }
 
     public static void resetCategories() {
+        if(JEIConfig.jeiRuntime == null) {
+            System.out.println("Missing jeiruntime");
+            return;
+        }
+        if(JEIConfig.jeiRuntime.getRecipeRegistry() == null) {
+            System.out.println("Missing recipe registry");
+            return;
+        }
         for (String category : CATEGORIES)
-            jeiRuntime.getRecipeRegistry().unhideRecipeCategory(category);
+            JEIConfig.jeiRuntime.getRecipeRegistry().unhideRecipeCategory(category);
     }
 
     public static void hideCategories(String[] categories) {
+        if(JEIConfig.jeiRuntime == null) {
+            System.out.println("Missing jeiruntime");
+            return;
+        }
+        if(JEIConfig.jeiRuntime.getRecipeRegistry() == null) {
+            System.out.println("Missing recipe registry");
+            return;
+        }
         for (String category : categories)
-            jeiRuntime.getRecipeRegistry().hideRecipeCategory(Reference.ID + "." + category);
+            JEIConfig.jeiRuntime.getRecipeRegistry().hideRecipeCategory(Reference.ID + "." + category);
     }
 
     public static IJeiHelpers getJeiHelpers() {

This avoids JER not loading, but still produces the following error:

[09:47:34] [Client thread/INFO] [STDOUT]: [jeresources.jei.JEIConfig:hideCategories:87]: Missing jeiruntime