[1.14] Botania is preventing Crafttweaker scripts from running?
LezChap opened this issue ยท 4 comments
Version Information
Minecraft: 1.14.4
Forge version: 28.1.109
Botania version: Botania r1.11-372.jar
CraftTweaker: 5.0.1150
Further Information
Botania appears to be preventing Crafttweaker Zenscripts from running. Crafttweaker scripts work fine before adding Botania to the instance. They don't work when Botania is installed. Removing Botania (and restarting) and they start working again.
What I expected to happen:
Botania shouldn't prevent CT scripts from working...not even sure why.
As of 1.14 it's a requirement to use .name()
to name your loot pool before injecting it into a table. If you do not, the next event handler or the next thing that tries to modify the table will cause an NPE as forge's addPool
(or an adjacent function) runs:
if (pools.stream().anyMatch(e -> e == pool || e.getName().equals(pool.getName())))
and injects loot names to all Vanilla loot tables as they are loaded.
As the default LootPool builder has null for a name, this code causes a null pointer. I thought I'd actually reported this to MinecraftForge but either it's been closed already (unlikely as it isn't fixed) or it slipped my mind.
So this is from All The Mods 4 (v 0.2.8) with a custom CraftTweaker script (ChestFix.zs) attempting to fix a Quark Chests/Vanilla Chest oredict(tag?) recipe issue. The only other change from the default ATM4 pack is Botania being disabled (it was added in 0.2.8) to show what the logs show when CraftTweaker is working, and then re-enabled to show those logs. In each log, I open a Singleplayer World (since CT reloads scripts at that point) and check a recipe that should be changed in JEI before closing the world.
https://gist.github.com/LezChap/ad29fef3ff6aa1fa5b4771c7c15e6dfc Hopefully the file names make it clear which log is which...I know there's a lot of unnecessary info in those console logs to filter through, but I'm clueless at where it's going wrong and so I'm going to give you the full log.
Jeez, that's a lot of dumb errors to go through... but I think I see the issue. There's some conflict with loot table injection between MysticalWorld and Botania.
The literally only relevant part that matters:
[18:22:27] [Server thread/ERROR]: Exception caught during firing event: null
Index: 2
Listeners:
0: NORMAL
1: ASM: class vazkii.botania.common.core.loot.LootHandler lootLoad(Lnet/minecraftforge/event/LootTableLoadEvent;)V
2: ASM: class epicsquid.mysticalworld.events.LootHandler onLootLoad(Lnet/minecraftforge/event/LootTableLoadEvent;)V
3: ASM: class com.teammetallurgy.aquaculture.init.AquaLootTables onLootTableLoad(Lnet/minecraftforge/event/LootTableLoadEvent;)V
4: ASM: vazkii.quark.tools.module.AncientTomesModule@34847266 onLootTableLoad(Lnet/minecraftforge/event/LootTableLoadEvent;)V
5: ASM: vazkii.quark.vanity.module.ColorRunesModule@2b5eb918 onLootTableLoad(Lnet/minecraftforge/event/LootTableLoadEvent;)V
6: LOWEST
7: ASM: class ovh.corail.tombstone.event.EventHandler onLootTableLoad(Lnet/minecraftforge/event/LootTableLoadEvent;)V
java.lang.NullPointerException
at net.minecraft.world.storage.loot.LootTable.lambda$addPool$2(LootTable.java:236)
at net.minecraft.world.storage.loot.LootTable$$Lambda$9106/2041968890.test(Unknown Source)
at java.util.stream.MatchOps$1MatchSink.accept(MatchOps.java:90)
at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1351)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:529)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:516)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502)
at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:230)
at java.util.stream.MatchOps$MatchOp.evaluateSequential(MatchOps.java:196)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.anyMatch(ReferencePipeline.java:449)
at net.minecraft.world.storage.loot.LootTable.addPool(LootTable.java:236)
at epicsquid.mysticalworld.events.LootHandler.onLootLoad(LootHandler.java:27)
at net.minecraftforge.eventbus.ASMEventHandler_250_LootHandler_onLootLoad_LootTableLoadEvent.invoke(.dynamic)
[rest of stack trace omitted]
As far as I remember, anything throwing on datapack load makes it not load further, and CT is probably tied into that process.