KotlinBukkitAPI icon indicating copy to clipboard operation
KotlinBukkitAPI copied to clipboard

Support Coroutines Flow in Menu DSL

Open DevSrSouza opened this issue 4 years ago • 0 comments

The Menu DSL should support Coroutines Flow.

For slots could be something like this:

val stateFlow: StateFlow<ItemStack>

slot(1, 5, null) {
  onRender {
     showingItem = stateFlow.value
  }
  onFlowChange(stateFlow) { value ->
    showingItem = value
    player.msg("Hi!")
  }
}

DevSrSouza avatar Dec 15 '20 19:12 DevSrSouza