Thaumic JEI

Thaumic JEI

30M Downloads

Enigmatica 2 Expert Skyblock - Failed to register mod plugin: class com.buuz135.thaumicjei.ThaumcraftJEIPlugin

mitchej123 opened this issue ยท 3 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 - ThaumicJEI-1.12.2-1.5.6-24.jar, forge-1.12.2-14.23.5.2824 & jei_1.12.2-4.15.0.273.jar:

9221 [20:30:01] [Client thread/ERROR] [jei]: Failed to register mod plugin: class com.buuz135.thaumicjei.ThaumcraftJEIPlugin
 9222 java.lang.ClassCastException: net.minecraft.item.ItemAir cannot be cast to crazypants.enderio.base.power.forge.item.IInternalPoweredItem
 9223         at crazypants.enderio.base.power.forge.item.InternalPoweredItemCap.<init>(InternalPoweredItemCap.java:15) ~[InternalPoweredItemCap.class:?]
 9224         at crazypants.enderio.powertools.machine.capbank.BlockItemCapBank.initCapabilities(BlockItemCapBank.java:22) ~[BlockItemCapBank.class:?]
 9225         at net.minecraft.item.ItemStack.forgeInit(ItemStack.java:1216) ~[aip.class:?]
 9226         at net.minecraft.item.ItemStack.<init>(ItemStack.java:138) ~[aip.class:?]
 9227         at com.buuz135.thaumicjei.ThaumcraftJEIPlugin.lambda$register$4(ThaumcraftJEIPlugin.java:153) ~[ThaumcraftJEIPlugin.class:?]
 9228         at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_201]
 9229         at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) ~[?:1.8.0_201]
 9230         at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) ~[?:1.8.0_201]
 9231         at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) ~[?:1.8.0_201]
 9232         at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) ~[?:1.8.0_201]
 9233         at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) ~[?:1.8.0_201]
 9234         at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) ~[?:1.8.0_201]
 9235         at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_201]
 9236         at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) ~[?:1.8.0_201]
 9237         at com.buuz135.thaumicjei.ThaumcraftJEIPlugin.register(ThaumcraftJEIPlugin.java:156) ~[ThaumcraftJEIPlugin.class:?]
 9238         at mezz.jei.startup.JeiStarter.registerPlugins(JeiStarter.java:202) [JeiStarter.class:?]
 9239         at mezz.jei.startup.JeiStarter.start(JeiStarter.java:73) [JeiStarter.class:?]
 9240         at mezz.jei.startup.ProxyCommonClient.loadComplete(ProxyCommonClient.java:136) [ProxyCommonClient.class:?]
 9241         at mezz.jei.JustEnoughItems.loadComplete(JustEnoughItems.java:55) [JustEnoughItems.class:?]
 9242         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]
 9243         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_201]
 9244         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201]
 9245         at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201]
 9246         at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:624) [FMLModContainer.class:?]
 9247         at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source) ~[?:?]
 9248         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201]
 9249         at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201]
 9250         at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) [guava-21.0.jar:?]
 9251         at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) [guava-21.0.jar:?]
 9252         at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) [guava-21.0.jar:?]
 9253         at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) [guava-21.0.jar:?]
 9254         at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) [guava-21.0.jar:?]
 9255         at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) [guava-21.0.jar:?]
 9256         at com.google.common.eventbus.EventBus.post(EventBus.java:217) [guava-21.0.jar:?]
 9257         at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219) [LoadController.class:?]
 9258         at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197) [LoadController.class:?]
 9259         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]
 9260         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_201]
 9261         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201]
 9262         at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201]
 9263         at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) [guava-21.0.jar:?]
 9264         at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) [guava-21.0.jar:?]
 9265         at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) [guava-21.0.jar:?]
 9266         at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) [guava-21.0.jar:?]
 9267         at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) [guava-21.0.jar:?]
 9268         at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) [guava-21.0.jar:?]
 9269         at com.google.common.eventbus.EventBus.post(EventBus.java:217) [guava-21.0.jar:?]
 9270         at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136) [LoadController.class:?]
 9271         at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:752) [Loader.class:?]
 9272         at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:336) [FMLClientHandler.class:?]
 9273         at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:535) [bib.class:?]
 9274         at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:378) [bib.class:?]
 9275         at net.minecraft.client.main.Main.main(SourceFile:123) [Main.class:?]
 9276         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]
 9277         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_201]
 9278         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201]
 9279         at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201]
 9280         at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
 9281         at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
 9282         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_201]
 9283         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_201]
 9284         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_201]
 9285         at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_201]
 9286         at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:196) [NewLaunch.jar:?]
 9287         at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:231) [NewLaunch.jar:?]
 9288         at org.multimc.EntryPoint.listen(EntryPoint.java:143) [NewLaunch.jar:?]
 9289         at org.multimc.EntryPoint.main(EntryPoint.java:34) [NewLaunch.jar:?]

Of note: the config option B:alwaysRecreateAspectFromItemStackFile is set to false and it's using the provided json from the default client install.

I've worked around the issue with the following patch locally (doesn't solve the issue, just ignores the errors):

Index: src/main/java/com/buuz135/thaumicjei/ThaumcraftJEIPlugin.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/main/java/com/buuz135/thaumicjei/ThaumcraftJEIPlugin.java	(revision 2bf918853f108ec35aada1c5b52701e35f1917a9)
+++ src/main/java/com/buuz135/thaumicjei/ThaumcraftJEIPlugin.java	(date 1554569553000)
@@ -147,12 +147,17 @@
                             }
                             return null;
                         }).filter(Objects::nonNull).map(compound -> {
-                            short trueCount = compound.getShort("Count");
-                            if (trueCount > Byte.MAX_VALUE)
-                                compound.setByte("Count", Byte.MAX_VALUE);
-                            ItemStack itemStack = new ItemStack(compound);
-                            itemStack.setCount(trueCount);
-                            return itemStack;
+                            try {
+                                short trueCount = compound.getShort("Count");
+                                if (trueCount > Byte.MAX_VALUE)
+                                    compound.setByte("Count", Byte.MAX_VALUE);
+                                ItemStack itemStack = new ItemStack(compound);
+                                itemStack.setCount(trueCount);
+                                return itemStack;
+                            } catch (ClassCastException e) {
+                                e.printStackTrace();
+                            }
+                            return ItemStack.EMPTY;
                         }).filter(stack -> !stack.isEmpty()).sorted(Comparator.comparing(ItemStack::getCount).reversed()).collect(Collectors.toList());
                         int start = 0;
                         while (start < items.size()) {

This causes about ~16 similar stack traces, but the mod finishes loading.

commented
commented

A semi related issue that Botania was running into w/ EnderIO if it's of any use: SleepyTrousers/EnderIO-1.5-1.12#5093 It seems the item count might be 0, creating an empty item stack which EIO doesn't like. Another solution might be to return ItemStack.EMPTY if count == 0, or force count = 1.

commented

#48 didn't fix the issue. The try catch I provided was still required on my install.

I have not looked at the count to see if it's going negative or 0.