Placer deducts two items at a time from inventory due to using BlockPlacementDispenserBehavior
nicwatson opened this issue ยท 2 comments
To reproduce:
Place a placer. Put a button on the placer. Put a stack of 64 cobblestones in the placer inventory. Press the button. Observe that one block is placed, but the size of the stack in the placer is 62.
This is due to the fact that the placer block uses Mojang's BlockPlacementDispenserBehavior
which is buggy. Specifically, after invoking BlockItem.place()
(and passing it an AutomaticItemPlacementContext
with a reference to the ItemStack, it calls subtractAmount(1)
on the same ItemStack, but place()
already does that itself. Consequently, two subtractions are carried out.
This isn't really Redstone Bits' fault but overriding BlockPlacementDispenserBehavior.dispenseStack()
is probably necessary to avoid the trap.
Hmm, odd. I've never encountered this issue myself. Regardless, will fix next update.