Chisel

Chisel

150M Downloads

Modtweaker Logs gives NPE when removing a variation!

Guinaro opened this issue ยท 3 comments

commented

I'm currently using the Modtweaker functionctionality as implemented by Jared in issue #586
And I'm experiencing a Null Pointer Exception:

The strange thing is that the removal is indeed performed and executed in game, but you still get an NPE.

Relevant Log Part:
[AVAILABLE][CLIENT][INFO] Removing chisel group called: granite
[AVAILABLE][CLIENT][ERROR] Error while applying actions
java.lang.NullPointerException
    at team.chisel.common.carving.GroupList.removeVariation(GroupList.java:259)
    at team.chisel.common.carving.GroupList.removeVariation(GroupList.java:231)
...

Script Used:

import mods.chisel.Carving;

//Remove Granite from the Granite Chisel Group
Carving.removeVariation("granite", <minecraft:stone:1>);

Gist with extended error message and script:
https://gist.github.com/Guinaro/271882fd4306b2bfcbed26763648bf14

Guinaro

commented

Yes Using Chisel-MC1.12.2-0.2.0.31.
If you need more info, just ask. But it could indeed very well be that one of the 245 mods I'm loading is doing something unexpected, and loading a null name wouldn't surprise me. Sometimes running commands in game fails, because of the same reason, but finding the culprit is something else.

Guinaro

commented

This error seems impossible...the only way I can see it happening is if someone has added a group to the list with a null name. You are on the latest version of Chisel, correct? I will add some safety checks in the next version.

commented

I just wanted to add that removing a group spits out a similar error.

Using:


import mods.chisel.Carving;

mods.chisel.Carving.removeGroup("blockInvar");

I get:

[AVAILABLE][CLIENT][INFO] Removing chisel group called: blockInvar
[AVAILABLE][CLIENT][ERROR] Error while applying actions
java.util.ConcurrentModificationException
	at java.util.HashMap$HashIterator.nextNode(Unknown Source)
	at java.util.HashMap$EntryIterator.next(Unknown Source)
	at java.util.HashMap$EntryIterator.next(Unknown Source)
	at com.google.common.collect.AbstractMapBasedMultimap$AsMap$AsMapIterator.next(AbstractMapBasedMultimap.java:1428)
	at com.google.common.collect.AbstractMapBasedMultimap$AsMap$AsMapIterator.next(AbstractMapBasedMultimap.java:1417)
	at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:47)
	at team.chisel.common.carving.Carving.removeGroup(Carving.java:198)
	at com.blamejared.compat.chisel.Carving$ActionRemoveGroup.apply(Carving.java:104)
	at crafttweaker.runtime.CrTTweaker.apply(CrTTweaker.java:51)
	at crafttweaker.CraftTweakerAPI.apply(CraftTweakerAPI.java:135)
	at java.lang.Iterable.forEach(Unknown Source)
	at com.blamejared.ModTweaker.loadComplete(ModTweaker.java:42)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:627)
	at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
	at com.google.common.eventbus.EventBus.post(EventBus.java:217)
	at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:218)
	at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:196)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91)
	at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150)
	at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76)
	at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399)
	at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71)
	at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116)
	at com.google.common.eventbus.EventBus.post(EventBus.java:217)
	at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:135)
	at net.minecraftforge.fml.common.Loader.initializeMods(Loader.java:752)
	at net.minecraftforge.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:329)
	at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:534)
	at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:377)
	at net.minecraft.client.main.Main.main(SourceFile:123)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:196)
	at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:231)
	at org.multimc.EntryPoint.listen(EntryPoint.java:143)
	at org.multimc.EntryPoint.main(EntryPoint.java:34)