Paste #35185: Diff note for paste #35184

Date: 2016/08/01 21:03:07 UTC-07:00
Type: Diff Report

View Raw Paste Download This Paste
Copy Link


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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909


 ################################################################################
 #
 #                            d W o r l d E d i t o r
 #
 #
 #   Authors: |Anthony|, mcmonkey
-#   Version: 0.31
+#   Version: 0.32
 #   dScript Version: 0.9.8-DEV-b611
 #
 #
 #
 #--------------------------------------
 #
 #--- About this script
 #
 #   dWorldEditor is a world editing system written with the Denizen Scripting
 #  Engine. Currently, it offers a robust set of area selection tools, a rich
 #  command interface, and TAB completion for all commands. The in game help
 #  system is complete with explanations, usage, and examples.
 #
 #   The dWE Wand item provides an easy "click click" method for selecting a
 #  cuboid. It has two modes currently, cuboid and extender. The selection wand
 #  and other tools are very solid.
 #
 #   Other scripts can easily use the wand by simply getting the region selection
 #  from the flag <player.flag[dWEWand]> like so:
 #    - define pos1 '<player.flag[dWEWand].as_list.get[1]||null>'
 #    - define pos2 '<player.flag[dWEWand].as_list.get[2]||null>'
 #    - define cuboid 'cu@%pos1%|%pos2%'
-#
-#  * This is a BETA release of dWE and should only be used for the selection
-#    wand which is required by dRegions.
 #
 #   Has my work helped you in some way? Show your support by clicking the
 #    Like button.
 #   Feeling generous? Get me a coffee :D
 #    https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=NPXKHCNMTGSUG
 #
 #--------------------------------------
 #
 #  dWorldEditor Permissions and Commands
 #
 #    Every command in dWorldEditor has its own dwe.<command> permission. There
 #  are also some permission nodes that apply to a group of related commands such
 #  as dwe.select to grant permission for all selection related commands.
 #
 #    Commands in dWorldEditor can be run as an argument of the /dwe command OR
 #  can be run by their shorthand slash dot version like so: /.help
 #
 #  Command                                    Permission            Description
 #
 #  /dwe help (<arg> <#>)                      -none-                  The root command will show a list
 #                                                                   of all dWE commands you have permission
 #                                                                   to use. You can specify a command to
 #                                                                   get help for and a page number.
 #
 #  /dwe about (<#>)                           -none-                  Learn about the project.
 #
 #  /dwe wand (-type [cuboid/extender])        dwe.admin               Give yourself the selection wand.
 #                                             dwe.select            You can also specify the wand type.
 #                                             dwe.wand
 #
 #  /dwe show                                  dwe.admin               Shows an outline of your selection.
 #                                             dwe.select            Currently shows blue stained glass for
 #                                             dwe.show              10 seconds but that will change later.
 #
 #  /dwe chunk                                 dwe.admin               Marks the chunk you are standing in
 #                                             dwe.select            as your selection.
 #                                             dwe.chunk
 #
 #  /dwe contract [<#>] (<direction>)          dwe.admin               Contracts your selection by the given
 #                                             dwe.select            amount in the specified direction. If no
 #                                             dwe.contract          direction is given, it contracts in the
 #                                                                   direction you are looking.
 #
 #  /dwe expand [<#>] (-v) (<direction>)       dwe.admin               Expands your selection by the given
 #                                             dwe.select            amount in the specified direction. If
 #                                             dwe.expand            no direction is given, it expands in
 #                                                                   the direction you are looking. Optionally
 #                                                                   specify -v for vertical only expansion.
 #
 #  /dwe inset [<#>] (-h)                      dwe.admin               Insets your selection by the given
 #                                             dwe.select            amount in all directions. Optionally
 #                                             dwe.inset             specify -h for horizontal only inset.
 #
 #  /dwe outset [<#>] (-h)                     dwe.admin               Outsets your selection by the given
 #                                             dwe.select            amount in all directions. Optionally -h
 #                                             dwe.outset            for horizontal only inset.
 #
 #  /dwe pos1                                  dwe.admin               Sets the location you are standing on
 #                                             dwe.select            as position 1.
 #                                             dwe.pos
 #
 #  /dwe pos2                                  dwe.admin               Sets the location you are standing on
 #                                             dwe.select            as position 2.
 #                                             dwe.pos
 #
 #  /dwe hpos1                                 dwe.admin               Sets the location you are looking at
 #                                             dwe.select            as position 1.
 #                                             dwe.pos
 #
 #  /dwe hpos2                                 dwe.admin               Sets the location you are looking as
 #                                             dwe.select            as position 2.
 #                                             dwe.pos
 #
 #  /dwe shift [<#>] (<direction>)             dwe.admin               Shifts your selection by the given
 #                                             dwe.select            amount in the specified direction. If
 #                                             dwe.shift             no direction is given, it shifts in
 #                                                                   the direction you are looking.
 #
 #  /dwe copy                                  dwe.admin               Copys your current selection to your
 #                                             dwe.edit              clipboard. The clipboard can hold more
 #                                             dwe.copy              than one item and will survive restarts.
 #
 #  /dwe cut                                   dwe.admin               Just like Copy except your selection
 #                                             dwe.edit              is also removed.
 #                                             dwe.cut
 #
 #  /dwe paste [#] (-a, -w, -l, -p, -d)        dwe.admin               Pastes your current clipboard item. You
 #                                             dwe.edit              can optionally specify a clipboard entry.
 #                                             dwe.paste
 #
 #  /dwe set [<material>(%#)]                  dwe.admin               Sets your current selection to the
 #           ([<x>],(<y>,<z>))                 dwe.edit              material specified. TAB completion works
 #           (-d, -g, -n, -l, -w, -p)          dwe.set               for material names.
 #
 #  /dwe replace [<newMat>(%#)]                dwe.admin               Replace materials in an area with other
 #           [<newMat>(%#)] ([<x>],(<y>,<z>))  dwe.edit              materials. TAB completion works for
 #           (-d, -g, -n, -l, -w, -p)          dwe.set               material names.
 #
 #  /dwe sphere [<material>(%#)]               dwe.admin               Create an ellipsoid of the specified
 #              ([<x>],(<y>,<z>))              dwe.edit              material. If no size values are given, it
 #              (-d, -g, -n, -l, -w, -p)       dwe.sphere            uses the values from the wand.
 #
 #  /dwe undo [#] (-n, -a, -d)                 dwe.admin               Undo previous edits. You can specify
 #                                             dwe.edit              which edit to undo.
 #                                             dwe.undo
 #
 #  /dwe redo [#] (-n, -a, -d)                 dwe.admin               Redo previous edits. You can specify
 #                                             dwe.edit              which undo to redo.
 #                                             dwe.undo
 #
 #  /dwe schem [list/load/unload/save/delete   dwe.admin               Manage and use schematics.
-#             /copy/rename/bind/paste] (-p)              dwe.schematic
+#             /copy/rename/bind/paste] (-p)   dwe.schematic
 #
 #-------------------------------------------------------------------------------
 #
 #  Schematic File Paths & Naming
 #
 #  %p% = <player.uuid> || 'public'
 #  %n% = Display name of the schematic
 #
 # Saves
 #   File: schematics/dWE/saves/%p%/%n%.schematic
 #   Name: dWE_saves_%p%_%n%
 # Copys
 #   File: schematics/dWE/clipboard/%p%/%n%.schematic
 #   Name: dWE_clipboard_%p%_%n%
 # Undos
 #   File: schematics/dWE/undo/%p%/%n%.schematic
 #   Name: dWE_undo_%p%_%n%
 # Redos
 #   File: schematics/dWE/redo/%p%/%n%.schematic
 #   Name: dWE_redo_%p%_%n%
 #
 #-------------------------------------------------------------------------------
 #
 # TODO:
 #  - Editing & Clipboard
 #    - Copy (Functional)
 #    - Paste (Functional)
 #    - Replace (Functional)
 #    - Stack
 #    - Rotate
 #    - Undo (Functional)
 #    - Redo (Functional)
 #    - Schematics (Functional)
 #      - Still needs rotation and flipping
 #  - Config File
 #    - Maxblocks to change per operation
 #    - Undo history size
 #    - async-blockedit
 #    - hpos max distance
 #  - TAB Completion
 #    - There is only sparse implementation and it's bugging me m(._.)m
 #  - Drag command
 #    - Turning on drag displays a selection outline and updates (on player move
 #      or every second). Selection area stays in the same relative location to
 #      the player as it was when enabled regardless of the players new location.
 #
 #
 ################################################################################
 #
 #  dWorldEditor Version
 #
 #  Handles dWE Versioning Checks
 #
 dWE_Version:
   type: version
   author: Anthony
   name: dWorldEditor
-  version: 0.31
+  version: 0.32
   description: Denizen World Editor
   id: 22
 #
 #  END dWorldEditor Version
 #--------------------------------------
 #
 #
 ################################################################################
 #
 #  dWorldEditor Events
 #
 #  This should cover all dWE related world events.
 #
 dWE_Events:
   type: world
   debug: false
   events:
     on player clicks block:
-      - if !<c.item.scriptname.starts_with[dWE_]||> {
+      - if !<c.item.scriptname.starts_with[dWE_]||false> {
         - queue clear
         }
       - determine passively CANCELLED
       - inject <c.item.scriptname.as_script> instantly
 
     on server start:
       - inject locally load
 
     on reload scripts:
       - run locally load delay:1t
 
     on system time hourly:
-    - wait 1t
 #    - if !<yaml[dWE_config].read[config.stats.useStats]||true> {
 #      - queue clear
 #      }
-    - run locally updateCheck
-    - announce to_console '<&b>dWE<&co><&3> Sending usage metrics...'
-    - webget "http://morphanone.space/webizen.aspx/tracker?script=<s@dWE_Version.yaml_key[id]>&version=<s@dWE_Version.yaml_key[version]>&players=<server.list_online_players.size>&denizen_version=<server.denizen_version.replace[-SNAPSHOT].before[ ]>&jenkins_build=<server.denizen_version.after[(build ].before[)]>&bukkit_version=<server.bukkit_version>"
+    - if <queue.list> !contains 'q@dWE_UpdateCheck' {
+      - run locally delay:1t updateCheck 'id:dWE_UpdateCheck'
+      }
+    - if <queue.list> !contains 'q@dWE_SendMetrics' {
+      - run locally delay:1t sendMetrics 'id:dWE_SendMetrics'
+      }
 
   load:
-    - run locally updateCheck
+    - if <queue.list> !contains 'q@dWE_UpdateCheck' {
+      - run locally delay:1t updateCheck 'id:dWE_UpdateCheck'
+      }
     - flag server 'dWE.Command_List:!'
     - flag server 'dWE.Command_List:|:<server.list_scripts.filter[starts_with[s@dWE_Commands_]].parse[name].parse[after[dWE_Commands_]].alphanumeric.to_lowercase||li@>'
 
   updateCheck:
-    - ^define repoVersion '<proc[dWE_VersionCheck]||unknown>'
+    - ^if !<server.has_flag[dWE.Version.Repo]> {
+      - ~webget "http://www.mcmonkey.org/denizen/repo/version/<s@dWE_Version.yaml_key[id]>" save:page
+      - ^flag server "dWE.Version.Repo:<entry[page].result||unknown>" d:1h
+      }
+    - ^define repoVersion '<server.flag[dWE.Version.Repo]||unknown>'
     - ^define currentVersion '<s@dWE_Version.yaml_key[version]>'
     - ^if '%repoVersion%' == 'unknown' {
       - run s@msgPrefixed instantly 'def:dWE|<&7>Unable to check for update! <&7><&o>%currentVersion%<&7> is installed!'
       }
-      else if '%repoVersion%' == '%currentVersion%' {
-      - run s@msgPrefixed instantly 'def:dWE|<&7>You are up-to-date with version <&o>%repoVersion%<&7>!'
-      }
       else if '%repoVersion%' > '%currentVersion%' {
       - run s@msgPrefixed instantly 'def:dWE|<&7>Update from version <&o>%currentVersion%<&7> to <&o>%repoVersion%<&7>!'
       }
-      else {
+      else if '%repoVersion%' != '%currentVersion%' {
       - run s@msgPrefixed instantly 'def:dWE|<&7>What happened? You are on version <&o>%currentVersion%<&7> and the repo says <&o>%repoVersion%<&7>!'
+      }
+
+  sendMetrics:
+#    - run s@msgPrefixed instantly 'def:dWE|<&3>Sending usage metrics...'
+    - ~webget "http://morphanone.space/webizen.aspx/tracker?script=<s@dWE_Version.yaml_key[id]>&version=<s@dWE_Version.yaml_key[version]>&players=<server.list_online_players.size>&denizen_version=<server.denizen_version.replace[-SNAPSHOT].before[ ]>&jenkins_build=<server.denizen_version.after[(build ].before[)]>&bukkit_version=<server.bukkit_version>" 'save:send'
+    - if !<entry[send].result.starts_with[SUCCESS]||false> {
+      - run s@msgPrefixed instantly 'def:dWE|<&c>Metrics failed!'
       }
 #
 #  END dWorldEditor Events
 #--------------------------------------
 #
 #
 ################################################################################
 #
 #  dWorldEditor Messages
 #
 # This is the house for various output messages
 #
 # - These may or may not get moved to their respective command scripts
 #
 #--------------------------------------
 #
 dWE_Msg:
   type: item
   debug: false
   material: i@human_skull
   display name: "<&4>     [<&6>dWE<&4>]"
   lore:
   - <&5>Click for Help
   script:
     - run s@msgPrefixed 'def:dWE|%1%'
 
   set_Pos:
     - run s@msgPrefixed 'def:dWE|<&f>POS%pos%<&co>  <&3><&o><def[pos%pos%].replace[,].with[<&7>, <&3><&o>]>  <&7>(<&o><proc[selectionSize].context[%pos1%|%pos2%]><&7>)'
 
   set_pos1:
     - run s@msgPrefixed 'def:dWE|<&f>Selection started at <&3><&o><def[cuboid].min.simple.replace[,].with[<&7>,<&3><&o>]>'
 
   set_pos2:
     - run s@msgPrefixed 'def:dWE|<&f>Selection expanded to include<&co> <&3><&o><context.location.simple.replace[,].with[<&7>,<&3><&o>]> <&7>(<&o><proc[selectionSize].context[%pos1%|%pos2%]><&7>)'
 
   shift:
     - run s@msgPrefixed 'def:dWE|<&f>Shifted<&f>  <&7><&o>%direction% <&7>by <&o>%n% <&7>blocks (<&o><proc[selectionSize].context[%pos1%|%pos2%]><&7>)'
 
   expand:
     - define expandBy '<proc[selectionSize].context[%pos1%|%pos2%].sub[%oldSize%].as_int>'
     - run s@msgPrefixed 'def:dWE|<&f>Expanded<&f>  <&7><&o>%direction% <&7>by <&o>%expandBy% <&7>blocks (<&o><proc[selectionSize].context[%pos1%|%pos2%]><&7>)'
 
   contract:
     - define contractBy '<def[oldSize].sub[<proc[selectionSize].context[%pos1%|%pos2%]>].as_int>'
     - run s@msgPrefixed 'def:dWE|<&f>Contracted<&f>  <&7><&o>%direction% <&7>by <&o>%contractBy% <&7>blocks (<&o><proc[selectionSize].context[%pos1%|%pos2%]><&7>)'
 
   inset:
     - define insetBy '<def[oldSize].sub[<proc[selectionSize].context[%pos1%|%pos2%]>].as_int>'
     - run s@msgPrefixed 'def:dWE|<&f>Inset<&f>  <&7>by <&o>%insetBy% <&7>blocks (<&o><proc[selectionSize].context[%pos1%|%pos2%]><&7>)'
 
   outset:
     - define outsetBy '<proc[selectionSize].context[%pos1%|%pos2%].sub[%oldSize%].as_int>'
     - run s@msgPrefixed 'def:dWE|<&f>Outset<&f>  <&7>by <&o>%outsetBy% <&7>blocks (<&o><proc[selectionSize].context[%pos1%|%pos2%]><&7>)'
 #
 #  END dWorldEditor Messages
 #--------------------------------------
 #
 #
 ################################################################################
 #
 #  dWorldEditor Wand Item
 #
 # This is the house for the wand item
 #
 #
 #--------------------------------------
 #
 dWE_Wand:
   type: item
   debug: false
   material: m@wood_axe
   display name: dWE Region Selector
   lore:
   - <&7><&o>Left<&7> click to start a selection
   - <&7><&o>Right<&7> click to expand the selection
 
   script:
     - if !<player.has_permission[dwe.wand]||<player.is_op>> {
       - take i@dWE_Wand
       - run s@msgPrefixed 'def:dWE|<&4><&l>ERROR<&co> <&a>You should not have this!' instantly
       - queue clear
       }
     - if <c.click_type.is[==].to[LEFT_CLICK_BLOCK]> {
       - define pos 1
       }
       else if <c.click_type.is[==].to[RIGHT_CLICK_BLOCK]> {
       - define pos 2
       }
       else {
       - queue clear
       }
     - define pos1 '<player.flag[dWEWand].as_list.get[1]||null>'
     - define pos2 '<player.flag[dWEWand].as_list.get[2]||null>'
     - define type '<player.flag[dWEWand_Type]||cuboid>'
     - if <li@cuboid|extender.contains[%type%]||false> {
       - inject locally %type%
       }
       else {
       - inject locally cuboid
       }
 
   cuboid:
     - if <context.location.simple.is[==].to[<def[pos%pos%]>]||false> {
       - run s@msgPrefixed 'def:dWE|<&c>pos%pos% is already set'
       - queue clear
       }
     - define pos%pos% '<context.location.simple>'
     - flag player dWEWand:!
     - flag player dWEWand:|:%pos1%|%pos2%
     - inject s@dWE_Msg p:set_Pos
 
   extender:
     - define cuboid cu@%pos1%|%pos2%
     - if %pos% == 1 {
       - define cuboid cu@<context.location.simple>|<context.location.simple>
       }
       else {
       - if %pos1% == null {
         - run s@msgPrefixed 'def:dWE|<&c>You must begin a selection before you can expand it.'
         - queue clear
         }
       - define cuboid_old %cuboid%
       - define cuboid <def[cuboid].include[<context.location.simple>]>
       - if <def[cuboid_old]> == <def[cuboid]> {
         - run s@msgPrefixed 'def:dWE|<&c>That position is already included.'
         - queue clear
         }
       }
     - define pos1 '<def[cuboid].min>'
     - define pos2 '<def[cuboid].max>'
     - flag player dWEWand:!
     - flag player dWEWand:|:%pos1%|%pos2%
     - inject s@dWE_Msg p:set_pos%pos%
 #
 #  END dWorldEditor Wand Item
 #--------------------------------------
 #
 #  dWE Tools
 #
 #  All dWE tools should be housed here. Players can bind any action to any tool.
 #
 dWE_Tools:
   type: world
   debug: false
   events:
 
     on player clicks:
-      - if !<c.item.has_nbt[dWE_Tool]> {
+      - if !<c.item.has_nbt[dWE_Tool]||false> {
         - queue clear
         }
       - determine passively CANCELLED
       - define tool '<c.item.nbt[dWE_Tool]>'
       - if !<player.has_permission[dwe.tool.%tool%]||<player.is_op>> || 'li@public|<player.uuid>' !contains '<c.item.nbt[dWE_Owner]>' {
         - take <c.item>
         - run s@msgPrefixed 'def:dWE|<&4><&l>ERROR<&co> <&a>You should not have this!' instantly
         - queue clear
         }
       - inject locally %tool%
 
   schem:
     - choose '<context.click_type.before[_]>':
       - case 'left':
         - if <player.is_sneaking> {
           - define n '1'
           - define entry '<player.flag[dWE.History.Undo].as_list.last.before[/]||null>'
           - define o '<player.flag[dWE.History.Undo].as_list.map_get[%entry%]||null>'
           - define u '<player.uuid>'
           - define t 'Undo'
           - inject s@dWE_PS
           - flag player 'dWE.History.Undo:<-:%entry%/<player.flag[dWE.History.Undo].map_get[%entry%]>'
           - adjust server 'delete_file:schematics/dWE/Undo/%u%/%entry%.schematic'
           - run s@msgPrefixed 'def:dWE|<&7><&o>Undo entry %entry% complete!'
           - queue clear
           }
         - define o '<player.location.cursor_on[50]||null>'
         - if '%o%' == 'null' {
           - queue clear
           }
         - if '<player.target||null>' != 'null' {
           - queue clear
           }
         - define name '<c.item.nbt[dWE_Name]>'
         - define p '<c.item.nbt[dWE_Owner]>'
         - define d '<c.item.nbt[dWE_delayed]>'
         - define a '<c.item.nbt[dWE_noair]>'
         - define v '<proc[dWE_SNV].context[%name%|%p%]>'
         - if '%v%' != '0' {
           - run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%|<player>|%name%'
           - queue clear
           }
         - define cuboid '<schematic[dWE_saves_%p%_%name%].cuboid[%o%]>'
         - if !<proc[dWE_dRegionCheck].context[<def[cuboid].min>|<def[cuboid].max>]> {
           - queue clear
           }
         # Save the existing area for undo history
         - define u '<player.uuid>'
         - define t 'Undo'
         - inject s@dWE_ISN
         # I know i should do logic here, but damnit... empty args shouldn't be a problem if they are optional!
         - ~schematic paste 'name:dWE_saves_%p%_%name%' '%o%' '%cuboid%' %d% %a%
         - run s@msgPrefixed 'def:dWE|Pasted %name%'
       - case 'right':
         - run s@msgPrefixed 'def:dWE|Rotating schematics is currently unsupported!'
 
 ################################################################################
 #
 #  Denizen World Editor Command Script Containers
 #
 # Every command has its own script container. The root command functions mostly
 # as link to specific commands and provides some initial processing.
 #
 #
 #--------------------------------------
 #
 #  dWE Command Script Registrar
 #
 # The root command. Validates minor input and sends to command script.
 #
 dWE_Commands:
   type: command
   debug: false
   name: dwe
   description: Denizen World Editor
   usage: /dwe
   aliases: ''
   allowed help:
   - determine <player.has_permission[dwe.basic]||<player.is_op>>
 
   script:
     - define command '<c.args.get[1].escaped||help>'
     - define commands '<server.flag[dWE.Command_List].as_list||li@>'
     - define args '<c.args.get[2].to[<c.args.size>]||li@>'
     - if !<def[commands].contains[%command%]> || !<proc[dWE_HasPerm_Command].context[%command%|<player||server>]> {
       - inject s@dWE_Commands_Help
       }
     - inject s@dWE_Commands_%command%
 
   tab complete:
     - define command '<c.args.get[1]||>'
     - define commands '<server.flag[dWE.Command_List].as_list||li@>'
     - define args '<c.args.get[2].to[<c.args.size>]||li@>'
     - define spaces '<c.raw_args.to_list.count[ ]||0>'
     - if <def[commands].contains[%command%]> {
       - inject s@dWE_Commands_%command% 'p:tab complete'
       }
       else {
       - define commands '<def[commands].filter[starts_with[%command%]]||%commands%>'
       }
     - foreach %commands% {
       - if !<proc[dWE_HasPerm_Command].context[%command%|<player||server>]> {
         - define commands '<def[commands].exclude[%value%]||%commands%>'
         }
       }
     - if <def[commands].is_empty||true> {
       - determine 'li@'
       }
     - determine '<def[commands]||li@>'
 
 
 # Preprocessors. Does some pre-processing and passes back to the calling command
   prerun:
     - if <c.server||false> {
       - run s@msgPrefixed 'def:dWE|<&c>This command must be run as a player.'
       - queue clear
       }
     - if <c.alias> == '.%command%' {
       - if !<proc[dWE_HasPerm_Command].context[%command%|<player>]> {
         - inject s@dWE_Commands_Help p:helpList
         - queue clear
         }
       - define commands '<server.flag[dWE.Command_List].as_list||li@>'
       - define args "<c.args>"
       }
     - if %preRun% == 'a' {
       - goto 'END'
       }
 
     - define pos1 '<player.flag[dWEWand].get[1].as_location||null>'
     - define pos2 '<player.flag[dWEWand].get[2].as_location||null>'
     - if <def[pos1].is[==].to[null]>
       || <def[pos2].is[==].to[null]> {
       - run s@msgPrefixed 'def:dWE|<&c>No region selected!'
       - queue clear
       }
     - define oldSize '<proc[selectionSize].context[%pos1%|%pos2%]>'
     - define cuboid 'cu@%pos1%|%pos2%'
     - define center '<def[cuboid].center.simple.as_location>'
     - if %preRun% == 'b' {
       - goto 'END'
       }
 
     - define pRange '50'
     - define d '<t[<def[args].filter[starts_with[-d]].is_empty.not||true>]:delayed||>'
     - define g '<t[<def[args].filter[starts_with[-g]].is_empty.not||true>]:no_physics||>'
     - define n '<t[<def[args].filter[starts_with[-n]].is_empty.not||true>]:naturally||>'
     - define s '<def[args].filter[matches[^[0-9,.]+$]].get[1]||0>'
     - define p '<def[args].filter[starts_with[-p]].is_empty.not||false>'
     - define o '<t[<def[args].filter[starts_with[-w]].is_empty.not||true>]:%pos1%||<t[<def[args].filter[starts_with[-l]].is_empty.not||true>]:<player.location.cursor_on[%pRange%].simple>||0>>'
     - define args '<def[args].exclude[-d|-g|-n|-p|-w|-l|%s%]||%args%>'
     - define matlist '<def[args].get[1].split_by[/]||li@>'
     - define mats 'li@'
     - define pcts 'li@'
     - foreach '%matlist%' {
       - define mat '<def[value].split_by[<&pc>].get[1]||null>'
       - if '%mat%' !matches material {
         - run s@msgPrefixed 'def:dWE|<&c>SYNTAX ERROR<&co> <&6> Invalid Material <&c><&o>%mat%'
         - run s@msgPrefixed 'def: |<&6><parse:<s@dWE_Commands_%command%.yaml_key[data.usage]||No usage info available!>>'
         - queue clear
         }
       - define mats '<def[mats].include[%mat%]>'
       - define pct '<def[value].split_by[<&pc>].get[2]||<el@val[100].div[<def[matlist].size>].round_up||100>>'
       - if '%pct%' matches number {
         - define pcts '<def[pcts].include[<def[pct].abs.as_int>]>'
         }
       }
 
     - if <def[mats].is_empty> {
       - run s@msgPrefixed 'def:dWE|<&c>SYNTAX ERROR<&co> <&6> Missing Material'
       - run s@msgPrefixed 'def: |<&6><parse:<s@dWE_Commands_%command%.yaml_key[data.usage]||No usage info available!>>'
       - queue clear
       }
     - if '%s%' == '0' {
     # Only specify material. Sizes are determined by wand selection.
       - define s '<def[cuboid].size.sub[1,1,1].div[2].split_by[,].get[1].to[3].separated_by[,].replace[l@]>'
       }
       else {
       - define s '<def[s].split_by[,].get[1].to[3]>'
       - if <def[s].size> == 2 {
         - run s@msgPrefixed 'def:dWE|<&c>SYNTAX ERROR<&co> <&6> Invalid Size'
         - run s@msgPrefixed 'def: |<&6><parse:<s@dWE_Commands_%command%.yaml_key[data.usage]||No usage info available!>>'
         - queue clear
         }
       - define x '<def[s].get[1].abs>'
       - define y '<def[s].get[2].abs||%x%>'
       - define z '<def[s].get[3].abs||%x%>'
       - define s "%x%,%y%,%z%"
       }
     - mark 'END'
 
 
   prerunB:
     - if %p% {
       - run s@msgPrefixed 'def:dWE|<&c><&o>Showing outline of effected area'
       - showfake '<player.flag[dWE.show].split[/].get[1]||m@blue_stained_glass>' '<def[selection].outline>' to:<player> 'd:<player.flag[dWE.show].split[/].get[2]||10>s'
       - queue clear
       }
     # If using dRegions, check for overlapping regions before editing.
     - if !<server.list_scripts.filter[starts_with[s@dRegions]].is_empty> {
       - if <proc[dRegions_RegionOverlaps].context[<def[selection].replace[cu@].as_list.separated_by[/]>|<def[selection].center.world.name>|<player>]> {
         - run s@msgPrefixed 'def:dWE|<&c>Region selection contains unowned dRegions!'
         - if !<player.permission[dRegions.admin]||<player.is_op||false>> {
           - queue clear
           }
         - run s@msgPrefixed 'def:dWE|<&c>But you are an admin so it is ok!'
         }
       }
 
     # Save the existing area for undo history
     - define o '<def[o]||<def[cuboid].min>>'
     - define t 'Undo'
     - define u '<player.uuid>'
     - inject s@dWE_ISN
 #
 #  END dWE Command Registrar
 #--------------------------------------
 #
 #
 ################################################################################
 #
 #
 #  dWorldEditor Command Scripts
 #
 # This section holds all of the commands for dWorldEditor. The root command /dwe
 # takes many arguments but most of those arguments can also be run as individual
 # commands. This results in dWorldEditor command args having a shorthand version
 # in the form of /.arg
 #
 
 dWE_Commands_Help:
   type: command
   debug: false
   speed: 0
   name: .help
   description: Show dWorldEditor help
   usage: /.help
   aliases: ''
   allowed help:
   - determine <player.has_permission[dwe.basic]||<player.is_op>>
 
   data:
     description:
       - 'This is the help for dWorldEditor. The help files are here to help you. Help yourself by reading the help. It<&sq>s helpful. <&c>Seriously!'
       - ' '
       - 'Thorough TAB completion is available for all dWorldEditor commands, including help. Try it and see!'
     usage: '/dwe help <&lt>arg/<&ns><&gt>'
     examples:
       - '<&f>To show the <&a>second<&f> page of help for the <&2>help<&f> command'
       - '<&sp>'
       - '   <&e>/dwe help <&2>help <&a>2'
       - ' '
       - '<&f>To show the <&a>third<&f> page of the help files'
       - '<&sp>'
       - '   <&e>/dwe help <&a>3'
     permissions: []
 
   tab complete:
     - if !<def[command].exists> {
       - define commands '<server.flag[dWE.Command_List].as_list||li@>'
       - define args "<c.args>"
       }
     - define command '<def[args].get[1].escaped||>'
     - if <def[commands].contains[%command%]> {
       - determine 'li@'
       }
       else {
       - define commands '<def[commands].filter[starts_with[%command%]]||%commands%>'
       }
     - foreach %commands% {
       - if !<proc[dWE_HasPerm_Command].context[%command%|<player||server>]> {
         - define commands '<def[commands].exclude[%value%]||%commands%>'
         }
       }
     - if <def[commands].is_empty||true> {
       - determine 'li@'
       }
     - determine '<def[commands]||li@>'
 
   script:
     - if !<def[command].exists> {
       - define command 'help'
       }
     - define prerun 'a'
     - inject s@dWE_Commands p:prerun
 
     - define arg '<def[args].get[1].escaped||1>'
     - if <def[arg].is[matches].to[number]> {
       - define page '<def[arg].abs.round||1>'
       - inject s@dWE_Commands_Help p:helpList
       - queue clear
       }
     - if <def[commands].contains[%arg%]||false> {
       - define command '%arg%'
       - define page '<tern[<def[args].get[2].is[matches].to[number]||false>]:<def[args].get[2].abs.round>||1>'
       - inject s@dWE_Commands_Help p:helpCommand
       - queue clear
       }
     - inject s@dWE_Commands_Help p:helpList
     - queue clear
 
   helpList:
     # Filter the list of commands this player can use
     # Build the help documentation
     - define commands '<server.flag[dWE.Command_List].as_list||li@>'
     - define helpDoc 'li@'
     - foreach %commands% {
       - if !<proc[dWE_HasPerm_Command].context[%value%|<player||server>]> {
         - define commands '<def[commands].exclude[%value%]>'
         }
         else {
         - define usage '<parse:<s@dWE_Commands_%value%.yaml_key[data.usage]||No usage info available!>>'
         - define usage '<proc[msgTrim].context[40|<def[usage].escaped>]>'
         - define button '<proc[msgCommand].context[<def[value].to_titlecase><&co>|.help %value%|<&a>Click for <&b><def[value].to_titlecase> <&a>help]>'
         - define helpDoc '<def[helpDoc].include[%button%<&sp><&7><parse:<s@dWE_Commands_%value%.yaml_key[description]||Short Description>>|<&e.pad_left[3].with[<&sp>]>%usage%]>'
         }
       }
     - run s@msgBoxed instantly 'def:dwe|<proc[msgCommand].context[<&6>dWorldEditor|.about|<&a>Click to learn<&nl><&a>about the project!]>|<proc[msgCommand].context[<&e>Help|.help|<&a>Go back to main help]> Files|dwe help|<def[page]||1>|52|10|<def[helpDoc].separated_by[|]>'
 
   helpCommand:
     # Help for a specific command
     - define short '<parse:<s@dWE_Commands_%command%.yaml_key[description]||A not so useless description should be here!>>'
     - define desc '<parse:<s@dWE_Commands_%command%.yaml_key[data.description]||A not so useless description should be here!>>'
     - define usage '<parse:<s@dWE_Commands_%command%.yaml_key[data.usage]||No help for you!>>'
     - define examples '<parse:<s@dWE_Commands_%command%.yaml_key[data.examples]||No help for you!>>'
     - define entries '<&7>%short%| |%desc%| |<&b><&n>Usage<&co>| |<&e.pad_left[3].with[ ]>%usage%| |<&3><&n>Examples<&co>| |%examples%'
     - run s@msgBoxed instantly 'def:dwe|<proc[msgCommand].context[<&6>dWorldEditor|.about|<&a>Click to learn<&nl><&a>about the project!]>|<proc[msgCommand].context[<&e>Help|.help|<&a>Go back to main help]> - <def[arg].to_titlecase>|.help %arg%|<def[page]||1>|52|10|%entries%'
 
 dWE_Commands_About:
   type: command
   debug: false
   speed: 0
   name: .about
   description: Details about the project
   usage: /.about
   aliases: ''
 
   data:
     description:
       - 'dWorldEditor is a world editing system written with the Denizen Scripting Engine.'
       - ' '
       - 'Currently, it offers a robust set of area selection tools. The dWE Wand item provides an easy <&dq>click click<&dq> method for selecting a cuboid. It has two modes currently, cuboid and extender.'
       - ' '
       - 'Future development will bring more advanced editing tools, but for now be satisfied with kick-ass selection tools!'
     usage: '/dwe about'
     examples: []
     permissions: []
 
   tab complete:
     - determine 'li@'
 
   script:
     - if !<def[command].exists> {
       - define command 'about'
       }
     - define prerun 'a'
     - inject s@dWE_Commands p:prerun
     - run s@msgBoxed instantly 'def:dwe|<proc[msgCommand].context[<&6>dWorldEditor|.help|<&a>Go back to main help]>|<&e>About|dwe about|<tern[<def[args].get[1].is[matches].to[number]||false>]:<def[args].get[1].abs.round>||1>|52|10|<&7><parse:<s@dWE_Commands_%command%.yaml_key[description]>>| |<parse:<s@dWE_Commands_%command%.yaml_key[data.description]>>'
 
 
 dWE_Commands_Show:
   type: command
   debug: false
   speed: 0
   name: .show
   description: Show your current dWE selection
   usage: /.show
   aliases: ''
 
   data:
     description: 'See an outline of the area you have selected. Currently shows blue stained glass for 10 seconds. The material and time are configurable, but not yet ;)'
     usage: '/dwe show'
     examples: []
     permissions:
       - admin
       - select
       - show
 
   tab complete:
     - determine 'li@'
 
   script:
     - if !<def[command].exists> {
       - define command 'show'
       }
     - define prerun 'b'
     - inject s@dWE_Commands p:prerun
     - showfake <player.flag[dWE.show].split[/].get[1]||m@blue_stained_glass> <cu@%pos1%|%pos2%.outline> to:<player> d:<player.flag[dWE.show].split[/].get[2]||10>s
 
 dWE_Commands_Wand:
   type: command
   debug: false
   speed: 0
   name: .wand
   description: Get the region wand
   usage: /.wand (-type [cuboid/extender])
   aliases: ''
 
   data:
     description:
       - 'The selection wand is the tool that you will use to select an area for editing. There are two types of selection wands to choose from.'
       - ' '
       - 'To use the cuboid selection wand, left click to set position 1 and right click to set position 2.'
       - ' '
       - 'To use the extender selection wand, left click to start the selection area. Subsequent right clicks will expand the selection to include the location you clicked.'
     usage: '/dwe wand (-type [cuboid/extender])'
     examples:
       - '<&f>To give yourself the wand'
       - '  <&e>/dwe wand'
       - ' '
       - '<&f>To change the wand type to extender'
       - '  <&e>/dwe wand -type extender'
     permissions:
       - admin
       - select
       - wand
 
   tab complete:
     - if !<def[command].exists> {
       - if !<proc[dWE_HasPerm_Command].context[wand|<player||server>]> {
         - determine 'li@'
         }
       - define args "<c.args>"
       - define spaces '<c.raw_args.to_list.count[ ].add[1].as_int||0>'
       }
 
     - choose '%spaces%':
       - case '0':
         - determine 'wand -type '
       - case '1':
         - define arg '<def[args].get[1]||>'
         - if '%arg%' != '-type ' {
           - determine '-type '
           }
       - case '2':
         - define arg2 '<def[args].get[2]||>'
         - define arg1 '<def[args].get[1]||>'
         - if '%arg1%' != '-type' {
           - determine 'li@'
           }
         - if 'li@cuboid|extender' contains '%arg2%' {
           - determine 'li@'
           }
           else {
           - determine '<li@cuboid|extender.filter[starts_with[<def[arg2]>]]||li@cuboid|extender>'
           }
       - default:
         - determine 'li@'
 
   script:
     - if !<def[command].exists> {
       - define command 'wand'
       }
     - define prerun 'a'
     - inject s@dWE_Commands p:prerun
 
     - if <def[args].find[-type].is[OR_MORE].than[0]||false> {
       - define type <def[args].get[<def[args].find[-type].add[1].as_int>]||null>
       - if <li@cuboid|extender.contains[%type%]||false> {
         - run s@msgPrefixed 'def:dWE|<&7><&o>Now using the <&f><&o>%type% <&7><&o>selection wand'
         - flag player 'dWEWand_Type:%type%'
         }
         else {
         - run s@msgPrefixed 'def:dWE|<&4><&l>ERROR<&co> <&c>Unknown wand type!'
         - run s@msgPrefixed 'def:dWE|<&c>SYNTAX<&co> <&e>/dwe -type <&6><&lb><&7>cuboid/extender<&6><&rb>'
         }
       - queue clear
       }
     - if <player.inventory.find_imperfect[<i@dWE_Wand>]> != '-1' {
       - run s@msgPrefixed 'def:dWE|<&c>You already have a wand!'
       }
       else {
       - give i@dWE_Wand
       }
     - define type '<player.flag[dWEWand_Type]||cuboid>'
     - choose '%type%':
       - case 'cuboid':
         - run s@msgPrefixed 'def:dWE|<&a>Left click to select pos1'
         - run s@msgPrefixed 'def:dWE|<&a>Right click to select pos2'
       - case 'extender':
         - run s@msgPrefixed 'def:dWE|<&a>Left click to start a selection,'
         - run s@msgPrefixed 'def:dWE|<&a>Right click to expand the selection.'
       - default:
         - run s@msgPrefixed 'def:dWE|<&4><&l>ERROR<&co> <&c>Unknown wand type!'
         - run s@msgPrefixed 'def:dWE|<&c>SYNTAX<&co> <&e>/dwe -type <&6><&lb><&7>cuboid/extender<&6><&rb>'
     - queue clear
 
 dWE_Commands_Pos1:
   type: command
   debug: false
   speed: 0
   name: .pos1
   description: Set position 1
   usage: /.pos1
   aliases: ''
 
   data:
     description: 'Sets the location you are standing at as position 1. This will be the block above the block you are standing on.'
     usage: '/dwe pos1'
     examples: []
     permissions:
       - admin
       - select
       - pos
 
   tab complete:
     - determine 'li@'
 
   script:
     - if !<def[command].exists> {
       - define command 'pos1'
       }
     - define prerun 'a'
     - inject s@dWE_Commands p:prerun
 
     - define pos1 '<player.flag[dWEWand].as_list.get[1]||null>'
     - if <player.location.simple.is[==].to[%pos1%]> {
       - run s@msgPrefixed 'def:dWE|<&c>pos1 is already set'
       - queue clear
       }
     - define pos1 '<player.location.simple>'
     - define pos2 '<player.flag[dWEWand].as_list.get[2]||null>'
     - flag player dWEWand:!
     - flag player dWEWand:|:%pos1%|%pos2%
     - define pos 1
     - inject s@dWE_Msg p:set_Pos
 
 dWE_Commands_Pos2:
   type: command
   debug: false
   speed: 0
   name: .pos2
   description: Set position 2
   usage: /.pos2
   aliases: ''
 
   data:
     description: 'Sets the location you are standing at as position 2. This will be the block above the block you are standing on.'
     usage: '/dwe pos2'
     examples: []
     permissions:
       - admin
       - select
       - pos
 
   tab complete:
     - determine 'li@'
 
   script:
     - if !<def[command].exists> {
       - define command 'pos2'
       }
     - define prerun 'a'
     - inject s@dWE_Commands p:prerun
 
     - define pos2 '<player.flag[dWEWand].as_list.get[2]||null>'
     - if <player.location.simple.is[==].to[%pos2%]> {
       - run s@msgPrefixed 'def:dWE|<&c>pos2 is already set'
       - queue clear
       }
     - define pos1 '<player.flag[dWEWand].as_list.get[1]||null>'
     - define pos2 '<player.location.simple>'
     - flag player dWEWand:!
     - flag player dWEWand:|:%pos1%|%pos2%
     - define pos 2
     - inject s@dWE_Msg p:set_Pos
 
 dWE_Commands_Hpos1:
   type: command
   debug: false
   speed: 0
   name: .hpos1
   description: Set position 1
   usage: /.hpos1
   aliases: ''
 
   data:
     description: 'Sets the location you are looking at as position 1. Has a range of 160 blocks and will not target air unless that range has been met.'
     usage: '/dwe hpos1'
     examples: []
     permissions:
       - admin
       - select
       - pos
 
   tab complete:
     - determine 'li@'
 
   script:
     - if !<def[command].exists> {
       - define command 'hpos1'
       }
     - define prerun 'a'
     - inject s@dWE_Commands p:prerun
 
     - define pos1 '<player.flag[dWEWand].as_list.get[1]||null>'
     - if <player.location.cursor_on[160].simple.is[==].to[%pos1%]> {
       - run s@msgPrefixed 'def:dWE|<&c>pos1 is already set'
       - queue clear
       }
     - define pos1 '<player.location.cursor_on[160].simple>'
     - define pos2 '<player.flag[dWEWand].as_list.get[2]||null>'
     - flag player dWEWand:!
     - flag player dWEWand:|:%pos1%|%pos2%
     - define pos 1
     - inject s@dWE_Msg p:set_Pos
 
 dWE_Commands_Hpos2:
   type: command
   debug: false
   speed: 0
   name: .hpos2
   description: Set position 2
   usage: /.hpos2
   aliases: ''
   allowed help:
   - determine <player.has_permission[dwe.basic]||<player.is_op>>
 
   data:
     description: 'Sets the location you are looking at as position 2. Has a range of 160 blocks and will not target air unless that range has been met.'
     usage: '/dwe hpos2'
     examples: []
     permissions:
       - admin
       - select
       - pos
 
   tab complete:
     - determine 'li@'
 
   script:
     - if !<def[command].exists> {
       - define command 'hpos2'
       }
     - define prerun 'a'
     - inject s@dWE_Commands p:prerun
 
     - define pos2 '<player.flag[dWEWand].as_list.get[2]||null>'
     - if <player.location.cursor_on[160].simple.is[==].to[%pos2%]> {
       - run s@msgPrefixed 'def:dWE|<&c>pos2 is already set'
       - queue clear
       }
     - define pos1 '<player.flag[dWEWand].as_list.get[1]||null>'
     - define pos2 '<player.location.cursor_on[160].simple>'
     - flag player dWEWand:!
     - flag player dWEWand:|:%pos1%|%pos2%
     - define pos 2
     - inject s@dWE_Msg p:set_Pos
 
 dWE_Commands_Chunk:
   type: command
   debug: false
   speed: 0
   name: .chunk
   description: Selects the chunk you are standing in
   usage: /.chunk
   aliases: ''
 
   data:
     description: 'Sets the chunk you are standing in as your cuboid selection.'
     usage: '/dwe chunk'
     examples: []
     permissions:
       - admin
       - select
       - chunk
 
   tab complete:
     - determine 'li@'
 
   script:
     - if !<def[command].exists> {
       - define command 'chunk'
       }
     - define prerun 'a'
     - inject s@dWE_Commands p:prerun
 
     - define pos1 '<player.location.get_chunk.cuboid.min>'
     - define pos2 '<player.location.get_chunk.cuboid.max>'
     - flag player dWEWand:!
     - flag player dWEWand:|:%pos1%|%pos2%
     - run s@msgPrefixed 'def:dWE|<&f>Chunk selected<&co> <player.location.get_chunk.replace[ch@].split[,].get[1|2].comma_separated>'
 
 dWE_Commands_Expand:
   type: command
   debug: false
   speed: 0
   name: .expand
   description: Expands your selection
   usage: /.expand <&lt>amount/v<&gt> (n/s/e/w/u/d)
   aliases: ''
 
   data:
     description: 'You can expand your selection in cardinal directions, up, down, or vertically. If you do not specify a direction, the selection will be expanded in the direction you are looking.'
     usage: '/dwe expand <&lt>amount/v<&gt> (n/s/e/w/u/d)'
     examples:
       - '<&f>To expand your selection 10 blocks up'
       - '  <&e>/dwe expand 10 u'
       - ' '
       - '<&f>To expand your selection vertically'
       - '  <&e>/dwe expand v'
       - ' '
       - '<&f>To expand your selection 5 blocks in the direction you are looking'
       - '  <&e>/dwe expand 5'
     permissions:
       - admin
       - select
       - expand
 
   tab complete:
     - if !<def[command].exists> {
       - if !<proc[dWE_HasPerm_Command].context[expand|<player||server>]> {
         - determine 'li@'
         }
       - define args "<c.args>"
       - define spaces '<c.raw_args.to_list.count[ ].add[1].as_int||0>'
       }
 
     - choose '%spaces%':
       - case '0':
         - determine 'expand [<&ns>]/v '
       - case '1':
         - define arg1 '<def[args].get[1]||>'
         - if '%arg1%' matches 'number' || '%arg1%' == 'v' {
           - determine '%arg1% '
           }
           else {
           - determine '[<&ns>]/v '
           }
       - case '2':
         - define arg2 '<def[args].get[2]||>'
         - define arg1 '<def[args].get[1]||>'
         - if '%arg1%' == 'v' || '%arg1%' !matches 'number' {
           - determine 'li@'
           }
         - if 'li@n|s|e|w|u|d' contains '%arg2%' {
           - determine 'li@'
           }
           else {
           - determine 'li@n|s|e|w|u|d'
           }
       - default:
         - determine 'li@'
 
   script:
   # /dwe expand <amount/v> (n/s/e/w/u/d)
     - if !<def[command].exists> {
       - define command 'expand'
       }
     - if <c.server||false> {
       - run s@msgPrefixed 'def:dWE|<&c>This command must be run as a player.'
       - queue clear
       }
     - define prerun 'b'
     - inject s@dWE_Commands p:prerun
 
     - if <def[args].get[1].escaped.is[==].to[v]||false> {
       - define pos1 '<def[pos1].sub[0,<def[pos1].y>,0].replace[l@]>'
       - define pos2 '<def[pos2].add[0,<el@val[255].sub[<def[pos2].y>]>,0].replace[l@]>'
       - define direction 'Vertically'
       - goto 'end'
       }
 
     - define n '<def[args].get[1].escaped.round_up||0>'
     - define d '<def[args].get[2].escaped||0>'
     - if <def[n].is[OR_LESS].than[0]||true> {
       - run s@msgPrefixed 'def:dWE|<&c>SYNTAX<&co> <&e>/dwe expand <&6><&lb><&7>amount/v<&6><&rb> <&6>(<&7>direction<&6>)'
       - queue clear
       }
     - if <el@[li@n|e|s|w|u|d].contains[%d%].not||true> {
       - define d '<proc[getFacing].context[<player.location.pitch.as_money>|<player.location.yaw.as_money>]>'
       }
     - if <el@[li@n|e|s|w|u|d].contains[%d%].not||true> {
       - run s@msgPrefixed 'def:dWE|<&4><&l>ERROR<&co> <&c>Unknown direction!'
       - queue clear
       }
 
     - choose '%d%':
       - case 'n':
         - if <def[pos1].z.is[OR_LESS].than[<def[pos2].z>]> {
           - define pos1 '<def[pos1].sub[0,0,%n%]>'
           }
           else {
           - define pos2 '<def[pos2].sub[0,0,%n%]>'
           }
         - define direction 'North'
 
       - case 'e':
         - if <def[pos1].x.is[OR_MORE].than[<def[pos2].x>]> {
           - define pos1 '<def[pos1].add[%n%,0,0]>'
           }
           else {
           - define pos2 '<def[pos2].add[%n%,0,0]>'
           }
         - define direction 'East'
 
       - case 's':
         - if <def[pos1].z.is[OR_MORE].than[<def[pos2].z>]> {
           - define pos1 '<def[pos1].add[0,0,%n%]>'
           }
           else {
           - define pos2 '<def[pos2].add[0,0,%n%]>'
           }
         - define direction 'South'
 
       - case 'w':
         - if <def[pos1].x.is[OR_LESS].than[<def[pos2].x>]> {
           - define pos1 '<def[pos1].sub[%n%,0,0]>'
           }
           else {
           - define pos2 '<def[pos2].sub[%n%,0,0]>'
           }
         - define direction 'West'
 
       - case 'u':
         - if <def[pos1].y.is[OR_MORE].than[<def[pos2].y>]> {
           - define pos1 '<def[pos1].add[0,%n%,0]>'
           }
           else {
           - define pos2 '<def[pos2].add[0,%n%,0]>'
           }
         - define direction 'Up'
 
       - case 'd':
         - if <def[pos1].y.is[OR_LESS].than[<def[pos2].y>]> {
           - define pos1 '<def[pos1].sub[0,%n%,0]>'
           }
           else {
           - define pos2 '<def[pos2].sub[0,%n%,0]>'
           }
         - define direction 'Down'
 
       - default:
         - run s@msgPrefixed 'def:dWE|<&4><&l>ERROR<&co> <&c>An impossible error occurred while expanding your selection!'
         - queue clear
 
     - mark 'end'
     - flag player dWEWand:!
     - flag player dWEWand:|:%pos1%|%pos2%
     - inject s@dWE_Msg p:expand
 
 dWE_Commands_Contract:
   type: command
   debug: false
   speed: 0
   name: .contract
   description: Contracts your selection
   usage: /.contract
   aliases: ''
 
   data:
     description: 'You can contract your selection in cardinal directions, up, or down. If you do not specify a direction, the selection will be contracted in the direction you are looking.'
     usage: '/dwe contract <&lt>amount<&gt> (n/s/e/w/u/d)'
     examples:
       - '<&f>To contract your selection 10 blocks down'
       - '  <&e>/dwe contract 10 d'
       - ' '
       - '<&f>To contract your selection 1 block in the direction you are looking'
       - '  <&e>/dwe contract 1'
     permissions:
       - admin
       - select
       - contract
 
   tab complete:
     - if !<def[command].exists> {
       - if !<proc[dWE_HasPerm_Command].context[contract|<player||server>]> {
         - determine 'li@'
         }
       - define args "<c.args>"
       - define spaces '<c.raw_args.to_list.count[ ].add[1].as_int||0>'
       }
 
     - choose '%spaces%':
       - case '0':
         - determine 'contract [<&ns>] '
       - case '1':
         - define arg1 '<def[args].get[1]||>'
         - if '%arg1%' matches 'number' {
           - determine '%arg1% '
           }
           else {
           - determine '[<&ns>] '
           }
       - case '2':
         - define arg2 '<def[args].get[2]||>'
         - define arg1 '<def[args].get[1]||>'
         - if '%arg1%' !matches 'number' {
           - determine 'li@'
           }
         - if 'li@n|s|e|w|u|d' contains '%arg2%' {
           - determine 'li@'
           }
           else {
           - determine 'li@n|s|e|w|u|d'
           }
       - default:
         - determine 'li@'
 
   script:
   # /dwe contract <amount/v> (n/s/e/w/u/d)
     - if !<def[command].exists> {
       - define command 'contract'
       }
     - define prerun 'b'
     - inject s@dWE_Commands p:prerun
 
     - define n '<def[args].get[1].escaped.round_up||0>'
     - define d '<def[args].get[2].escaped||0>'
     - if <def[n].is[OR_LESS].than[0]||true> {
       - run s@msgPrefixed 'def:dWE|<&c>SYNTAX<&co> <&e>/dwe contract <&6><&lb><&7>amount<&6><&rb> <&6>(<&7>direction<&6>)'
       - queue clear
       }
     - if <el@[li@n|e|s|w|u|d].contains[%d%].not||true> {
       - define d '<proc[getFacing].context[<player.location.pitch.as_money>|<player.location.yaw.as_money>]>'
       }
     - if <el@[li@n|e|s|w|u|d].contains[%d%].not||true> {
       - run s@msgPrefixed 'def:dWE|<&4><&l>ERROR<&co> <&c>Unknown direction!'
       - queue clear
       }
 
     - choose '%d%':
       - case 'n':
         - if <def[pos1].z.is[OR_LESS].than[<def[pos2].z>]> {
           - define pos2 '<def[pos2].sub[0,0,%n%]>'
           }
           else {
           - define pos1 '<def[pos1].sub[0,0,%n%]>'
           }
         - define direction 'North'
 
       - case 'e':
         - if <def[pos1].x.is[OR_MORE].than[<def[pos2].x>]> {
           - define pos2 '<def[pos2].add[%n%,0,0]>'
           }
           else {
           - define pos1 '<def[pos1].add[%n%,0,0]>'
           }
         - define direction 'East'
 
       - case 's':
         - if <def[pos1].z.is[OR_MORE].than[<def[pos2].z>]> {
           - define pos2 '<def[pos2].add[0,0,%n%]>'
           }
           else {
           - define pos1 '<def[pos1].add[0,0,%n%]>'
           }
         - define direction 'South'
 
       - case 'w':
         - if <def[pos1].x.is[OR_LESS].than[<def[pos2].x>]> {
           - define pos2 '<def[pos2].sub[%n%,0,0]>'
           }
           else {
           - define pos1 '<def[pos1].sub[%n%,0,0]>'
           }
         - define direction 'West'
 
       - case 'u':
         - if <def[pos1].y.is[OR_MORE].than[<def[pos2].y>]> {
           - define pos2 '<def[pos2].add[0,%n%,0]>'
           }
           else {
           - define pos1 '<def[pos1].add[0,%n%,0]>'
           }
         - define direction 'Up'
 
       - case 'd':
         - if <def[pos1].y.is[OR_LESS].than[<def[pos2].y>]> {
           - define pos2 '<def[pos2].sub[0,%n%,0]>'
           }
           else {
           - define pos1 '<def[pos1].sub[0,%n%,0]>'
           }
         - define direction 'Down'
 
       - default:
         - run s@msgPrefixed 'def:dWE|<&4><&l>ERROR<&co> <&c>An impossible error occurred while contracting your selection!'
         - queue clear
 
     - flag player dWEWand:!
     - flag player dWEWand:|:%pos1%|%pos2%
     - inject s@dWE_Msg p:contract
 
 dWE_Commands_Inset:
   type: command
   debug: false
   speed: 0
   name: .inset
   description: Insets your selection
   usage: /.inset
   aliases: ''
 
   data:
     description: 'Inset is a form of contraction. The selection will decrease by the amount specified in all directions. It will shrink toward the center. You can also specify that it will inset only horizontally.'
     usage: '/dwe inset <&lt><&ns><&gt> -h'
     examples:
       - '<&f>To inset your selection by 3 blocks in all directions'
       - '  <&e>/dwe inset 3'
       - ' '
       - '<&f>To horizontally inset your selection by 6 blocks'
       - '  <&e>/dwe inset 6 -h'
     permissions:
       - admin
       - select
       - inset
 
   tab complete:
     - if !<def[command].exists> {
       - if !<proc[dWE_HasPerm_Command].context[inset|<player||server>]> {
         - determine 'li@'
         }
       - define args "<c.args>"
       - define spaces '<c.raw_args.to_list.count[ ].add[1].as_int||0>'
       }
 
     - choose '%spaces%':
       - case '0':
         - determine 'inset [<&ns>] -h '
       - case '1':
         - define arg1 '<def[args].get[1]||>'
         - if '%arg1%' matches 'number' || '%arg1%' == '-h' {
           - determine '%arg1% '
           }
           else {
           - determine '[<&ns>] '
           }
       - case '2':
         - define arg1 '<def[args].get[1]||>'
         - define arg2 '<def[args].get[2]||>'
         - if '%arg1%' matches 'number' {
           - determine '-h'
           }
         - if '%arg1%' == '-h' {
           - determine '<t[<def[arg2].is[MATCHES].to[NUMBER]>]:%arg2% || <&lb><&ns><&rb>>'
           }
           else {
           - determine 'li@'
           }
       - default:
         - determine 'li@'
 
   script:
   # /dwe inset <number> -h
     - if !<def[command].exists> {
       - define command 'inset'
       }
     - define prerun 'b'
     - inject s@dWE_Commands p:prerun
 
     - define n '<def[args].filter[is[matches].to[number]].get[1]||0>'
     - if <def[n].is[OR_LESS].than[0]||true> {
       - run s@msgPrefixed 'def:dWE|<&c>SYNTAX<&co> <&e>/dwe inset <&6><&lb><&7>amount<&6><&rb> <&6>(<&7>-h<&6>)'
       - queue clear
       }
     - define cuboid cu@%pos1%|%pos2%
     - if '<def[args].contains[-h].not||false>' {
       - define cuboid 'cu@<def[cuboid].min.add[0,%n%,0]>|<def[cuboid].max.sub[0,%n%,0]>'
       }
     - define cuboid 'cu@<def[cuboid].min.add[%n%,0,%n%]>|<def[cuboid].max.sub[%n%,0,%n%]>'
     - define pos1 '<def[cuboid].min>'
     - define pos2 '<def[cuboid].max>'
     - flag player dWEWand:!
     - flag player dWEWand:|:%pos1%|%pos2%
     - inject s@dWE_Msg p:inset
 
 dWE_Commands_Outset:
   type: command
   debug: false
   speed: 0
   name: .outset
   description: Outsets your selection
   usage: /.outset
   aliases: ''
 
   data:
     description: 'Outset is a form of expansion. The selection will increase by the amount specified in all directions. It will expand from the center. You can also specify that it will outset only horizontally.'
     usage: '/dwe outset <&lt><&ns><&gt> -h'
     examples:
       - '<&f>To outset your selection by 8 blocks in all directions'
       - '  <&e>/dwe outset 8'
       - ' '
       - '<&f>To horizontally outset your selection by 2 blocks'
       - '  <&e>/dwe outset 2 -h'
     permissions:
       - admin
       - select
       - outset
 
   tab complete:
     - if !<def[command].exists> {
       - if !<proc[dWE_HasPerm_Command].context[outset|<player||server>]> {
         - determine 'li@'
         }
       - define args "<c.args>"
       - define spaces '<c.raw_args.to_list.count[ ].add[1].as_int||0>'
       }
 
     - choose '%spaces%':
       - case '0':
         - determine 'outset [<&ns>] -h '
       - case '1':
         - define arg1 '<def[args].get[1]||>'
         - if '%arg1%' matches 'number' || '%arg1%' == '-h' {
           - determine '%arg1% '
           }
           else {
           - determine '[<&ns>] '
           }
       - case '2':
         - define arg1 '<def[args].get[1]||>'
         - define arg2 '<def[args].get[2]||>'
         - if '%arg1%' matches 'number' {
           - determine '-h'
           }
         - if '%arg1%' == '-h' {
           - determine '<t[<def[arg2].is[MATCHES].to[NUMBER]>]:%arg2% || <&lb><&ns><&rb>>'
           }
           else {
           - determine 'li@'
           }
       - default:
         - determine 'li@'
 
   script:
   # /dwe outset <number> -h
     - if !<def[command].exists> {
       - define command 'outset'
       }
     - define prerun 'b'
     - inject s@dWE_Commands p:prerun
 
     - define n '<def[args].filter[is[matches].to[number]].get[1]||0>'
     - if <def[n].is[OR_LESS].than[0]||true> {
       - run s@msgPrefixed 'def:dWE|<&c>SYNTAX<&co> <&e>/dwe outset <&6><&lb><&7>amount<&6><&rb> <&6>(<&7>-h<&6>)'
       - queue clear
       }
     - define cuboid cu@%pos1%|%pos2%
     - if '<def[args].contains[-h].not||false>' {
       - define cuboid 'cu@<def[cuboid].min.sub[0,%n%,0]>|<def[cuboid].max.add[0,%n%,0]>'
       }
     - define cuboid 'cu@<def[cuboid].min.sub[%n%,0,%n%]>|<def[cuboid].max.add[%n%,0,%n%]>'
     - define pos1 '<def[cuboid].min>'
     - define pos2 '<def[cuboid].max>'
     - flag player dWEWand:!
     - flag player dWEWand:|:%pos1%|%pos2%
     - inject s@dWE_Msg p:outset
 
 dWE_Commands_Shift:
   type: command
   debug: false
   speed: 0
   name: .shift
   description: Shifts your selection
   usage: /.shift
   aliases: ''
 
   data:
     description: 'You can shift your selection area in all cardinal directions, up, and down. Your selection will shift in the direction you are looking if no direction is specified.'
     usage: '/dwe shift <&lt>amount<&gt> (n/s/e/w/u/d)'
     examples:
       - '<&f>To shift your selection by 16 blocks to the east'
       - '  <&e>/dwe shift 16 e'
       - ' '
       - '<&f>To shift your selection by 2 blocks in the direction you are looking'
       - '  <&e>/dwe shift 2'
     permissions:
       - admin
       - select
       - shift
 
   math:
     n: '0,0,-<def[n]>'
     s: '0,0,<def[n]>'
     w: '-<def[n]>,0,0'
     e: '<def[n]>,0,0'
     d: '0,-<def[n]>,0'
     u: '0,<def[n]>,0'
   d:
     n: 'North'
     s: 'South'
     w: 'West'
     e: 'East'
     d: 'Down'
     u: 'Up'
 
   tab complete:
     - if !<def[command].exists> {
       - if !<proc[dWE_HasPerm_Command].context[shift|<player||server>]> {
         - determine 'li@'
         }
       - define args "<c.args>"
       - define spaces '<c.raw_args.to_list.count[ ].add[1].as_int||0>'
       }
 
     - choose '%spaces%':
       - case '0':
         - determine 'shift [<&ns>] '
       - case '1':
         - define arg1 '<def[args].get[1]||>'
         - if '%arg1%' matches 'number' || '%arg1%' == 'v' {
           - determine '%arg1% '
           }
           else {
           - determine '[<&ns>] '
           }
       - case '2':
         - define arg2 '<def[args].get[2]||>'
         - define arg1 '<def[args].get[1]||>'
         - if '%arg1%' == 'v' || '%arg1%' !matches 'number' {
           - determine 'li@'
           }
         - if 'li@n|s|e|w|u|d' contains '%arg2%' {
           - determine 'li@'
           }
           else {
           - determine 'li@n|s|e|w|u|d'
           }
       - default:
         - determine 'li@'
 
   script:
   # /dwe shift <amount> (n/s/e/w/u/d)
     - if !<def[command].exists> {
       - define command 'shift'
       }
     - define prerun 'b'
     - inject s@dWE_Commands p:prerun
 
     - define n '<def[args].get[1].escaped.round_up||0>'
     - define d '<def[args].get[2].escaped||0>'
     - if <def[n].is[OR_LESS].than[0]||true> {
       - run s@msgPrefixed 'def:dWE|<&c>SYNTAX<&co> <&e>/dwe shift <&6><&lb><&7>amount<&6><&rb> <&6>(<&7>direction<&6>)'
       - queue clear
       }
     - if <li@n|e|s|w|u|d.contains[%d%].not||true> {
       - define d '<proc[getFacing].context[<player.location.pitch.as_money>|<player.location.yaw.as_money>]>'
       }
     - if <li@n|e|s|w|u|d.contains[%d%].not||true> {
       - run s@msgPrefixed 'def:dWE|<&4><&l>ERROR<&co> <&c>Unknown direction!'
       - queue clear
       }
     - define direction '<script.yaml_key[d.%d%]>'
     - repeat 2 {
       - define pos%value% '<def[pos%value%].add[<parse:<script.yaml_key[math.%d%]>>]>'
       }
     - flag player dWEWand:!
     - flag player dWEWand:|:%pos1%|%pos2%
     - inject s@dWE_Msg p:shift
 
 dWE_Commands_Set:
   type: command
   debug: false
   speed: 0
   name: .Set
   description: Set your selection to a material
   usage: /.set
   aliases: ''
 
   data:
     description:
       - 'Set the materials in an area. You can use either the specific material name or the minecraft material name. TAB completion is available for the minecraft material names.'
       - ' '
       - 'Arguments and -switches to the set command can be compounded and supplied in any order you like.'
     usage: '/dwe set <&lb><&lt>material<&gt>(<&pc><&ns>)/...<&rb> (<&lt>x<&gt>(,<&lt>y<&gt>,<&lt>z<&gt>)) (-d, -g, -n, -l, -w, -p)'
     examples:
       - '<&f>To set your selection to white stained clay using minecraft material name and data value.'
       - '  <&e>/dwe set stained_clay,0'
       - ' '
       - '<&f>To set your selection to white stained clay using specific material name.'
       - '  <&e>/dwe set white_clay'
       - ' '
       - '<&f>To set your selection to 25<&pc> white stained clay and 75<&pc> dirt.'
       - '  <&e>/dwe set white_clay<&pc>25/dirt<&pc>75'
       - ' '
       - '<&f>To set a 4x5x10 area to stone using the center of your selection.'
       - '  <&e>/dwe set stone 4,5,10'
       - ' '
       - '<&f>To set an area the size of your selection to stone. Uses the block you are looking at as the min corner.'
       - '  <&e>/dwe set stone -l'
       - ' '
       - '<&f>To set a 4x5x10 area to stone using the wand position 1 as the min corner. Really only useful when manually setting a size.'
       - '  <&e>/dwe set stone 4,5,10 -w'
       - ' '
       - '<&f>To perform any operation slowly to prevent server lag use the -d switch.'
       - '  <&e>/dwe set dirt -d'
       - ' '
       - '<&f>To place blocks without physics use the -g switch. Physics will still apply if a block update effects the block.'
       - '  <&e>/dwe set sand -g'
       - ' '
       - '<&f>To break blocks <&dq>naturally<&dq> allowing item drops to spawn use the -n switch.'
       - '  <&e>/dwe set air -n'
       - ' '
       - '<&f>To see an outline of the area any command will effect use the -p switch.'
       - '  <&e>/dwe set stone -p'
     permissions:
       - admin
       - edit
       - set
 
   tab complete:
     - if !<def[command].exists> {
       - if !<proc[dWE_HasPerm_Command].context[set|<player||server>]> {
         - determine 'li@'
         }
       - define args "<c.args>"
       - define spaces '<c.raw_args.to_list.count[ ].add[1].as_int||0>'
       }
 
     - choose '%spaces%':
       - case '0':
         - determine 'set <&lt>material<&gt>'
       - case '1':
         - define arg1 '<def[args].get[1]||>'
         - if '%arg1%' matches 'material' {
           - determine '%arg1%'
           }
           else {
           - define blocks '<server.list_materials.parse[as_material].filter[is_block].parse[bukkit_enum]>'
           - determine '<def[blocks].filter[starts_with[%arg1%]]||%blocks%>'
           }
       - default:
         - determine 'li@'
 
   script:
   # /dwe set <material>
     - if !<def[command].exists> {
       - define command 'set'
       }
     - define prerun 'c'
     - inject s@dWE_Commands p:prerun
     - define selection 'cu@<def[center].as_location.sub[%s%]>|<def[center].as_location.add[%s%]>'
     - if '%o%' == '0' {
       - define o '<def[selection].min>'
       }
       else {
       - define selection 'cu@%o%|<def[o].as_location.add[<def[selection].size.div[2].sub[1,1,1]>].as_location>'
       }
     - define blocks '<def[selection].blocks>'
     - inject s@dWE_Commands p:prerunB
     - ~modifyblock <def[blocks]> <def[mats]> <def[pcts]> %d% %g% %n%
     - run s@msgPrefixed 'def:dWE|Set complete!'
 
 dWE_Commands_Replace:
   type: command
   debug: false
   speed: 0
   name: .replace
   description: Replace materials in an area
   usage: /.replace
   aliases: ''
 
   data:
     description:
       - 'Replace materials in an area. You can use either the specific material name or the minecraft material name. TAB completion is available for the minecraft material names.'
       - ' '
       - 'Arguments and -switches to the replace command can be compounded and supplied in any order you like.'
     usage: '/dwe replace <&lb><&lt>newMat<&gt>(<&pc><&ns>)/...<&rb> <&lb><&lt>oldMat<&gt>/...<&rb> (<&lt>x<&gt>(,<&lt>y<&gt>,<&lt>z<&gt>)) (-d, -g, -n, -l, -w, -p)'
     examples:
       - '<&f>To replace stone blocks in your selection with dirt.'
       - '  <&e>/.replace dirt stone'
       - ' '
       - '<&f>To replace stone and dirt with sand.'
       - '  <&e>/.replace sand stone/dirt'
       - ' '
       - '<&f>To replace air with 25<&pc> sand and 25<&pc> gravel.'
       - '  <&e>/.replace sand<&pc>25/gravel<&pc>25 air'
       - ' '
       - '<&f>To replace stone in a 4x2x2 area with dirt using the center of your selection.'
       - '  <&e>/.replace dirt stone 4,2,2'
       - ' '
       - '<&f>To replace stone in an area the size of your selection with dirt using the block you are looking at as the min corner.'
       - '  <&e>/.replace dirt stone -l'
       - ' '
       - '<&f>To replace stone in a 4x5x10 area with dirt using the wand position 1 as the min corner. Really only useful when manually setting a size.'
       - '  <&e>/.replace dirt stone 4,5,10 -w'
       - ' '
       - '<&f>To perform any operation slowly to prevent server lag use the -d switch.'
       - '  <&e>/.replace dirt stone -d'
       - ' '
       - '<&f>To replace blocks without physics use the -g switch. Physics will still apply if a block update effects the block.'
       - '  <&e>/.replace sand air -g'
       - ' '
       - '<&f>To replace blocks with air <&dq>naturally<&dq> allowing item drops to spawn use the -n switch.'
       - '  <&e>/.replace air tall_grass/crops -n'
       - ' '
       - '<&f>To see a preview of the locations any command will effect use the -p switch.'
       - '<&4>WARNING<&co><&nl><&c>This has the potential to crash servers! Use with -d if in doubt!'
       - '  <&e>/.replace air tall_grass/crops -p'
     permissions:
       - admin
       - edit
       - replace
 
   tab complete:
     - if !<def[command].exists> {
       - if !<proc[dWE_HasPerm_Command].context[replace|<player||server>]> {
         - determine 'li@'
         }
       - define args "<c.args>"
       - define spaces '<c.raw_args.to_list.count[ ].add[1].as_int||0>'
       }
 
     - choose '%spaces%':
       - case '0':
         - determine 'set <&lt>material<&gt>'
       - case '1':
         - define arg1 '<def[args].get[1]||>'
         - if '%arg1%' matches 'material' {
           - determine '%arg1%'
           }
           else {
           - define blocks '<server.list_materials.parse[as_material].filter[is_block].parse[bukkit_enum]>'
           - determine '<def[blocks].filter[starts_with[%arg1%]]||%blocks%>'
           }
       - default:
         - determine 'li@'
 
   script:
   # /dwe replace <nawMaterials> <oldMaterial>
     - if !<def[command].exists> {
       - define command 'replace'
       }
     - define prerun 'c'
     - inject s@dWE_Commands p:prerun
     - define oldMats '<def[args].get[2].split_by[/]||null>'
     - foreach %oldMats% {
       - if '%value%' !matches material {
         - run s@msgPrefixed 'def:dWE|<&c>SYNTAX ERROR<&co> <&6> Invalid Material <&c><&o>%value%'
         - narrate '<&6><parse:<s@dWE_Commands_%command%.yaml_key[data.usage]||No usage info available!>>'
         - queue clear
         }
       }
     - define selection 'cu@<def[center].as_location.sub[%s%]>|<def[center].as_location.add[%s%]>'
     - if '%o%' == '0' {
       - define o '<def[selection].min>'
       }
       else {
       - define selection 'cu@%o%|<def[o].as_location.add[<def[selection].size.div[2].sub[1,1,1]>].as_location>'
       }
     - define blocks '<def[selection].blocks[%oldMats%]>'
     - if <def[blocks].size> == '0' {
       - run s@msgPrefixed 'def:dWE|<&c><&o><def[oldMats].formatted> <t[<def[oldMats].size.is[more].than[1]>]:are||is> not within your selection.'
       - queue clear
       }
 
     - inject s@dWE_Commands p:prerunB
     - ~modifyblock <def[blocks]> <def[mats]> <def[pcts]> %d% %g% %n%
     - run s@msgPrefixed 'def:dWE|Replace complete!'
 
 dWE_Commands_Sphere:
   type: command
   debug: false
   speed: 0
   name: .sphere
   description: Creates an ellipsoid
   usage: /.sphere
   aliases: ''
 
   data:
     description:
       - 'Create an ellipsoid from your selection. You can use either the specific material name or the minecraft material name. TAB completion is available for the minecraft material names.'
       - ' '
       - 'Arguments and -switches to the sphere command can be compounded and supplied in any order you like.'
     usage: '/dwe sphere <&lb><&lt>material<&gt>(<&pc><&ns>)/...<&rb> (<&lt>x<&gt>(,<&lt>y<&gt>,<&lt>z<&gt>)) (-d, -g, -n, -l, -w, -p)'
     examples:
       - '<&f>Create a white wool ellipsoid from you selection using minecraft material name and data value.'
       - '  <&e>/dwe sphere wool,0'
       - ' '
       - '<&f>Create a white wool ellipsoid from you selection using specific material name.'
       - '  <&e>/dwe sphere white_wool'
       - ' '
       - '<&f>Create an ellipsoid that is 50<&pc> stone and 50<&pc> dirt from your selection.'
       - '  <&e>/dwe sphere white_clay<&pc>50/dirt<&pc>50'
       - ' '
       - '<&f>Create a stone ellipsoid with radii 6x2x6 using the center of your selection.'
       - '  <&e>/dwe sphere stone 6,2,6'
       - ' '
       - '<&f>Create a dirt ellipsoid the size of your selection. Uses the block you are looking at as the min corner.'
       - '  <&e>/dwe sphere dirt -l'
       - ' '
       - '<&f>Create a stone ellipsoid with radii 4x5x10 using the wand position 1 as the min corner. Really only useful when manually setting a size.'
       - '  <&e>/dwe sphere stone 4,5,10'
       - ' '
       - '<&f>To perform any operation slowly to prevent server lag use the -d switch'
       - '  <&e>/dwe sphere dirt -d'
       - ' '
       - '<&f>Create an ellipsoid without physics use the -g switch. Physics will still apply if a block update effects the block.'
       - '  <&e>/dwe sphere sand -g'
       - ' '
       - '<&f>To break blocks <&dq>naturally<&dq> allowing item drops to spawn use the -n switch'
       - '  <&e>/dwe sphere air -n'
       - ' '
       - '<&f>To see an outline of the area any command will effect use the -p switch'
       - '  <&e>/dwe sphere stone -p'
     permissions:
       - admin
       - edit
       - sphere
 
   tab complete:
     - determine 'li@'
 
   script:
     - if !<def[command].exists> {
       - define command 'sphere'
       }
     - define prerun 'c'
     - inject s@dWE_Commands p:prerun
     - define s '<def[s].as_location.add[0.5,0.5,0.5]>'
     - define ellipsoid 'ellipsoid@<def[center].replace[l@]>,<def[s].replace[l@]>'
     - define selection 'cu@<def[center].as_location.sub[%s%]>|<def[center].as_location.add[%s%]>'
     - if '%o%' == '0' {
       - define o '<def[selection].min.simple>'
       }
       else {
       - define selection 'cu@%o%|<def[o].as_location.add[<def[selection].size.div[2].sub[1,1,1]>].as_location>'
       - define center '<def[selection].center.simple.as_location>'
       - define ellipsoid 'ellipsoid@<def[center].replace[l@]>,<def[selection].size.div[2].replace[l@].split_by[,].get[1].to[3].separated_by[,]>'
       }
     - define blocks '<def[ellipsoid].blocks>'
     - inject s@dWE_Commands p:prerunB
     - ~modifyblock <def[blocks]> <def[mats]> <def[pcts]> %d% %g% %n%
     - run s@msgPrefixed 'def:dWE|Set complete!'
 
 #dWE_Commands_Cyl:
 ## This does no work as expected
 #  type: command
 #  debug: false
 #  speed: 0
 #  name: .cyl
 #  description: Creates a cylinder
 #  usage: /.cyl
 #  aliases: ''
 
 #  data:
 #    description: 'Create an cylinder centered from your selection.'
 #    usage: '/dwe sphere [<&lt>material<&gt>(<&pc><&ns>)/...] (<&lt>x<&gt>(,<&lt>y<&gt>,<&lt>z<&gt>)) (-d, -g, -n, -l, -w)'
 #    examples: []
 #    permissions:
 #      - admin
 #      - edit
 #      - sphere
 
 #  tab complete:
 #    - determine 'li@'
 
 #  script:
 #  # /dwe cylinder <x>,[<y>,<z>] <material>
 #    - if !<def[command].exists> {
 #      - define command 'cyl'
 #      }
 #    - define prerun 'c'
 #    - inject s@dWE_Commands p:prerun
 #    - define selection 'cu@<def[center].as_location.sub[%s%].add[1,1,1]>|<def[center].as_location.add[%s%]>'
 #    - if '%o%' == '0' {
 #      - define o '<def[selection].min>'
 #      }
 #      else {
 #      - define selection 'cu@%o%|<def[o].as_location.add[<def[selection].size.div[2].sub[1,1,1]>].as_location>'
 #      }
 #    - define location '<def[selection].center>'
 #    - narrate "%location%"
 #    - inject s@dWE_Commands p:prerunB
 #    - ~modifyblock <def[location]> <def[mats]> 'radius:<def[s].get[1]>' 'height:<def[s].get[2]>' 'depth:<def[s].get[3]>' <def[pcts]> %d% %g% %n%
 #    - run s@msgPrefixed 'def:dWE|Set complete!'
 
 dWE_Commands_Copy:
   type: command
   debug: false
   speed: 0
   name: .copy
   description: Copy your selection
   usage: /.copy
   aliases: ''
 
   data:
     description: 'Copy your current selection to your clipboard for pasting.'
     usage: '/dwe copy'
     examples:
       - 'You don<&sq>t actually need an example...'
       - 'Do you?'
     permissions:
       - admin
       - edit
       - copy
 
   tab complete:
     - determine 'li@'
 
   script:
   # /dwe copy
     - if !<def[command].exists> {
       - define command 'copy'
       }
     - define prerun 'b'
     - inject s@dWE_Commands p:prerun
     - define u '<player.uuid>'
     - define t 'Clipboard'
     - define o '<def[cuboid].min>'
     - inject s@dWE_ISN
     - run s@msgPrefixed 'def:dWE|<&7><&o>Selection saved to clipboard'
 
 
 dWE_Commands_Cut:
   type: command
   debug: false
   speed: 0
   name: .cut
   description: Cut your selection
   usage: /.cut
   aliases: ''
 
   data:
     description: 'Cut is just like copy except that your selection is also removed.'
     usage: '/dwe cut'
     examples:
       - 'You don<&sq>t actually need an example...'
       - 'Do you?'
     permissions:
       - admin
       - edit
       - cut
 
   tab complete:
     - determine 'li@'
 
   script:
   # /dwe cut
     - if !<def[command].exists> {
       - define command 'cut'
       }
     - define prerun 'b'
     - inject s@dWE_Commands p:prerun
     - inject s@dWE_Commands p:prerunB
     - define t 'Clipboard'
     - inject s@dWE_ISN
     - run s@msgPrefixed 'def:dWE|<&7><&o>Selection saved to clipboard'
     - if <def[args].filter[starts_with[-d]].is_empty.not||true> {
       - ~modifyblock <def[cuboid].blocks> m@air delayed
       }
       else {
       - ~modifyblock <def[cuboid].blocks> m@air
       }
 
 dWE_Commands_Paste:
   type: command
   debug: false
   speed: 0
   name: .paste
   description: Paste your selection
   usage: /.paste
   aliases: ''
 
   data:
     description: 'Paste items from your clipboard to a location.'
     usage: '/dwe paste <&lb><&ns><&rb> (-a, -w, -l, -p, -d)'
     examples:
       - '<&f>To paste the most recent entry in your clipboard'
       - '  <&e>/dwe paste'
       - '  <&e>/dwe paste 1'
       - ' '
       - '<&f>To paste the fifth oldest entry in your clipboard'
       - '  <&e>/dwe paste 5'
       - ' '
       - '<&f>To paste the second entry in your clipboard ignoring air blocks'
       - '  <&e>/dwe paste 2 -a'
       - ' '
       - '<&f>To paste your clipboard at position 1 of your wand'
       - '  <&e>/dwe paste -w'
       - ' '
       - '<&f>To paste your clipboard to the location you are looking at'
       - '  <&e>/dwe paste -l'
       - ' '
       - '<&f>To preview your paste showing an outline of the space it will occupy'
       - '  <&e>/dwe paste -p'
       - ' '
       - '<&f>To paste your clipboard slowly'
       - '  <&e>/dwe paste -d'
     permissions:
       - admin
       - edit
       - paste
 
   tab complete:
     - determine 'li@'
 
   script:
   # /dwe paste <number>
     - if !<def[command].exists> {
       - define command 'paste'
       }
     - define prerun 'b'
     - inject s@dWE_Commands p:prerun
     # Will be a config file option
     - define clipboardLimit '3'
     - define pRange '50'
     - define n '<def[args].filter[is[matches].to[number]].get[1].abs.round||1>'
     - define a '<t[<def[args].filter[starts_with[-a]].is_empty.not||true>]:noair||>'
     - define d '<t[<def[args].filter[starts_with[-d]].is_empty.not||true>]:delayed||>'
     - define p '<def[args].filter[starts_with[-p]].is_empty.not||false>'
     - define o '<t[<def[args].filter[starts_with[-w]].is_empty.not||true>]:%pos1%||<t[<def[args].filter[starts_with[-l]].is_empty.not||true>]:<player.location.cursor_on[%pRange%].simple>||<player.location.simple>>>'
     - define u '<player.uuid>'
     - define t 'Clipboard'
     - inject s@dWE_PS
     - run s@msgPrefixed 'def:dWE|<&7><&o>Clipboard entry %entry% pasted!'
 
 
 dWE_Commands_Rotate:
   type: command
   debug: false
   speed: 0
   name: .rotate
   description: Rotate your selection
   usage: /.rotate
   aliases: ''
 
   data:
     description: 'This isn<&sq>t documented because you should <&c>NOT<&f> use it!'
     usage: '/dwe rotate'
     examples: []
     permissions:
       - admin
       - edit
       - rotate
 
   tab complete:
     - determine 'li@'
 
   script:
   # /dwe rotate [90/180/270/360]
     - if !<def[command].exists> {
       - define command 'rotate'
       }
     - define prerun 'b'
     - inject s@dWE_Commands p:prerun
     - run s@msgPrefixed 'def:dWE|<&c>This command doesn<&sq>t do anything yet!'
 
 
 dWE_Commands_Undo:
   type: command
   debug: false
   speed: 0
   name: .undo
   description: Undo edits
   usage: /.undo
   aliases: ''
 
   data:
     description: 'For those <&dq>Oh Fudge!<&dq> moments. Simply undo.'
     usage: '/dwe undo (<&ns>) (-a, -d)'
     examples:
       - 'Undo your last edit.'
       - '  <&e>/dwe undo'
       - ' '
       - 'Undo your fourth most recent edit.'
       - '  <&e>/dwe undo 4'
       - ' '
       - 'Undo your last edit slowly to prevent server lag.'
       - '  <&e>/dwe undo -d'
       - ' '
       - 'Undo your last edit ignoring air blocks.'
       - '  <&e>/dwe undo -a'
       - ' '
     permissions:
       - admin
       - edit
       - undo
 
   tab complete:
     - determine 'li@'
 
   script:
   # /dwe undo
     - if !<def[command].exists> {
       - define command 'undo'
       }
     - define prerun 'a'
     - inject s@dWE_Commands p:prerun
     - define n '<def[args].filter[is[matches].to[number]].get[1]||1>'
     - define a '<t[<def[args].filter[starts_with[-a]].is_empty.not||true>]:noair||>'
     - define d '<t[<def[args].filter[starts_with[-d]].is_empty.not||true>]:delayed||>'
     - define entry '<player.flag[dWE.History.Undo].as_list.last.before[/].add[1].sub[%n%].as_int||null>'
     - define o '<player.flag[dWE.History.Undo].as_list.map_get[%entry%]||null>'
     - define u '<player.uuid>'
     - define t 'Undo'
     - inject s@dWE_PS
     - flag player 'dWE.History.Undo:<-:%entry%/<player.flag[dWE.History.Undo].map_get[%entry%]>'
     - adjust server 'delete_file:schematics/dWE/Undo/%u%/%entry%.schematic'
     - run s@msgPrefixed 'def:dWE|<&7><&o>Undo entry %entry% complete!'
 
 
 dWE_Commands_Redo:
   type: command
   debug: false
   speed: 0
   name: .redo
   description: Redo edits
   usage: /.redo
   aliases: ''
 
   data:
     description: 'For when you should have done that thing you thought you shouldn<&sq>t have. Redo.'
     usage: '/dwe redo (<&ns>) (-a, -d)'
     examples:
       - 'Redo your last undo.'
       - '  <&e>/dwe redo'
       - ' '
       - 'Redo your third most recent undo.'
       - '  <&e>/dwe redo 3'
       - ' '
       - 'Redo your last undo slowly to prevent server lag.'
       - '  <&e>/dwe redo -d'
       - ' '
       - 'Redo your last undo ignoring air blocks.'
       - '  <&e>/dwe redo -a'
       - ' '
     permissions:
       - admin
       - edit
       - undo
 
   tab complete:
     - determine 'li@'
 
   script:
   # /dwe redo
     - if !<def[command].exists> {
       - define command 'redo'
       }
     - define prerun 'a'
     - inject s@dWE_Commands p:prerun
     - define n '<def[args].filter[is[matches].to[number]].get[1]||1>'
     - define a '<t[<def[args].filter[starts_with[-a]].is_empty.not||true>]:noair||>'
     - define d '<t[<def[args].filter[starts_with[-d]].is_empty.not||true>]:delayed||>'
     - define entry '<player.flag[dWE.History.Redo].as_list.last.before[/].add[1].sub[%n%].as_int||null>'
     - define o '<player.flag[dWE.History.Redo].as_list.map_get[%entry%]||null>'
     - define u '<player.uuid>'
     - define t 'Redo'
     - inject s@dWE_PS
     - flag player 'dWE.History.Redo:<-:%entry%/<player.flag[dWE.History.Redo].map_get[%entry%]>'
     - adjust server 'delete_file:schematics/dWE/Redo/%u%/%entry%.schematic'
     - run s@msgPrefixed 'def:dWE|<&7><&o>Redo entry %entry% complete!'
 
 
 dWE_Commands_Schem:
   type: command
   debug: false
   speed: 0
   name: .schem
   description: Manage Schematics
   usage: /.schem
   aliases: ''
 
   data:
     description: 'Do what you need to with schematics'
     usage: '/dwe schem list, load, unload, save, delete, copy, rename, paste, bind (-p)'
     examples:
       - 'List the second page of schematics.'
       - '  <&e>/dwe schem list 2'
       - ' '
       - 'Load the schematic named house1'
       - '  <&e>/dwe schem load house1'
       - ' '
       - 'Unload the public schematic named house1'
       - '  <&e>/dwe schem unload -p house1'
       - ' '
       - 'Save your current selection as park_bench15'
       - '  <&e>/dwe schem save park_bench15'
       - ' '
       - 'Delete the schematic named aa1'
       - '  <&e>/dwe schem delete aa1'
       - ' '
       - 'Copy the big_tree schematic and name it tree1'
       - '  <&e>/dwe schem copy big_tree tree1'
       - ' '
       - 'Rename the dirt_shack schematic to my_mansion'
       - '  <&e>/dwe schem rename dirt_shack my_mansion'
       - ' '
       - 'Paste the public schematic named tank at the location you are looking'
       - '  <&e>/dwe schem paste tank -p -l'
       - ' '
       - 'Bind the schematic named barn to the tool in your hand'
       - ' - The -d switch will prevent server lag when the tool is used'
       - ' - The -a switch will ignore pasting air blocks'
       - '  <&e>/dwe schem bind barn -d -a'
       - ' '
     args:
       - list
       - load
       - unload
       - save
       - delete
       - copy
       - rename
       - paste
       - bind
     permissions:
       - admin
       - schematic
 
   tab complete:
     - determine 'li@'
 
   script:
   # /dwe schematic [list/load/unload/save/delete/copy/rename/paste/bind]
     - if !<def[command].exists> {
       - define command 'schem'
       }
     - define prerun 'b'
     - inject s@dWE_Commands p:prerun
 
     - define n '<def[args].filter[is[matches].to[number]].get[1]||1>'
     - define p '<def[args].filter[starts_with[-p]].is_empty.not||false>'
     - if '%p%' {
       - define p 'public'
       }
       else {
       - define pl 'li@'
       - define rm 'li@'
       - foreach '%args%' {
         - define a '%value%'
         - if <server.match_offline_player[%a%].name.is[==].to[%a%]||false> {
           - define rm '<def[rm].include[%loop_index%]>'
           - if '%pl%' !contains '%a%' {
             - define pl '<def[pl].include[<server.match_offline_player[%a%]>]>'
             }
           }
         }
       - define args '<def[args].remove[<def[rm].separated_by[|]>]>'
       - if <def[pl].is_empty> {
         - define p '<player.uuid>'
         }
         else {
         - if <player.is_op> || <player.permission[dwe.admin]||false> {
           - define p '<def[pl].get[1].uuid>'
           }
           else {
           - define p '<player.uuid>'
           }
         }
       }
     - define pRange '50'
     - define a '<t[<def[args].filter[starts_with[-a]].is_empty.not||true>]:noair||>'
     - define d '<t[<def[args].filter[starts_with[-d]].is_empty.not||true>]:delayed||>'
     - define o '<t[<def[args].filter[starts_with[-w]].is_empty.not||true>]:%pos1%||<t[<def[args].filter[starts_with[-l]].is_empty.not||true>]:<player.location.cursor_on[%pRange%].simple>||<player.location.simple>>>'
     - define args '<def[args].exclude[%n%|%p%|-p|-w|-l|-a|-d]>'
     - define cmd '<def[args].get[1]||null>'
     - define cmds '<script.yaml_key[data.args]>'
     - if '%cmds%' !contains '%cmd%' {
       - run s@msgPrefixed 'def:dWE|<&c>SYNTAX<&co> <&e>/dwe schem <&lb><def[cmds].separated_by[/]><&rb> (-p)'
       - queue clear
       }
     - choose '%cmd%':
 
       - case 'list':
         - define entries 'li@'
         - define i '0'
         - foreach '<server.list_files[schematics/dWE/saves/%p%].filter[ends_with[.schematic]]||li@>':
           - define name '<def[value].before[.schematic]>'
           - define v '<proc[dWE_SNV].context[%name%|%p%]>'
           - define i '<def[i].add[1]>'
           - choose '%v%':
             - case '5':
               - define entry '<proc[msgHint].context[<&7>%name%|.schem load <tern[<def[p].is[==].to[public]>]:-p %name%||%name%>|<&a>Click to load <&b>%name%]>'
             - case '0':
               - define entry '<proc[msgHint].context[<&f>%name%|.schem unload <tern[<def[p].is[==].to[public]>]:-p %name%||%name%>|<&7>Height<&co><&6.pad_right[4]><schematic[dWE_saves_%p%_%name%].height.as_int><&nl><&7>Length<&co><&6.pad_right[4]><schematic[dWE_saves_%p%_%name%].length.as_int><&nl><&7>Width<&co><&6.pad_right[4]><schematic[dWE_saves_%p%_%name%].width.as_int><&nl><&7>Total Size<&co><&6.pad_right[4]><schematic[dWE_saves_%p%_%name%].blocks><&nl><&nl><proc[msgCentered].context[30|<&a>Click to Unload]>]>'
             - default:
               - define entry '<proc[msgHover].context[<&8>%name%|<proc[msgCentered].context[20|<&c>This is invalid!]>]>'
           - define entries '<def[entries].include[<&6><def[i].pad_left[2]>.<&sp>%entry%]>'
         - if <def[entries].is_empty> {
           - define entries '<def[entries].include[<&c>No schematics for you!]>'
           }
         - run s@msgBoxed instantly 'def:dwe|<proc[msgCommand].context[<&6>dWorldEditor|.help|<&a>Go back to main help]>|<&e><tern[<def[p].is[==].to[public]>]:Public||<def[p].as_player.name>> Schematic List|.schem <tern[<def[p].is[==].to[public]>]:list -p||list %p%>|<def[n]||1>|52|10|<def[entries].separated_by[|]||>'
 
       - case 'load':
         - define name '<def[args].get[2]||null>'
         - define v '<proc[dWE_SNV].context[%name%|%p%]>'
         - if '%v%' != '5' {
           - run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%|<player>|%name%'
           - queue clear
           }
         - schematic load 'name:dWE_saves_%p%_%name%' 'filename:dWE/saves/%p%/%name%'
         - run s@msgPrefixed 'def:dWE|Loaded %name%'
 
       - case 'unload':
         - define name '<def[args].get[2]||null>'
         - define v '<proc[dWE_SNV].context[%name%|%p%]>'
         - if '%v%' != '0' {
           - run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%|<player>|%name%'
           - queue clear
           }
         - schematic unload 'name:dWE_saves_%p%_%name%'
         - run s@msgPrefixed 'def:dWE|Unloaded %name%'
 
       - case 'save':
         - define name '<def[args].get[2]||null>'
         - define v '<proc[dWE_SNV].context[%name%|%p%]>'
         - if 'li@3|4' !contains '%v%' {
           - run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%|<player>|%name%'
           - queue clear
           }
         - schematic create 'name:dWE_saves_%p%_%name%' '<def[cuboid].min.simple>' '%cuboid%'
         - schematic save 'name:dWE_saves_%p%_%name%' 'filename:dWE/saves/%p%/%name%'
         - schematic unload 'name:dWE_saves_%p%_%name%'
         - run s@msgPrefixed 'def:dWE|Saved %name%'
 
       - case 'delete':
         - define name '<def[args].get[2]||null>'
         - define v '<proc[dWE_SNV].context[%name%|%p%]>'
         - if '%v%' != '5' {
           - run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%|<player>|%name%'
           - queue clear
           }
         - adjust server 'delete_file:schematics/dWE/saves/%p%/%name%.schematic'
         - run s@msgPrefixed 'def:dWE|Deleted %name%'
 
       - case 'copy':
         - define name '<def[args].get[2]||null>'
         - define v '<proc[dWE_SNV].context[%name%|%p%]>'
         - if '%v%' == '5' {
           - schematic load 'name:dWE_saves_%p%_%name%' 'filename:dWE/saves/%p%/%name%'
           }
           else if '%v%' != '0' {
           - run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%|<player>|%name%'
           - queue clear
           }
         - define copy '<def[args].get[3]||null>'
         - define v '<proc[dWE_SNV].context[%copy%|%p%]>'
         - if 'li@3|4' !contains '%v%' {
           - schematic unload 'name:dWE_saves_%p%_%name%'
           - run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%|<player>|%copy%'
           - queue clear
           }
         - schematic save 'name:dWE_saves_%p%_%name%' 'filename:dWE/saves/%p%/%copy%'
         - schematic unload 'name:dWE_saves_%p%_%name%'
         - run s@msgPrefixed 'def:dWE|Copied %name% to %copy%'
 
       - case 'rename':
         - define name '<def[args].get[2]||null>'
         - define v '<proc[dWE_SNV].context[%name%|%p%]>'
         - if '%v%' == '5' {
           - schematic load 'name:dWE_saves_%p%_%name%' 'filename:dWE/saves/%p%/%name%'
           }
           else if '%v%' != '0' {
           - run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%|<player>|%name%'
           - queue clear
           }
         - define copy '<def[args].get[3]||null>'
         - define v '<proc[dWE_SNV].context[%copy%|%p%]>'
         - if 'li@3|4' !contains '%v%' {
           - schematic unload 'name:dWE_saves_%p%_%name%'
           - run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%|<player>|%copy%'
           - queue clear
           }
         - schematic save 'name:dWE_saves_%p%_%name%' 'filename:dWE/saves/%p%/%copy%'
         - schematic unload 'name:dWE_saves_%p%_%name%'
         - adjust server 'delete_file:schematics/dWE/saves/%p%/%name%.schematic'
         - run s@msgPrefixed 'def:dWE|Renamed %name% to %copy%'
 
       - case 'paste':
         - define name '<def[args].get[2]||null>'
         - define v '<proc[dWE_SNV].context[%name%|%p%]>'
         - if '%v%' != '0' {
           - run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%|<player>|%name%'
           - queue clear
           }
         - define cuboid '<schematic[dWE_saves_%p%_%name%].cuboid[%o%]>'
         - if !<proc[dWE_dRegionCheck].context[<def[cuboid].min>|<def[cuboid].max>]> {
           - queue clear
           }
         # Save the existing area for undo history
         - define u '<player.uuid>'
         - define t 'Undo'
         - inject s@dWE_ISN
         # I know i should do logic here, but damnit... empty args shouldn't be a problem if they are optional!
         - ~schematic paste 'name:dWE_saves_%p%_%name%' '%o%' '%cuboid%' %d% %a%
         - run s@msgPrefixed 'def:dWE|Pasted %name%'
 
       - case 'bind':
         - define name '<def[args].get[2]||null>'
         - define v '<proc[dWE_SNV].context[%name%|%p%]>'
         - define item '<player.item_in_hand.simple>'
         - if <player.item_in_hand.material.is_block> {
           - run instantly delay:1t 's@dWE_Error' 'def:bind|1|<player>|<player.item_in_hand.material>'
           }
         - if '%v%' == '5' {
           - schematic load 'name:dWE_saves_%p%_%name%' 'filename:dWE/saves/%p%/%name%'
           - run s@msgPrefixed 'def:dWE|Loaded %name%'
           }
           else if '%v%' != '0' {
           - run instantly delay:1t 's@dWE_Error' 'def:schem_name|%v%|<player>|%name%'
           - queue clear
           }
         - define lore 'li@dWorldEditor Schematic|%name%|<&sp>|Length<&co>|Width<&co>|Height<&co>|Size<&co>'
         - inventory set 'd:<player.inventory>' 'o:%item%[display_name=%name%;lore=%lore%;nbt=dWE_Tool/schem;nbt=dWE_Owner/%p%;nbt=dWE_Name/%name%;nbt=dWE_delayed/%d%;nbt=dWE_noair/%a%;flags=HIDE_ATTRIBUTES|HIDE_DESTROYS|HIDE_ENCHANTS|HIDE_PLACED_ON|HIDE_POTION_EFFECTS|HIDE_UNBREAKABLE]' 'slot:<player.inventory.find[<player.item_in_hand>]>'
 
 #
 #
 #  END dWE Command Scripts
 #--------------------------------------
 #
 ################################################################################
 #
 #  dWorldEditor Other Utilities
 #
 # Other Utility functions used throughout dWorldEditor
 #
 #--------------------------------------
 #
 #  Command Permission Check Procedure script
 #  - Used to check if a player has permission to use a command.
 #
 dWE_HasPerm_Command:
 # Usage: <proc[dWE_HasPerm_Command].context[command|player]>
   type: procedure
   speed: 0
   debug: false
   definitions: command|player
 
   script:
     - if %player% == 'server' || <def[player].is_op> || <def[player].permission[dwe.admin]||false> {
       - determine true
       }
     - define perms "<s@dWE_Commands_%command%.yaml_key[data.permissions]||li@>"
     - if <def[perms].is_empty> {
       - determine true
       }
     - foreach %perms% {
       - define perm '<parse:%value%>'
       - if <def[player].permission[dwe.%perm%]> {
         - determine true
         }
       }
     - determine false
 #
 #--------------------------------------
 #
 #  getFacing Procedure script
 #  - Returns the cardinal direction the player is facing
 #
 getFacing:
 # Usage: <proc[getFacing].context[%pitch%|%yaw%]>
   type: procedure
   debug: false
   definitions: pitch|yaw
   script:
     - if <def[pitch].is[OR_MORE].than[45]||false> determine d
       else if <def[pitch].is[OR_LESS].than[-45]||false> determine u
       else if <def[yaw].is[OR_MORE].than[337.5]||false> || <def[yaw].is[LESS].than[22.5]||false> determine s
       else if <def[yaw].is[OR_MORE].than[292.5]||false> determine se
       else if <def[yaw].is[OR_MORE].than[247.5]||false> determine e
       else if <def[yaw].is[OR_MORE].than[202.5]||false> determine ne
       else if <def[yaw].is[OR_MORE].than[157.5]||false> determine n
       else if <def[yaw].is[OR_MORE].than[112.5]||false> determine nw
       else if <def[yaw].is[OR_MORE].than[67.5]||false> determine w
       else if <def[yaw].is[OR_MORE].than[22.5]||false> determine sw
       else determine 0
 #
 #--------------------------------------
 #
 #  Paste Schematic
 #
 #  This task will load an existing schematic, save the existing area for undo/
 #  redo history, paste the loaded schematic to the specified origin, and unload
 #  the schem from memory.
 #
 #  %t% - Type of schematic (undo|redo|clipboard)
 #  %u% - Player UUID
 #  %o% - The origin location
 #  %n% - The id number of the schematic to paste
 #
 dWE_PS:
   type: task
   debug: false
   limits:
     clipboard: 3
     undo: 3
     redo: 3
 
   script:
     - define limit '<script.yaml_key[limits.%t%]>'
     - if '%n%' > '%limit%' {
       - run instantly delay:1t s@dWE_Error 'def:history.%t%|2|<player>|%limit%'
       - queue clear
       }
     - define ct '<player.flag[dWE.History.%t%].as_list.size||0>'
     - if '%n%' > '%ct%' {
       - run instantly delay:1t s@dWE_Error 'def:history.%t%|<tern[<def[ct].is[==].to[0]>]:0||1>|<player>|%ct%'
       - queue clear
       }
     - define entry '<player.flag[dWE.History.%t%].as_list.last.before[/].add[1].sub[%n%].as_int||null>'
     - if '%entry%' == 'null' {
       - run instantly delay:1t s@dWE_Error 'def:history.generic|0|<player>|%t%|%entry%'
       - queue clear
       }
     - define schem 'dWE_%t%_%u%_%entry%'
     - if !<schematic.list.contains[%schem%]> {
       - if <server.has_file[schematics/dWE/%t%/%u%/%entry%.schematic]> {
         - schematic load 'name:%schem%' 'filename:dWE/%t%/%u%/%entry%'
         }
         else {
         - run instantly delay:1t s@dWE_Error 'def:history.generic|0|<player>|%t%|%entry%'
         - flag player 'dWE.History.%t%:<-:%entry%/<player.flag[dWE.History.%t%].map_get[%entry%]>'
         - queue clear
         }
       }
     - define cuboid '<schematic[%schem%].cuboid[%o%]>'
     - if !<proc[dWE_dRegionCheck].context[<def[cuboid].min>|<def[cuboid].max>]> {
       - schematic unload 'name:%schem%'
       - queue clear
       }
     # Save the existing area for undo history
     - define t '<tern[<def[t].is[==].to[Undo]>]:Redo||Undo>'
     - inject s@dWE_ISN
     # I know i should do logic here, but damnit... empty args shouldn't be a problem if they are optional!
     - ~schematic paste 'name:%schem%' '%o%' '%cuboid%' %d% %a%
     - schematic unload 'name:%schem%'
 #
 #  END dWE_PS
 #--------------------------------------
 #
 #  Incremental Schematic Names
 #
 #  Inject this task to create a new schematic.
 #  Automatically increment the name value and remove the oldest based on limit.
 #  Used for clipboard, undo, and redo schematics.
 #
 #  %t% - Type of schematic (undo|redo|clipboard)
 #  %u% - Player UUID
 #  %o% - The origin location
 #  %cuboid% - The cuboid object to make a schematic of
 #
 dWE_ISN:
   type: task
   debug: false
   limits:
     clipboard: 3
     undo: 3
     redo: 3
 
   script:
     # The limit should be definable in the config.yml file
     - define limit '<script.yaml_key[limits.%t%]>'
     - define last '<server.list_files[schematics/dWE/%t%/%u%].parse[before[.schematic]].numerical.last||0>'
     - define new '<def[last].add[1].as_int>'
     - schematic create 'name:dWE_%t%_%u%_%new%' '%o%' '%cuboid%'
     - schematic save 'name:dWE_%t%_%u%_%new%' 'filename:dWE/%t%/%u%/%new%'
     - schematic unload 'name:dWE_%t%_%u%_%new%'
     - if '%new%' > '%limit%' {
       - define old '<def[new].sub[%limit%]>'
       - define on 'dWE_%t%_%u%_%old%'
       - define of 'dWE/%t%/%u%/%old%'
       - if <schematic.list.contains[%on%]> {
         - schematic unload 'name:%on%'
         }
       - if <server.has_file[schematics/%of%.schematic]> {
         - adjust server 'delete_file:schematics/%of%.schematic'
         }
       - flag player 'dWE.History.%t%:<-:%old%/<player.flag[dWE.History.%t%].map_get[%old%]>'
       }
     - flag player 'dWE.History.%t%:->:%new%/%o%'
 #
 #  END dWE_ISN
 #--------------------------------------
 #
 #  Validate Schematic Names
 #
 dWE_SNV:
 # Usage: <proc[dWE_SNV].context[%name%|%player%]>
   type: procedure
   debug: false
   definitions: n|p
 
   script:
     - if '%n%' == 'null' {
       - determine 1
       }
     - if '<def[n].matches[^[a-zA-Z0-9-_]+$].not>' {
       - determine 2
       }
     - if !<server.has_file[schematics/dWE/saves/%p%/%n%.schematic]> {
       - if '%p%' == 'public' {
         - determine 3
         }
         else {
         - determine 4
         }
       }
     - if !<schematic[dWE_saves_%p%_%n%].exists> {
       - determine 5
       }
     - determine 0
 #
 #  END dWE_Validate_World
 #--------------------------------------
 #
 #  selectionSize Procedure script
 #  - Returns the size of the players selection
 #
 selectionSize:
 # Usage: <proc[selectionSize].context[%pos1%|%pos2%]>
   type: procedure
   debug: false
   definitions: pos1|pos2
   script:
     - define x '<def[pos1].as_location.x.sub[<def[pos2].as_location.x||0>].abs.add[1]||1>'
     - define y '<def[pos1].as_location.y.sub[<def[pos2].as_location.y||0>].abs.add[1]||1>'
     - define z '<def[pos1].as_location.z.sub[<def[pos2].as_location.z||0>].abs.add[1]||1>'
     - determine '<def[x].mul[%y%].mul[%z%].as_int||0>'
 #
 #  END dWE_selectionSize
 #--------------------------------------
 #
 #  selectionSize Procedure script
 #  - Returns the size of the players selection
 #
 dWE_dRegionCheck:
 # Usage: <proc[dWE_dRegionCheck].context[%pos1%|%pos2%]>
   type: procedure
   debug: false
   definitions: pos1|pos2
   script:
     - if !<server.list_scripts.filter[starts_with[s@dRegions]].is_empty> {
       - if <proc[dRegions_RegionOverlaps].context[<cu@%pos1%|%pos2%.replace[cu@].as_list.separated_by[/]>|<cu@%pos1%|%pos2%.center.world.name>|<player>]> {
         - if !<player.permission[dRegions.admin]||<player.is_op||false>> {
           - determine false
           }
         }
       }
     - determine true
 #
 #  END dWE_dRegionCheck
 #---------------------------------------
 #
-dWE_VersionCheck:
-  # Return the most recent repo version of dWE
-  type: procedure
-  debug: false
-
-  script:
-    - if !<server.has_flag[dWE.Version.Update]> && <queue.list> !contains 'q@dWE_VersionCheck' {
-      - run locally path:update id:dWE_VersionCheck
-      }
-    - determine '<server.flag[dWE.Version.Repo]||unknown>'
-
-  update:
-    - ~webget "http://www.mcmonkey.org/denizen/repo/version/<s@dWE_Version.yaml_key[id]>" save:page
-    - ^flag server "dWE.Version.Repo:<entry[page].result||<server.flag[dWE.Version.Repo]||unknown>>"
-    - ^flag server dWE.Version.Update d:1h
-#
-#  END dWE_VersionCheck
-#---------------------------------------
-#
 #  dWorldEditor Error Messages
 #
 dWE_Error:
   type: task
   debug: false
   msgs:
     schem_name:
       0:
         - '<&a><&o><def[4]><&a> is currently loaded.'
         - '<&a>Maybe you want to <proc[msgHint].context[<&b>unload|.schem unload <def[4]>|<&c>Click to unload <def[4]>]> <&a>it?'
       1:
         - '<&c>You didn<&sq>t enter a schematic name.'
         - '<&a>Maybe you want to see the <proc[msgCommand].context[<&b>list|.schem list|<&c>Click to list schematics]> <&a>of schematics?'
       2:
         - '<&c>Schematic name may only contain letters, numbers, hyphen, and underscore!'
       3:
         - '<&c>The public schematic <&o><def[4]> <&c>does not exist!'
         - '<&a>Maybe you want to see the <proc[msgCommand].context[<&b>list|.schem list -p|<&c>Click to list public schematics]> <&a>of schematics?'
       4:
         - '<&c><&o><def[4]> <&c>does not exist!'
         - '<&a>Maybe you want to see the <proc[msgCommand].context[<&b>list|.schem list|<&c>Click to list schematics]> <&a>of schematics?'
       5:
         - '<&c><&o><def[4]> <&c>is not loaded!'
         - '<&a>Maybe you want to <proc[msgHint].context[<&b>load|.schem load <def[4]>|<&c>Click to load <def[4]>]> <&a>it?'
     bind:
       1:
         - '<&c>Can not bind to <&o><def[4]><&c>!'
         - '<&a>Try something that isn<&sq>t a placeable block.'
     history:
       generic:
         0:
           - '<&c><def[5]> does not exist in <def[4]> history!'
       undo:
         0:
           - '<&c>Nothing left to Undo!'
         1:
           - '<&c>There are only <def[4]> entries to undo.'
         2:
           - '<&c>Undo history can only have <def[4]> entries.'
       redo:
         0:
           - '<&c>Nothing left to Redo!'
         1:
           - '<&c>There are only <def[4]> entries to redo.'
         2:
           - '<&c>Redo history can only have <def[4]> entries.'
       clipboard:
         0:
           - '<&c>Your Clipboard is empty!'
         1:
           - '<&c>You only have <def[4]> entries in your clipboard.'
         2:
           - '<&c>Clipboard history can only have <def[4]> entries.'
 
   script:
     - if '%3%' == 'server' {
       - announce to_console '<&4><&lb><&6>dWE<&4><&rb>  <script.yaml_key[msgs.%1%.%2%].get[1]>'
       }
       else {
       - define prefix '<proc[msgCommand].context[<&4><&lb><&6>dWE<&4><&rb>|.help|<&6>      dWE<&nl> <&nl><&d>Click for help]>   '
       - foreach '<script.yaml_key[msgs.%1%.%2%]>' {
         - narrate "%prefix%<parse:<def[value]>>"
         }
       }
 #
 #  END dWE_Error
 #--------------------------------------
 #
 #  END dWE Other Utilities
 #--------------------------------------
 #
 #  dWorldEditor Author Banner Items
 #
 # Banner items representing the authors
 #
 dwe_Author_mcmonkey:
   type: item
   debug: false
   material: creeper_skull
   display name: <&2><&l>MCMONKEY
   text_name: 'MCMONKEY'
   url: 'http://mcmonkey.org'
   lore:
   - <&a>Click to visit http://mcmonkey.org
 
 dwe_Author_Morphan1:
   type: item
   debug: false
   material: creeper_skull
   display name: <&2><&l>Morphan1
   text_name: 'Morphan1'
   url: 'http://en.wikipedia.org/wiki/Candy'
   lore:
   - <&a>pls2buymesome
 
 dwe_Author_Anthony:
   type: item
   debug: false
   material: i@human_skull
-  display name: "<&f>             <&pipe>Anthony<&pipe>"
+  display name: "<&f>             &pipeAnthony&pipe"
   text_name: '|Anthony|'
   url: 'http://mineconomy.org'
   lore:
   - <&7>  Owner<&co> <&e>M<&6>ine<&e>C<&6>onomy <&e>N<&6>etwork
   - <&5>-------------------------
   - <&7>
   - <&7>  I<&sq>ve been playing minecraft
   - <&7> and running a server since
   - <&7> 2010. I have fun and share
   - <&7> what I do.
   - <&7>
   - <&9>           Click To Visit
 #
 #  END dWE Author Banner Items
 #--------------------------------------
-