LootTweaker

LootTweaker

17M Downloads

[0.1.3] Crash on World Load with removing pools (already removed on a previous load?)

thephoenixlodge opened this issue ยท 8 comments

commented

Describe the bug
I believe this is probably due to the fix introduced in 0.1.3, but now when loading my existing world I get the crash as linked below, with the crash occurring while removing pools.

To Reproduce
Steps to reproduce the behavior:
Load a pre-existing world with a script set to remove a pool from a loot table (second time with script present?).

Expected behavior
No crash/catch and continue past the failed removal

Logs & scripts
Crash log: https://pastebin.com/1JwpTkrZ

Version Info (Exact versions only):
LootTweaker: 0.1.3
CraftTweaker/Minetweaker: 4.1.19
Forge: 2838
Minecraft: 1.12.2

commented

As I understand it loot tables are reset on switching saves within a session, so it's not that the pool doesn't exist. My understanding of what happens to loot tables in that scenario is not the best though. Also LT checks for null pools and asks an error handler to report the error in a way that's appropriate for the current environment (users get CT errors, while unit testing I get java exceptions).

I think the issue here is that the error handler is injected using a framework called Dagger, which I've misunderstood how to use. So the injection fails, and when LT attempts to report an error, there is no error handler. However that suggests that the pool name you're using is incorrect, barring further issues in LootTweaker.

commented

Or, actually, that may not be it at all. After further testing, I was still getting the same crash after changing the pool I was removing. Turns out, it seems to be specific to the pool added by corail tombstone. Said pool is disableable in their config (which I've now done) but perhaps it was trying to add it in only after LootTweaker was trying to remove it.

commented

Seems I did have a pool name wrong. I suspect due to the mod that added said pool updating. Seems they ditched the pool I had previously been removing, and added a completely differently named one instead.
However, the crash report was definitely far from helpful at being able to identify that this was the issue.

commented

However, the crash report was definitely far from helpful at being able to identify that this was the issue.

As I said, that's because the error handler LT uses to report errors was unexpectedly null.
This JAR should fix that.

perhaps it was trying to add it in only after LootTweaker was trying to remove it.

Unlikely. LootTweaker requests that Forge passes it loot tables after most other mods. It's possible for a mod to do the same thing, and edit the loot table after LT gets to, but unlikely.

commented

@thephoenixlodge Why'd you close the issue?

commented

Because the original problem is resolved. Pretty much all were issues with how I was using the mod/an avoidable poor interaction with another mod. The only actual issue discovered was the problem with the crash report generation.

commented

I prefer to keep issues open until the fix is in a released version. Assuming that JAR works, please don't distribute it. It's strictly for testing.

commented

I haven't even tried that JAR. My original issue was a crash on world load. That was resolved by disabling the problematic pool in the tombstone config.