1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-12 08:05:18 +02: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
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.