
# -> If there is water filled then return
execute if entity @s[tag=!OverlyRealistic.Block.Basket_IsWaterLogged] run \
    return fail

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

# -> Reset liquid type
scoreboard players set #or.basket_contents_liquid_type OverlyRealistic.General.ArbitraryData 0

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

# -> Remove liquid
function overly_realistic:general/custom_blocks/basket/interactions/set_liquid/remove_liquid

# LIQUID TYPES
# 1 = clean water
# 2 = dirty water
# 3 = sea water
# 4 = sweet berry drink
# 5 = sweetened sweet berry drink

# -> Globalize liquid type
scoreboard players operation #or.globalized_basket_liquid_type OverlyRealistic.General.ArbitraryData = @s OverlyRealistic.World.BasketLiquidType

# -> Operate on player
execute on target \
    if entity @s[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
