@@ -31,6 +31,26 @@ inline fun IngredientsDsl.ingredients(run: IngredientsDsl.() -> Unit) {
3131 IngredientsDslImpl ((this as IngredientsDslImpl ).buildPresets()).run ()
3232}
3333
34+ @ExperimentalDslApi
35+ data class InventoryWithBackground (
36+ val inventory : Inventory ,
37+ val background : ItemProvider
38+ )
39+
40+ @ExperimentalDslApi
41+ data class InventoryWithBackgroundProvider (
42+ val inventory : Inventory ,
43+ val background : Provider <ItemProvider >
44+ )
45+
46+ @ExperimentalDslApi
47+ infix fun Inventory.with (background : ItemProvider ): InventoryWithBackground =
48+ InventoryWithBackground (this , background)
49+
50+ @ExperimentalDslApi
51+ infix fun Inventory.with (background : Provider <ItemProvider >): InventoryWithBackgroundProvider =
52+ InventoryWithBackgroundProvider (this , background)
53+
3454@GuiDslMarker
3555@ExperimentalDslApi
3656sealed interface IngredientsDsl {
@@ -52,6 +72,10 @@ sealed interface IngredientsDsl {
5272 infix fun Char.by (element : SlotElement )
5373
5474 infix fun Char.by (inventory : Inventory )
75+
76+ infix fun Char.by (inventory : InventoryWithBackground )
77+
78+ infix fun Char.by (inventory : InventoryWithBackgroundProvider )
5579
5680 infix fun Char.by (gui : Gui )
5781
@@ -130,6 +154,14 @@ internal open class IngredientsDslImpl(
130154 override fun Char.by (inventory : Inventory ) {
131155 ingredients.addIngredient(this , inventory)
132156 }
157+
158+ override fun Char.by (inventory : InventoryWithBackground ) {
159+ ingredients.addIngredient(this , inventory.inventory, inventory.background)
160+ }
161+
162+ override fun Char.by (inventory : InventoryWithBackgroundProvider ) {
163+ ingredients.addIngredient(this , inventory.inventory, inventory.background)
164+ }
133165
134166 override fun Char.by (gui : Gui ) {
135167 ingredients.addIngredient(this , gui)
0 commit comments