
# -> If there is no water filled then return
execute unless block ~ ~ ~ barrier[waterlogged=true] run \
    return fail

# -> Set water
setblock ~ ~ ~ barrier[waterlogged=false]

# -> Sound
playsound item.bucket.fill block @a ~ ~ ~ 0.45 1

# -> If boil time is at max then set value
scoreboard players set #or.equation_part_2 OverlyRealistic.General.ArbitraryData 0
execute if score @s OverlyRealistic.World.BasketBoilTime matches 500.. run \
    scoreboard players set #or.equation_part_2 OverlyRealistic.General.ArbitraryData 1

# -> Cache BasketItems
data modify storage overly_realistic:temp_values temp_basket_items set from entity @s data.BasketItems

# -> If there is a boiled fermented sweet berry base then set value
execute if entity @s[tag=OverlyRealistic.Block.Basket_Status_HasFermentedBoiledSweetBerryBase] run \
    scoreboard players set #or.equation_part_2 OverlyRealistic.General.ArbitraryData 2
execute if entity @s[tag=OverlyRealistic.Block.Basket_Status_HasFermentedBoiledSweetBerryBase] \
    if data storage overly_realistic:temp_values \
        {\
            temp_basket_items:\
                [\
                    {id:"minecraft:sugar"},{id:"minecraft:sugar"},{id:"minecraft:sugar"},\
                    {id:"minecraft:sugar"},{id:"minecraft:sugar"},{id:"minecraft:sugar"},\
                    {id:"minecraft:sugar"},{id:"minecraft:sugar"},{id:"minecraft:sugar"}\
                ]\
        } run \
            scoreboard players set #or.equation_part_2 OverlyRealistic.General.ArbitraryData 3

# -> Operate on player
execute as @p[tag=OverlyRealistic.Player.TempPlayer,gamemode=!creative] run \
    function overly_realistic:general/custom_blocks/basket/interactions/int_get_water_local

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