Mekanism

Mekanism

111M Downloads

Cables don't use itemstack from ItemUseContext

Tfarcenim opened this issue ยท 0 comments

commented

The Universal Cables, (and possibly others) grab the itemstack for placement directly from the player instead of from the ItemUseContext passed in, this causes mods passing in different contexts to fail in odd ways, see Tfarcenim/Dank-Storage#97.

Quick steps for one of these cases

  1. Install Dank Storage and Mekanism
  2. Add stack of Universal cables (any tier) to a Dank 1.
  3. Switch Dank To Construction Mode
  4. Attempt to place cable using dank, cable gets placed successfully, but dank voids itself due to being shrunk by the cable code.

Forge: 1.16.4-35.1.11
Mekanism:1.16.4-10.0.18.445
Dank Storage:1.16.4-3.13

The problematic code

ItemStack stack = player.getHeldItem(context.getHand());