Redstone Bits

Redstone Bits

908k Downloads

Placer deducts two items at a time from inventory due to using BlockPlacementDispenserBehavior

nicwatson opened this issue ยท 2 comments

commented

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.

commented

Hmm, odd. I've never encountered this issue myself. Regardless, will fix next update.

commented

I've got the same problem. It's still not updated :(

Hmm, odd. I've never encountered this issue myself. Regardless, will fix next update.

Btw, you did encounter this issue in your own gif (on the curseforge page of your mod)!