Builds a clone command for an entity and all of its descendants.
The source must exist. The root and descendants are collected in
relationship traversal order. World#spawn then allocates one
empty entity for each source, and a SpawnCommand is stored for
each handle; those component insertions do not happen until
CloneCommand#execute runs.
Each registered component is copied with its registered clone method.
EntityHandle and Children components are omitted. The
The root’s Parent component keeps its original parent. Descendant
Parent components are remapped to the corresponding cloned
entities. Registered map
methods receive the complete source-to-clone entity map, so other entity
references can be remapped as well. When hierarchy hooks are installed, the
inserted Parent components rebuild the cloned Children
relationships.
Components without a registry entry or without a registered clone
method are skipped with a warning. If setup throws after clone handles
have been recorded, CloneCommand.create despawns each handle in
the child-command list and does not rethrow that error. It then constructs
a CloneCommand from that list; if no child command was added, the
constructor’s non-empty-list assertion is raised.