Can now fill empty sacks with hay.

This commit is contained in:
ceikry
2021-07-15 07:17:16 -05:00
parent 1f958d7813
commit 3975b7ef0f
@@ -0,0 +1,21 @@
package rs09.game.interaction.item.withobject
import api.Container
import api.ContentAPI
import org.rs09.consts.Items
import rs09.game.interaction.InteractionListener
class SackOnHay : InteractionListener() {
val SACK = Items.EMPTY_SACK_5418
val HAY = intArrayOf(36892, 36894, 36896, 300, 34593, 298, 299)
override fun defineListeners() {
onUseWith(SCENERY, SACK, *HAY){player, used, _ ->
if(ContentAPI.removeItem(player, used.asItem(), Container.INVENTORY)){
ContentAPI.addItem(player, Items.HAY_SACK_6057, 1)
ContentAPI.sendMessage(player, "You fill the sack with hay.")
}
return@onUseWith true
}
}
}