Implementation of Compose scenes for Minecraft


Link copied to clipboard
class MinecraftComposeGui(    val blockWidth: Int,     val blockHeight: Int,     val content: @Composable BoxScope.(gui: MinecraftComposeGui) -> Unit,     val player: ServerPlayer,     val position: BlockPos) : CoroutineScope

A server-side gui making use of Compose and Compose UI. You may create this gui using displayComposable. Internally, the gui is rendered on maps, which are placed inside invisible item frames. Everything only happens through packets, therefore the gui does not really exist on the server. If you want to remove this gui, call the close function.


Link copied to clipboard
fun ServerPlayer.displayComposable(    blockWidth: Int,     blockHeight: Int,     position: BlockPos = blockPosition().relative(direction, 2),     content: @Composable BoxScope.(gui: MinecraftComposeGui) -> Unit): MinecraftComposeGui

Creates a new server-side MinecraftComposeGui. This allows you to use any composable functions inside the content lambda of this function.