Skip to content

Commit

Permalink
[6.1.0][dev] 更新 UI 模块
Browse files Browse the repository at this point in the history
  • Loading branch information
Bkm016 committed Jan 28, 2024
1 parent 098cf3f commit 3e5152d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ fun enableRawTitleInVanillaInventory() {
* 构建一个菜单
*/
inline fun <reified T : Menu> buildMenu(title: String = "chest", builder: T.() -> Unit): Inventory {
val impl = Menu.getImplementation(T::class.java)
val instance = impl.getDeclaredConstructor(String::class.java).newInstance(title) as T
val type = if (T::class.java.isInterface) Menu.getImplementation(T::class.java) else T::class.java
val instance = type.getDeclaredConstructor(String::class.java).newInstance(title) as T
return instance.also(builder).build()
}

Expand Down

0 comments on commit 3e5152d

Please sign in to comment.