Feature
Delegates on listeners allow for single self-destroyable listeners to exist.
The following code will return the closest entity to the player once the back input key is pressed.
val closestEntity by receiveNext<MovementEvent.InputUpdate, Entity>(
transform = { getClosestEntity<Entity>(player.eyePos, 7.0) },
) { it.input.pressingBack }
It also allows to listen incoming events in an unorthodox way.
There are no practical uses outside of unsynchronized multi-threading where value loss is acceptable.
val events by listener<TickEvent.Pre>()
Additional Information
No response
Pull Request
Code of Conduct
Feature
Delegates on listeners allow for single self-destroyable listeners to exist.
The following code will return the closest entity to the player once the back input key is pressed.
It also allows to listen incoming events in an unorthodox way.
There are no practical uses outside of unsynchronized multi-threading where value loss is acceptable.
Additional Information
No response
Pull Request
Code of Conduct