Implement Releaseable::getMinUseDuration()#6957
Implement Releaseable::getMinUseDuration()#6957remminiscent wants to merge 2 commits intopmmp:major-nextfrom
Releaseable::getMinUseDuration()#6957Conversation
| public function consumeHeldItem() : bool{ | ||
| $slot = $this->inventory->getItemInHand(); | ||
| if($slot instanceof ConsumableItem){ | ||
| if($this->getItemUseDuration() < $slot->getMinUseDuration()){ |
There was a problem hiding this comment.
It might be worth moving this to PlayerItemConsumeEvent, similar to how hasItemCooldown is handled below.
|
I'm not sure how I want to handle this tbh. Interfaces like this have been a constant pain in the ass for BC breaks. Considering we already have |
so do i /close this PR? or, in my opinion, we have a parent |
|
Bow would have to extend both Durable and Chargeable, that's not gonna work |
You're right. well, i'll move onto making other PR's until this gets a plan |
Implemented a new function
getMinUseDurationin theReleaseableinterface which will return the minimum needed ticks to use the item for an action to occur.Also, regarding the Bow, should it be 5 ticks, or 0?
Related issues & PRs
Changes
API changes
Releaseable::getMinUseDurationBackwards compatibility
Nope, It's BC Breaking. good for major-next branch
Tests
Works 👍
https://streamable.com/2l8zru