- The following events have been added:
- PlayerToggleGlideEvent
- PlayerToggleSwimEvent
- The following API methods have been added:
- Entity->getSize()
- Living->isSwimming()
- Living->setSwimming()
- Living->isGliding()
- Living->setSwimming()
- Player->toggleSwim()
- Player->toggleGlide()
this->size refers to the scaled height, but the client wants the base (unscaled) size in these properties.
This caused immense lag when, for example, setting the scale of a player to 10, because their collision box would become 180 by 60, instead of the expected 18 by 6.
Fixes#4589
The following API methods are added:
- `XpManager->canAttractXpOrbs()`
- `XpManager->setCanAttractXpOrbs()`
Possible future scope: flip this on its head to allow spectator players to attract XP orbs, in case someone wants that for some reason ???
Co-authored-by: Dylan K. Taylor <dktapps@pmmp.io>
- The following classes have been added:
- `ItemMergeEvent`
- `ItemEntityStackSizeChangeAnimation`
- The following API methods have been added:
- `ItemEntity->isMergeable()`
- `ItemEntity->tryMergeInto()`
- `ItemEntity->setStackSize()`
to be consistent with Position::__construct() and Location::fromObject() (although Location::fromObject() has no choice, thanks to the anti-feature known as late static binding ...)
I did consider allowing yaw/pitch to remain optional, but considering the implicit immutability of Location, it really doesn't make any sense to create a Location with default yaw/pitch - just create a Position in that case instead.
Given the various limitations and flexibilities posed by EntityItemPickupEvent, I settled on this as the simplest way to deal with the problem.
- EntityItemPickupEvent may have its destination inventory changed, so we can't cache the result of getAddableItemQuantity() to use after the event.
- The item itself may have changed, so even if we thought we could add some items before the change, we might not be able to afterwards.
Considering the above facts, it's better to just give the whole itemstack to EntityItemPickupEvent, and let plugins use getAddableItemQuantity() on their own to decide if their chosen inventory can accommodate the item or not.
If it can't, then we'll just drop it on the ground.
This also fixes a potential issue where plugins changing the item to a custom one might end up with their items and the actual items both just vanishing if the target inventory was full.
closes#4499
we can't have landed on it unless it actually has a collision box - otherwise, we only landed _in_ it.
This assumes, of course, that no blocks have bounding boxes >= 2 blocks tall, which currently none do.