CyclopsMC / IntegratedTunnels

Transfer other energy, items and fluids over Integrated Dynamics networks
MIT License
20 stars 13 forks source link

Crash when dispensing Botania's Wand of the Forest using a World Item Exporter #261

Closed MaienM closed 1 year ago

MaienM commented 1 year ago

Issue type:


Short description:

Crash when using a Wand of the Forest from Botania in the Place Item Entity action of the World Item Exporter with the Dispense option enabled.

This occurs because the wand implements OptionalDispenseItemBehavior, and inside this behaviour it attempts to get the facing of the dispenser (world.getBlockState(source.getPos()).getValue(DispenserBlock.FACING);).

Steps to reproduce the problem:

  1. Create a basic network with an Item Interface connected to a chest, and a World Item Exporter.
  2. Create a variable card holding the Wand of the Forest Item from Botania.
  3. Store the Wand of the Forest in the chest.
  4. Put the variable card into the Place Item Entity action of the World Item Exporter.
  5. Enable the Dispense option of this action.

Expected behaviour:

I expected the World Item Exporter to use the wand the same way a regular dispenser would, which is to activate a block (a Runic Altar in this case) as if the user had right-clicked it with the wand.


Versions:

Log file:

https://dpaste.com/72GXV24D2

rubensworks commented 1 year ago

Thanks for reporting!

rubensworks commented 1 year ago

Could you report this to Botania's issue tracker, and link back to here?

They seem to be retrieving the blockstate from the world (via world.getBlockState(source.getPos())) instead of retrieving it from the BlockSource via getBlockState(). This is needed because ID simulates the dispenser block, without being an actual dispenser block itself (this approach is compatible with the vanilla dispenser behaviors).