Soot

Soot

7M Downloads

CraftTweaker crash on load when using createMug examples.

Primitive-Human opened this issue ยท 1 comments

commented

I am experimenting with several mods that offer brewing with CraftTweaker support. Soot especially seems very promising because of the secondary effects.

I checked the CT support wiki on this repo and tried the "createMug" example listed at the very bottom. If I could get this to work, I could discard Sips which adds a mug that lets me drink any fluid and give any effects I desire. In addition, I could just add my own drinks through ContentTweaker and add them as drinkables using Soot's mug system.
Copied and pasted the example script into an empty .zs script for testing without any imports or other launch commands.

<liquid:oil_dwarf>.definition.createMug(1,[192,192,64]);
<liquid:gas_dwarf>.definition.createMug(2,[192,255,192]);
<liquid:lava>.definition.createMug(1,[255,64,16]);
<liquid:lava>.definition.setBrewingModifier("fuel", 10000);

CT throws a NPE on load and here's an excerpt of the error being thrown:

net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from CraftTweaker2 (crafttweaker)
Caused by: java.lang.NullPointerException
	at java.util.regex.Matcher.getTextLength(Unknown Source)
	at java.util.regex.Matcher.reset(Unknown Source)
	at java.util.regex.Matcher.<init>(Unknown Source)
	at java.util.regex.Pattern.matcher(Unknown Source)
	at net.minecraft.util.StringUtils.func_76338_a(SourceFile:24)
	at net.minecraftforge.fml.client.FMLClientHandler.stripSpecialChars(FMLClientHandler.java:1050)
	at net.minecraftforge.fml.common.FMLCommonHandler.stripSpecialChars(FMLCommonHandler.java:755)
	at net.minecraftforge.fml.common.ProgressManager$ProgressBar.step(ProgressManager.java:131)
	at crafttweaker.mc1120.CraftTweaker.lambda$applyActions$3(CraftTweaker.java:257)
	at java.lang.Iterable.forEach(Unknown Source)
	at crafttweaker.mc1120.CraftTweaker.applyActions(CraftTweaker.java:256)
	at crafttweaker.mc1120.CraftTweaker.onPostInit(CraftTweaker.java:200)

Were there any imports or other declarations that should be used before using the createMug option? I looked into ExpansionFluid.java , but didn't get any wiser from it.

Versions used:
Minecraft: 1.12.2
Forge: 14.23.5.2860
CraftTweaker2: 1.12-4.1.20.695
Embers Rekindled: 1.19
Soot: 1.10-hotfix
JEI: 4.16.1.1003

commented

I've brought this up at the CT discord; one user mentioned this:

the method used here returns a null when it should return at minimum an empty string, and this returning null causes the NPE.

Referenced to the method in the CT source.