
# -> Set rain bool
scoreboard players set #or.is_raining_thundering OverlyRealistic.General.ArbitraryData 0
execute if predicate overly_realistic:world/weather/is_raining_thundering run \
    scoreboard players set #or.is_raining_thundering OverlyRealistic.General.ArbitraryData 1

# -> If it is currently night time then set random tick speed
gamerule random_tick_speed 1
execute if score #or.WorldTime_IsNightTime OverlyRealistic.General.ArbitraryData matches 1 run \
    function overly_realistic:general/day_night_cycle/set_night_random_tick_speed_manage

# -> If it is currently raining then set a higher tick speed
execute if score #or.is_raining_thundering OverlyRealistic.General.ArbitraryData matches 1 \
    unless score #or.WorldTime_IsNightTime OverlyRealistic.General.ArbitraryData matches 1 run \
        gamerule random_tick_speed 2

# -> Activate spear loop
schedule function overly_realistic:general/spears/continuous/spear_thrown_loop 1t append

# --> World temperature modifier operations

# -> Reset modifier
scoreboard players set #or.world_temperature_modifier OverlyRealistic.General.ArbitraryData 0

# -> Time modifiers
execute if score #or.WorldTime_IsNoon OverlyRealistic.General.ArbitraryData matches 1 run \
    scoreboard players add #or.world_temperature_modifier OverlyRealistic.General.ArbitraryData 10
execute if score #or.WorldTime_IsNightTime OverlyRealistic.General.ArbitraryData matches 1 run \
    scoreboard players remove #or.world_temperature_modifier OverlyRealistic.General.ArbitraryData 10

# -> Rain modifier
execute if score #or.is_raining_thundering OverlyRealistic.General.ArbitraryData matches 1 run \
    scoreboard players remove #or.world_temperature_modifier OverlyRealistic.General.ArbitraryData 6

# -> Thundering weather modifier
execute if predicate overly_realistic:world/weather/is_thundering run \
    scoreboard players remove #or.world_temperature_modifier OverlyRealistic.General.ArbitraryData 4

# -> Randomized day temperature modifier
scoreboard players operation #or.world_temperature_modifier OverlyRealistic.General.ArbitraryData += #or.randomized_day_temperature_modifier OverlyRealistic.General.ArbitraryData

# -> Function tag
function #overly_realistic:general_loops/main_40t

# -> Loop (2s)
schedule function overly_realistic:general/main_loops/main_loop_40t 40t
