Dispensers can sometimes call ArmorEquipEvent when not in range
Closed this issue · 5 comments
The check is currently a bit off in some cases. You can be really close but not actually in range.
Current fix: https://gist.github.com/Borlea/f92cf9da25a2a90cb5f60a3f3d3c601c
In order to actually add this fix to a public version of ArmorEquipEvent some changes will need to be made, which is obviously to remove the NMS parts of it.
Due to spigot lacking any form of api with entity bounding boxes(AxisAllignedBB). I will most likely do a commit to solve this. Related issue https://hub.spigotmc.org/jira/browse/SPIGOT-2151.
The current getNearbyEntities does some slight changes to what this code does and will result in issues again.
But as I said, current plan is to just add a AxisAlignedBB getBoundingBox() to the Entity baseclass in spigot and only support dispensers if such method is available.
Would be even better to have an event for equipping armor with dispensers.
That.. is what I'm fixing
I meant built-in in Spigot.
Yes it would be.. But I see no point in adding the whole event without the rest of the methods.. Which I'm definitely not adding.
https://www.spigotmc.org/threads/dispenser-armorstand-question.338299/#post-3149306
Looks look a promising fix and based off the info provided will solve this issue.
I'll close this and add the event whenever it's available in the API.