"Heavens Portal Creation": type: world debug: false events: on player right clicks quartz_block with flint_and_steel in prosperus: - if != m@air { - queue clear } - if == m@quartz_block && == m@quartz_block { - define axis-pos l@1,0,0 - define axis-neg l@-1,0,0 - define axis-data 1 } else if == m@quartz_block && == m@quartz_block { - define axis-pos l@0,0,1 - define axis-neg l@0,0,-1 - define axis-data 2 } else { - queue clear } - define origin - define node - define air-list li@ - define y-list li@ - define y-max - define y-min - define x-max - define x-min - define z-max - define z-min - while { - define air-list ]> - define y-list ]> - define y-max ]> - define y-min ]> - define node } - if != m@quartz_block { - queue clear } else { - foreach { - define node - while { - define air-list ]> - if == 1 { - define x-max ]> - define x-min ]> } - if == 2 { - define z-max ]> - define z-min ]> } - define node ]> } - if != m@quartz_block { - queue clear } - define node - while { - define air-list ]> - if == 1 { - define x-max ]> - define x-min ]> } - if == 2 { - define z-max ]> - define z-min ]> } - define node ]> } - if != m@quartz_block { - queue clear } } } - modifyblock m@end_gateway, no_physics # - announce to_console "cu@]>,,]>,prosperus|]>,,]>,prosperus as:heavens-portal-" - note cu@]>,,]>,prosperus|]>,,]>,prosperus as:heavens-portal- "Heavens Portal Removal": type: world debug: false events: on player breaks end_gateway: - if { - define notable - modifyblock m@air - note remove as: } on player breaks quartz_block: - if { - define notable - modifyblock m@air - flag server :! - note remove as: } "Heavens Portal Entry": type: world debug: false events: on player enters notable cuboid: - if { - define target-location l@,,,heavens # - announce to_console "def target-location: " - define target-material # - announce to_console "def target-material: " - define portal # - announce to_console "def portal: " - define portal-exit # - announce to_console "def portal-exit: " - define portal-unsafe-exit -unsafe # - announce to_console "def portal-unsafe-exit: " # - wait 1t - if ]> { - wait 1t - teleport ]> - queue clear } - if ]> { - wait 1t - teleport ]> # - announce to_console "teleport ]>" - if != m@elytra { - flag player-gliding-chestplate: - announce to_console "Giving player temporary elytra, player chestplate was " - narrate "<&a>You channel aerial magic to conjure a temporary elytra! Be sure to land safely, using fireworks with this elyta is too unstable to be safe!" - wait 1t - equip chest:elytra } - adjust gliding:true - queue clear } - if == m@air && != m@air && == m@air { - announce to_console "Initial block is safe" - define teleport-location l@,,,heavens - wait 1t - teleport # - announce to_console "teleport " - flag server : - queue clear } - define size 20 - if ].size> >= 1 { - announce to-console "Finding safe spot" - define safe-spot ].random> - announce to_console "Safe spot: " - wait 1t - teleport # - announce to_console "teleport " - flag server : - queue clear } else { - announce to_console "No safe spot, let's glide!" - flag server :l@,100,,heavens - define teleport-location l@,100,,heavens - wait 1t - teleport # - announce to_console "teleport " - if != m@elytra { - flag player-gliding-chestplate: - announce to_console "Giving player temporary elytra, player chestplate was " - narrate "<&a>You channel aerial magic to conjure a temporary elytra! Be sure to land safely, using fireworks with this elyta is too unstable to be safe!" - wait 1t - equip chest:elytra } - adjust gliding:true - queue clear } # - determine cancelled } on player stops gliding in heavens: - if { - equip chest: - flag player-gliding-chestplate:! } on player clicks in inventory: - if && == 39 { - narrate "<&c>You can change your chestplate after landing!" - determine cancelled } on player right clicks with firework in heavens: - if { - narrate "<&c>You can only use fireworks with your own elytra!" - determine cancelled } #"Portal Gliding Handler": # type: world # debug: false # events: # on player stops gliding in heavens: # - if # { ## - flag portal-exiter:! # - determine cancelled # } ## - determine cancelled # on player starts gliding in heavens: # - if # { ## - flag portal-exiter:! # - determine cancelled:false # }