
# -> Globalize if the heated wrought iron has interaction indicators active
scoreboard players set #or.heated_wrought_iron_has_indicators OverlyRealistic.General.ArbitraryData 0
execute if entity @s[tag=OverlyRealistic.Block.HeatedWroughtIron_HasIndicators] run \
    scoreboard players set #or.heated_wrought_iron_has_indicators OverlyRealistic.General.ArbitraryData 1

# -> Reset completion value
scoreboard players set #or.heated_wrought_iron_completion_status OverlyRealistic.General.ArbitraryData 0

# -> Reset current shape if there is none
execute unless score @s OverlyRealistic.World.HeatedWroughtIron_CurrentShape matches 0.. run \
    scoreboard players set @s OverlyRealistic.World.HeatedWroughtIron_CurrentShape 0

# -> Reset globalized current shape
scoreboard players set #or.globalized_hwi_shape OverlyRealistic.World.HeatedWroughtIron_CurrentShape 0

# -> Operate on player
execute on target \
    if items entity @s weapon.mainhand *[custom_data~{IsForgingHammer:1b}] run \
        function overly_realistic:general/custom_blocks/heated_wrought_iron/player_interact_with_heated_wrought_iron

# -> If completion value = 0 then return
execute if score #or.heated_wrought_iron_completion_status OverlyRealistic.General.ArbitraryData matches 0 run \
    return fail

# -> Method 6 (Activate indicators)
execute if score #or.heated_wrought_iron_completion_status OverlyRealistic.General.ArbitraryData matches 6 \
    unless entity @s[tag=OverlyRealistic.Block.HeatedWroughtIron_HasIndicators] run \
        return run \
            function overly_realistic:general/custom_blocks/heated_wrought_iron/method_operations/method_activate_indicators
