The Lost Cities

The Lost Cities

59M Downloads

[2.0.5] Editing the chestloot condition causes unexpected behavior

Rosethorns opened this issue ยท 5 comments

commented

I wanted to edit the loot conditions for lost cities so I could make them more specific so I removed the vanilla loot table values leaving it as just this.
image

I then changed the asset location in the general.cfg from
/assets/lostcities/citydata/conditions.json
to
$lostcities/conditions.json

After launching the game, loading or creating a world would softlock at "building terrain" and I would have to force Minecraft to close.

So I thought maybe that the original conditions.json asset location could not be changed.
So instead I made a new conditions file apocalypticconditions.json which looks like this
image

And then changed the asset list in general.cfg to look like this.
image

Now when I attempt to load MC I get this crash
https://pastebin.com/9AWAAnMB

So to recap,
Loading an edited conditions.json from the config folder causes a softlock when loading/creating a world.
Loading a replacement "chestloot" condition causes a crash as its unable to return the table.

Thanks for reading

commented

Hmm... I will check it out

commented

Ah. Error in the log:

java.lang.RuntimeException: Condition 'chestloot' did not return a table under certain conditions!

There must always be a fallback in case none of the conditions is true. If needed an empty loot table can be used or something

commented

I could perhaps make this test less strong and simply not set a loottable then

commented

@McJty The issue is that I think even with the vanilla loot tables removed it should always validate to true? All levels of buildings are covered and all subways are covered no?

If the answer is simply to add a low factor fallback I will try that :) I don't think anything needs to be changed. Although perhaps I suggest adding that as a tip to the conditions documentation something like "always make sure there is at least one option that will validate to true"

commented

All levels of buildings are covered and all subways are covered no?

No, it doesn't look like they are. The conditions that would select the loottable for most chests here:
image
is limited in range for floors [-100 to -3] and [4 to 100]. So any floors [-2 to 3] don't have a valid condition to select.