
# -> If there are no items on the basket then return
execute unless score @s OverlyRealistic.World.BlockItemAmount matches 1.. run \
    return run \
        function overly_realistic:general/custom_blocks/basket/interactions/stir_interactions/mushroom_base/stew_create_none

# -> Reset has_ingridient IDs
scoreboard players set #or.mushroom_additional_has_ingridient_1 OverlyRealistic.General.ArbitraryData 0
scoreboard players set #or.mushroom_additional_has_ingridient_2 OverlyRealistic.General.ArbitraryData 0
scoreboard players set #or.mushroom_additional_has_ingridient_3 OverlyRealistic.General.ArbitraryData 0

# -> Reset storage data
data merge storage overly_realistic:items {basket_mushroom_base_items:{ingredient_1:0b,ingredient_2:0b,ingredient_3:0b}}

# -> Check recipes [Type 1 ingredients]
function overly_realistic:general/custom_blocks/basket/interactions/stir_interactions/mushroom_base/ingredient_add_type_1

# -> Check recipes [Type 2 ingredients]
function overly_realistic:general/custom_blocks/basket/interactions/stir_interactions/mushroom_base/ingredient_add_type_2

# -> Check recipes [Type 3 ingredients]
function overly_realistic:general/custom_blocks/basket/interactions/stir_interactions/mushroom_base/ingredient_add_type_3

# -> If there are no ingredients then return and create a none stew
execute if score #or.mushroom_additional_has_ingridient_1 OverlyRealistic.General.ArbitraryData matches 0 \
    if score #or.mushroom_additional_has_ingridient_2 OverlyRealistic.General.ArbitraryData matches 0 \
    if score #or.mushroom_additional_has_ingridient_3 OverlyRealistic.General.ArbitraryData matches 0 run \
        return run \
            function overly_realistic:general/custom_blocks/basket/interactions/stir_interactions/mushroom_base/stew_create_none

# -> Advancement
execute on target run \
    advancement grant @s only overly_realistic:advancements/basket_uses/great_healthcare

# -> Reward user with healthcare XP
execute on target run \
    function overly_realistic:players/wisdom/healthcare/add_to_skill_xp_c_create_sus_stew

# -> Store has_ingredient values
execute store result score @s OverlyRealistic.World.BasketMushroomAdditionalIngredientId_1 run \
    scoreboard players get #or.mushroom_additional_has_ingridient_1 OverlyRealistic.General.ArbitraryData
execute store result score @s OverlyRealistic.World.BasketMushroomAdditionalIngredientId_2 run \
    scoreboard players get #or.mushroom_additional_has_ingridient_2 OverlyRealistic.General.ArbitraryData
execute store result score @s OverlyRealistic.World.BasketMushroomAdditionalIngredientId_3 run \
    scoreboard players get #or.mushroom_additional_has_ingridient_3 OverlyRealistic.General.ArbitraryData

# -> Remove items
function overly_realistic:general/custom_blocks/basket/interactions/int_remove_all_items_no_drop

# -> Set liquid
function overly_realistic:general/custom_blocks/basket/interactions/set_liquid/set_suspicious_stew_general

# -> Set additional
function overly_realistic:general/custom_blocks/basket/interactions/set_additional/set_suspicious_add_general

# -> Set data
tag @s add OverlyRealistic.Block.Basket_RequiresBowl
scoreboard players set @s OverlyRealistic.World.BasketBowlContentsId 2
