Skip to content

Commit

Permalink
getGuiParent
Browse files Browse the repository at this point in the history
  • Loading branch information
andantet committed Sep 22, 2024
1 parent dc058d1 commit 52350c8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ audience_version=2.1.3
sgui_version=1.5.1+1.20.5

# Mod Properties
mod_version=1.2.0
mod_version=1.2.1
maven_group=net.mcbrawls
mod_id=brawls-sgui

Expand Down
8 changes: 8 additions & 0 deletions src/main/kotlin/net/mcbrawls/sgui/ParentedGui.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ interface ParentedGui {
return this
}

/**
* Gets this GUI's parent GUI.
*/
fun GuiInterface.getGuiParent() : GuiInterface? {
val parented = this as? ParentedGui ?: return null
return parented.parent
}

/**
* Opens a GUI's parent GUI.
*/
Expand Down

0 comments on commit 52350c8

Please sign in to comment.