Botania

Botania

133M Downloads

Spectator item crashes when scanning Bumblezone's Honey Cocoons when Lootr is on

TelepathicGrunt opened this issue ยท 4 comments

commented

Mod Loader

Fabric

Minecraft Version

1.20.1

Botania version

1.20.1-443

Modloader version

0.15.3

Modpack info

No response

The latest.log file

https://controlc.com/bd5a30f6/fullscreen.php?hash=e5023d175e0b301d79c4be9a96525f27&toolbar=true&linenum=false

Issue description

It appears Botania's Spectator item is trying to access loot table set blocks (which would generate the loot table which tbh is not a good thing as some mods like mine require player to open the loot container for best loot generation that is based on player traits). Anyway, as Botania tries to open the chest to analyze the loot, it is crashing. But only when lootr is on.

Steps to reproduce

Put on Botania, Lootr, and Bumblezone.

Put on Spectator item.

Hold any item.

Go into Bumblezone and find any structure with a Honey Cocoon. Locate command the Cell Maze structure for quick testing.

Crash when near Honey Cocoon with loot table.

Other information

No response

commented

The reason the Spectator uses getItem(int) is that it's the vanilla way for accessing the content. A proper fix may need separate implementations for (Neo)Forge(d) and Fabric using their corresponding inventory APIs.
On second thought, maybe the Spectator should access container blocks similar to as if it was a player in spectator mode, or at least be aware of loot table blocks (i.e. RandomizableContainerBlockEntity) somehow.

commented

Suggestion, use getItems() from the container to get a list of all items the container has. With lootr on, my Honey Cocoon will return an empty list for this. For you, you can iterate this list easier instead of having to access the slots one by one. I'll look closer at my code to see if I can harden against others who might do similar accessing but Botania using getItems() should get around the issue for now

commented

Should be fixed now on bumblezone's side. Can close this if you want or keep it open to switch to getItems() just in case other mods also cause same issue

commented

keeping it open is fine, this sounds like something we want to fix