Storage Drawers: Biomes O' Plenty Pack

Storage Drawers: Biomes O' Plenty Pack

6M Downloads

[1.10.2 - 3.?.?] Getting out two instead of one item

Belgabor opened this issue ยท 2 comments

commented

I'm not entirely sure what is going on there. I noticed this while checking the compatibility of Drawers & Bits with the new version and first thought it was my fault, but it happens with the "vanilla" drawers as well.

Sometimes if you pull items with an empty hand you get two items instead of one. It's not a dupe, it pulls two items from the drawer (from my logs I see onBlockClicked is called twice). The annoying thing is it doesn't always happen.

As far as I've been able to determine it occurs under the following conditions:

  • You need to be in survival, never happens in creative
  • You pull with an empty hand into the current slot (aka your hand is no longer empty afterwards)
  • It usually doesn't happen right after you switch to survival, but pretty much every time after that

My best hypothesis at this point is that for some reason the click event is fired twice, once with the empty hand and once with the block that fell into it first, but I have not verified this. Not sure what can be done about it, this might be a forge issue...

commented

Confirmed... but I have no idea why. The traces are identical so it looks like MC or Forge is just firing the event twice. It's definitely some kind of race, because if I break in the code, it won't occur.

commented

Yeah, I did log the item in my hand after I posted and indeed you get one call with the empty hand and one call with the item in the hand. Might need to forward this to the forge guys.