A Player parameter has been added to the logic parameter of QueueTask.produceItemBox. This allows users to easily use method references to handle actions rather than relying on the context of the QueueTask, ie:
fun smeltItem(player: Player, item: Int, amount: Int) {
player.message("item=$item, amount=$amount")
}
on_obj_option(obj = 24009, option = "smelt") {
player.queue { produceItemBox(Items.BRONZE_BAR, title = "What would you like to smelt?", logic = ::smeltItem) }
}
What has been done?
A
Player
parameter has been added to thelogic
parameter ofQueueTask.produceItemBox
. This allows users to easily use method references to handle actions rather than relying on the context of theQueueTask
, ie:Proposed Changes
logic: (Player, Int, Int) -> Unit