# # ----| USAGE # # The script will automatically look for new and removed regions whenever you # use the WorldGuard "/region" command. All regions are then converted to # notable cuboids. # # If you wish to manually convert regions, you can run the task script # "worldguard_regions_to_notable_cuboids" # # All notable cuboids created by this script will have names following this # template: # wgregion_W__R_ # # You can then use these new notable regions in events, commands, tags, etc. # # worldguard_regions_to_notable_cuboids: type: task debug: false speed: 0 script: - flag server worldguard_to_notable_cuboids:! - foreach as:w: - foreach <[w].list_regions> as:r: - note <[r].cuboid> as:wgregion_W_<[w].name>_R_<[r].id> - flag server worldguard_to_notable_cuboids:->:<[r]> - foreach ]>: - note remove as:<[value]> worldguard_regions_to_notable_cuboids_evts: type: world debug: false events: on rg|region command: - wait 1t - if "]>": - define rg_list li@ - foreach : - define rg_list <[rg_list].include[<[value].list_regions>]> - define add li@ - foreach <[rg_list].exclude[]>: - note <[value].cuboid> as:wgregion_W_<[value].world.name>_R_<[value].id> - define add <[add].include[<[value]>]> - define sub li@ - foreach ]||li@>: - note remove as:wgregion_W_<[value].world.name>_R_<[value].id> - define sub <[sub].include[<[value]>]> - define new_list ].include[<[add]>]||<[add]>> - flag server worldguard_to_notable_cuboids:! - flag server worldguard_to_notable_cuboids:|:<[new_list]>