Date: 2018/06/04 15:04:01 UTC-07:00
Type: Denizen Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#
# ----| USAGE
#
# It's easy as running this command:
# /ex run worldguard_regions_to_notable_cuboids
#
# It will automatically convert all WorldGuard regions to
# notable cuboids, so you can use cuboids with this name
# format:
#
# wgregion_W_<world name>_R_<region name>
#
# You can then use these new notable regions in events,
# commands, tags, etc.
#
#
# ----| NOTE
#
# Every time you create, edit, or delete a WorldGuard region,
# you will need to rerun this script to update the notable
# cuboids as well.
#
#
worldguard_regions_to_notable_cuboids:
type: task
debug: false
speed: 0
script:
- define c_list 'li@'
- foreach <server.list_worlds> {
- define w '<def[value]>'
- foreach <def[w].list_regions> {
- note <def[value].cuboid> 'as:wgregion_W_<def[w].name>_R_<def[value].id>'
- define c_list '<def[c_list].include[cu@wgregion_W_<def[w].name>_R_<def[value].id>]>'
}
}
- foreach <server.list_notables[cuboids].filter[starts_with[cu@wgregion_]].exclude[<def[c_list]>]> {
- note remove as:<def[value]>
}