Skip to content

Commit

Permalink
feat: add McServerLib#getWorld(String) to get world by name
Browse files Browse the repository at this point in the history
  • Loading branch information
Apehum committed Jan 29, 2025
1 parent aa9f3ce commit 9c2dfb4
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ interface McServerLib : McLib {
*/
fun executeInMainThread(runnable: Runnable)

/**
* Gets a world by name.
*
* @param name The world name
* @return The world or null.
*/
fun getWorld(name: String): McServerWorld? =
worlds.firstOrNull { it.name == name }

/**
* Gets a world by server-specific instance.
*
Expand Down

0 comments on commit 9c2dfb4

Please sign in to comment.