Botania (Fabric/Quilt)

Botania (Fabric/Quilt)

5M Downloads

Corporea spark on red stringed container detaches unexpectedly

TheRealWormbo opened this issue ยท 5 comments

commented

Mod Loader

Forge

Minecraft Version

1.18.2

Botania version

1.18.2-432

Modloader version

Forge: 40.1.25

Modpack info

https://www.curseforge.com/minecraft/modpacks/the-phoenixs-magics-and-goodies

The latest.log file

https://gist.github.com/TheRealWormbo/99aba996a806b06e3df7798a1d1c7c31

Issue description

Corporea sparks cannot be attached to a red stringed container block while that block is not linked to anything, and will pop off on various unexpected occasions if there actually is a link to an inventory block.

Steps to reproduce

  1. Place a sideway facing Red Stringed Container without any inventories in range.
  2. Attempt to place a corporea spark on the container. (expected: spark attaches properly, exposing nothing to the corporea network; observed: unable to do so)
  3. Place a shulker box in range of the red stringed container. (should link properly, as confirmed with a wand of the forest)
  4. Attempt to place a corporea spark on the container. (works now)
  5. Save and Quit to Title, then reopen the world. (expected: same state as after step 4; observed: spark popped off on reload)
  6. Place the corporea spark on the red stringed container again.
  7. Place a hopper pointing into the shulker box on the opposite side (from the perspective of the red stringed container, the hopper is behind the shulker box)
  8. Break the shulker box in some way, e.g. with a piston, a bore lens mana burst, or pickaxe. (expected: corporea spark stays attached, now exposing the content of the hopper to the network; observed: spark pops off)

Other information

This might also be a regression from #2790.

commented

@Hubry can you take a look when you can

commented

Solution might be as simple as adding red stringed container (and dispenser) to the corporea spark override tag?

commented

Good point, i agree the old behavior of reporting an empty inventory would be the best course of action.

commented

As far as I can tell, previous versions (here: Botania for 1.12.2) ensured to always return an item handler capability, which would represent an empty, non-insertable inventory if the redstringed container is not bound to anything. I assume that behavior was lost in some kind of refactoring.
I feel like adding the block to the corporea spark override tag might intermittently report "not an inventory" to other blocks or entities interacting with it, which could cause weird interactions with other mods.

commented

I can confirm that reporting an empty dummy inventory in RedStringContainerCapProvider.getCapability fixes the issue on Forge.

For completeness' sake I also checked the Fabric version. It has the exact same issue, but I'm still trying to understand Fabric inventory handling to figure out a potential fix.