Skip to content

Commit

Permalink
Add FiguraModelPart.remove to remove a given part from it's parent
Browse files Browse the repository at this point in the history
  • Loading branch information
UnlikePaladin committed Jan 24, 2024
1 parent a6168d0 commit 11720d1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Expand Up @@ -1348,6 +1348,15 @@ else if (x == null)
return this;
}

@LuaWhitelist
@LuaMethodDoc("model_part.remove")
public FiguraModelPart remove() {
if (parent != null)
this.parent.removeChild(this);

return this;
}

@LuaWhitelist
@LuaMethodDoc(
overloads = @LuaMethodOverload(
Expand Down
1 change: 1 addition & 0 deletions common/src/main/resources/assets/figura/lang/en_us.json
Expand Up @@ -1280,6 +1280,7 @@
"figura.docs.model_part.add_task": "Adds the given Render Task on this part",
"figura.docs.model_part.get_task": "Gets the Render Task with the given name from this part\nReturns a table with all tasks if a name is not given",
"figura.docs.model_part.remove_task": "Removes the Task with the given name from this part\nRemoves ALL tasks if a name is not given",
"figura.docs.model_part.remove": "Removes this part from the parent model part",
"figura.docs.model_part.get_vertices": "Return a table with all vertices from the given texture id\nReturns nil if no vertices were found",
"figura.docs.model_part.get_all_vertices": "Return a table of all texture ids and their vertices",
"figura.docs.model_part.move_to": "Moves this part to be a child of the given part",
Expand Down

0 comments on commit 11720d1

Please sign in to comment.