Date: 2024/06/06 04:16:22 UTC-07:00
Type: Denizen Script
fire_spread_handler:
type: world
events:
# Only allow blocks flagged with fire_spread_block to be broken by fire
on block burns:
- if <context.location.has_flag[fire_spread_block]>:
- modifyblock <context.location> fire
- wait 2.5m
- modifyblock <context.location> <context.material>
- stop
- determine cancelled
after block ignites:
- if !<context.location.below.has_flag[fire_spread_block]> && !<context.location.above.has_flag[fire_spread_block]> && !<context.location.left.has_flag[fire_spread_block]> && !<context.location.right.has_flag[fire_spread_block]> && !<context.location.forward.has_flag[fire_spread_block]> && !<context.location.backward.has_flag[fire_spread_block]>:
- announce "noflagged bklock"
- modifyblock <context.location> air
- stop
- foreach <context.location.material.faces> as:face:
- define vec <[face].proc[faces_to_normal_vec]>
- if !<context.location.sub[<[vec]>].has_flag[fire_spread_block]>:
- define no_fire_faces:->:<context.location.sub[<[vec]>]>
# If all the faces arent connected to a fire block, stop
- if <[no_fire_faces].size||-1> == <context.material.faces.size>:
- announce "noflagged bklock22"
- modifyblock <context.location> air