Make EntityUnleashEvent cancellable#4993
Conversation
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
|
No. |
e5c8967 to
febfdf4
Compare
|
|
febfdf4 to
d440d33
Compare
There was a problem hiding this comment.
You definitely have to still call Vanilla's unleash method when a) the holder disconnected (otherwise the server will freak out trying to unleash the entity for eternity), or b) the leashed entity dies (for internal distance tracking purposes). Im pretty sure both of these should be covered in EntityInsentient#eA(), tho Bukkit's lacking unleash reasons didn't really help looking at that 😛 so there might even be more cases, but not sure
|
Hmm, if you can't cancel it in several situations, how should this be handled? Just document in the event that cancelling in those situations will not actually do anything? |
|
Any "good" suggestions I'd have would require slightly breaking the event, I can't really think of anything but document what cases aren't cancellable and that setting cancel to true won't have any effect there, yeah. |
d440d33 to
347186b
Compare
|
Ok, made it uncancellable in those situations I think. |
347186b to
a7920ed
Compare
|
Rebased for 1.17.1 |
a7920ed to
573be62
Compare
573be62 to
d77793b
Compare
d77793b to
09d6a2a
Compare
Closes #4780
One thing to note. Should it be possible to cancel the event if the leashed entity dies? I tested if the player dies and you do stay leashed to it, but if the leashed entity dies, maybe it should unleash regardless of event cancellation.