Correctly handle interactions with items on cooldown#8008
Conversation
|
This is somewhat of a behavioral change in regards to the API, so this is bleh all around, but, I can't really think of any sane alternatives here, so, approved (Also, note that I ci-skip'd the dupe patch numbers) |
|
Well it was a significant behavioral break from vanilla. You couldn't open a door with an item that was on cooldown, which works totally fine in vanilla. Firing a PlayerInteractEvent with useClickedBlock set to DENY isn't new, it just shouldn't happen when the item in hand is on cooldown. The interaction isn't cancelled just cause an item is on cooldown, the useItemInHand is |
|
Yea, that was my sthinking, the way that the event was being fired is just wrong, hence the fix; biggest minefield to me is at least the API side, but, I mean, I can't see any plugin expecting this to be the case, and there's no real other fix for this, so, it's got my vote |
bb50b04 to
8e47afa
Compare
|
Rebased for 1.19.2 |
This is a potential minefield, I tested the following situations:
PlayerInteractEvent.setUseItemInHand(DENY): block interactions don't happen when using the item and pressing shiftFixes #8005