Arnuh / ArmorEquipEvent

62 stars 43 forks source link

Dispensers can sometimes call ArmorEquipEvent when not in range #3

Closed Arnuh closed 6 years ago

Arnuh commented 8 years ago

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.

Orscrider commented 8 years ago

Would be even better to have an event for equipping armor with dispensers.

Arnuh commented 8 years ago

That.. is what I'm fixing

Orscrider commented 8 years ago

I meant built-in in Spigot.

Arnuh commented 8 years ago

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.

Arnuh commented 6 years ago

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.