1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Rework object attachment handling to fix bugs (#14825)

This commit is contained in:
sfan5 2024-08-12 15:32:18 +02:00 committed by GitHub
parent a0e33ba9ea
commit 85e717fcd1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 245 additions and 172 deletions

View file

@ -5100,12 +5100,15 @@ Callbacks:
to the object (not necessarily an actual rightclick)
* `clicker`: an `ObjectRef` (may or may not be a player)
* `on_attach_child(self, child)`
* `child`: an `ObjectRef` of the child that attaches
* Called after another object is attached to this object.
* `child`: an `ObjectRef` of the child
* `on_detach_child(self, child)`
* `child`: an `ObjectRef` of the child that detaches
* Called after another object has detached from this object.
* `child`: an `ObjectRef` of the child
* `on_detach(self, parent)`
* `parent`: an `ObjectRef` (can be `nil`) from where it got detached
* This happens before the parent object is removed from the world
* Called after detaching from another object.
* `parent`: an `ObjectRef` from where it got detached
* Note: this is also called before removal from the world.
* `get_staticdata(self)`
* Should return a string that will be passed to `on_activate` when the
object is instantiated the next time.