-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsmartsnippets.json
6790 lines (6790 loc) · 370 KB
/
smartsnippets.json
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
[
{
"prefix": "get_color_escape_sequence",
"body": "get_color_escape_sequence(${1:color})",
"desc": "`minetest.get_color_escape_sequence(color)`:\n* `color` is a ColorString\n* The escape sequence sets the text color to `color`",
"doc_lines": "L3722-L3724",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "colorize",
"body": "colorize(${1:color}, ${2:message})",
"desc": "`minetest.colorize(color, message)`:\n* Equivalent to:\n `minetest.get_color_escape_sequence(color) ..\n message ..\n minetest.get_color_escape_sequence(\"#ffffff\")`",
"doc_lines": "L3725-L3729",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "get_background_escape_sequence",
"body": "get_background_escape_sequence(${1:color})",
"desc": "`minetest.get_background_escape_sequence(color)`\n* `color` is a ColorString\n* The escape sequence sets the background of the whole text element to\n `color`. Only defined for item descriptions and tooltips.",
"doc_lines": "L3730-L3733",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "strip_foreground_colors",
"body": "strip_foreground_colors(${1:str})",
"desc": "`minetest.strip_foreground_colors(str)`\n* Removes foreground colors added by `get_color_escape_sequence`.",
"doc_lines": "L3734-L3735",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "strip_background_colors",
"body": "strip_background_colors(${1:str})",
"desc": "`minetest.strip_background_colors(str)`\n* Removes background colors added by `get_background_escape_sequence`.",
"doc_lines": "L3736-L3737",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "strip_colors",
"body": "strip_colors(${1:str})",
"desc": "`minetest.strip_colors(str)`\n* Removes all color escape sequences.",
"doc_lines": "L3738-L3739",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "new",
"body": "new(${1:x}, ${2:y}, ${3:z})",
"desc": "`vector.new(x, y, z)`",
"doc_lines": "L3767-L3767",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "new",
"body": "new([${1:a}${2:[, b}, ${3:c]]})",
"desc": "`vector.new([a[, b, c]])`:\n* Returns a new vector `(a, b, c)`.\n* Deprecated: `vector.new()` does the same as `vector.zero()` and\n `vector.new(v)` does the same as `vector.copy(v)`",
"doc_lines": "L3819-L3822",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "zero",
"body": "zero()",
"desc": "`vector.zero()`:\n* Returns a new vector `(0, 0, 0)`.",
"doc_lines": "L3823-L3824",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "copy",
"body": "copy(${1:v})",
"desc": "`vector.copy(v)`:\n* Returns a copy of the vector `v`.",
"doc_lines": "L3825-L3826",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "from_string",
"body": "from_string(${1:s}${2:[, init]})",
"desc": "`vector.from_string(s[, init])`:\n* Returns `v, np`, where `v` is a vector read from the given string `s` and\n `np` is the next position in the string after the vector.\n* Returns `nil` on failure.\n* `s`: Has to begin with a substring of the form `\"(x, y, z)\"`. Additional\n spaces, leaving away commas and adding an additional comma to the end\n is allowed.\n* `init`: If given starts looking for the vector at this string index.",
"doc_lines": "L3827-L3834",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "to_string",
"body": "to_string(${1:v})",
"desc": "`vector.to_string(v)`:\n* Returns a string of the form `\"(x, y, z)\"`.\n* `tostring(v)` does the same.",
"doc_lines": "L3835-L3837",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "direction",
"body": "direction(${1:p1}, ${2:p2})",
"desc": "`vector.direction(p1, p2)`:\n* Returns a vector of length 1 with direction `p1` to `p2`.\n* If `p1` and `p2` are identical, returns `(0, 0, 0)`.",
"doc_lines": "L3838-L3840",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "distance",
"body": "distance(${1:p1}, ${2:p2})",
"desc": "`vector.distance(p1, p2)`:\n* Returns zero or a positive number, the distance between `p1` and `p2`.",
"doc_lines": "L3841-L3842",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "length",
"body": "length(${1:v})",
"desc": "`vector.length(v)`:\n* Returns zero or a positive number, the length of vector `v`.",
"doc_lines": "L3843-L3844",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "normalize",
"body": "normalize(${1:v})",
"desc": "`vector.normalize(v)`:\n* Returns a vector of length 1 with direction of vector `v`.\n* If `v` has zero length, returns `(0, 0, 0)`.",
"doc_lines": "L3845-L3847",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "floor",
"body": "floor(${1:v})",
"desc": "`vector.floor(v)`:\n* Returns a vector, each dimension rounded down.",
"doc_lines": "L3848-L3849",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "round",
"body": "round(${1:v})",
"desc": "`vector.round(v)`:\n* Returns a vector, each dimension rounded to nearest integer.\n* At a multiple of 0.5, rounds away from zero.",
"doc_lines": "L3850-L3852",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "apply",
"body": "apply(${1:v}, ${2:func})",
"desc": "`vector.apply(v, func)`:\n* Returns a vector where the function `func` has been applied to each\n component.",
"doc_lines": "L3853-L3855",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "combine",
"body": "combine(${1:v}, ${2:w}, ${3:func})",
"desc": "`vector.combine(v, w, func)`:",
"doc_lines": "L3856-L3856",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "equals",
"body": "equals(${1:v1}, ${2:v2})",
"desc": "`vector.equals(v1, v2)`:\n* Returns a boolean, `true` if the vectors are identical.",
"doc_lines": "L3859-L3860",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "sort",
"body": "sort(${1:v1}, ${2:v2})",
"desc": "`vector.sort(v1, v2)`:\n* Returns in order minp, maxp vectors of the cuboid defined by `v1`, `v2`.",
"doc_lines": "L3861-L3862",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "angle",
"body": "angle(${1:v1}, ${2:v2})",
"desc": "`vector.angle(v1, v2)`:\n* Returns the angle between `v1` and `v2` in radians.",
"doc_lines": "L3863-L3864",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "dot",
"body": "dot(${1:v1}, ${2:v2})",
"desc": "`vector.dot(v1, v2)`:\n* Returns the dot product of `v1` and `v2`.",
"doc_lines": "L3865-L3866",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "cross",
"body": "cross(${1:v1}, ${2:v2})",
"desc": "`vector.cross(v1, v2)`:\n* Returns the cross product of `v1` and `v2`.",
"doc_lines": "L3867-L3868",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "offset",
"body": "offset(${1:v}, ${2:x}, ${3:y}, ${4:z})",
"desc": "`vector.offset(v, x, y, z)`:\n* Returns the sum of the vectors `v` and `(x, y, z)`.",
"doc_lines": "L3869-L3870",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "check",
"body": "check(${1:v})",
"desc": "`vector.check(v)`:\n* Returns a boolean value indicating whether `v` is a real vector, eg. created\n by a `vector.*` function.\n* Returns `false` for anything else, including tables like `{x=3,y=1,z=4}`.",
"doc_lines": "L3871-L3874",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "in_area",
"body": "in_area(${1:pos}, ${2:min}, ${3:max})",
"desc": "`vector.in_area(pos, min, max)`:",
"doc_lines": "L3875-L3875",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "add",
"body": "add(${1:v}, ${2:x})",
"desc": "`vector.add(v, x)`:\n* Returns a vector.\n* If `x` is a vector: Returns the sum of `v` and `x`.\n* If `x` is a number: Adds `x` to each component of `v`.",
"doc_lines": "L3883-L3886",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "subtract",
"body": "subtract(${1:v}, ${2:x})",
"desc": "`vector.subtract(v, x)`:\n* Returns a vector.\n* If `x` is a vector: Returns the difference of `v` subtracted by `x`.\n* If `x` is a number: Subtracts `x` from each component of `v`.",
"doc_lines": "L3887-L3890",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "multiply",
"body": "multiply(${1:v}, ${2:s})",
"desc": "`vector.multiply(v, s)`:\n* Returns a scaled vector.\n* Deprecated: If `s` is a vector: Returns the Schur product.",
"doc_lines": "L3891-L3893",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "divide",
"body": "divide(${1:v}, ${2:s})",
"desc": "`vector.divide(v, s)`:\n* Returns a scaled vector.\n* Deprecated: If `s` is a vector: Returns the Schur quotient.",
"doc_lines": "L3894-L3896",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "rotate",
"body": "rotate(${1:v}, ${2:r})",
"desc": "`vector.rotate(v, r)`:\n* Applies the rotation `r` to `v` and returns the result.\n* `vector.rotate(vector.new(0, 0, 1), r)` and\n `vector.rotate(vector.new(0, 1, 0), r)` return vectors pointing\n forward and up relative to an entity's rotation `r`.",
"doc_lines": "L3925-L3929",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "rotate_around_axis",
"body": "rotate_around_axis(${1:v1}, ${2:v2}, ${3:a})",
"desc": "`vector.rotate_around_axis(v1, v2, a)`:\n* Returns `v1` rotated around axis `v2` by `a` radians according to\n the right hand rule.",
"doc_lines": "L3930-L3932",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "dir_to_rotation",
"body": "dir_to_rotation(${1:direction}${2:[, up]})",
"desc": "`vector.dir_to_rotation(direction[, up])`:\n* Returns a rotation vector for `direction` pointing forward using `up`\n as the up vector.\n* If `up` is omitted, the roll of the returned vector defaults to zero.\n* Otherwise `direction` and `up` need to be vectors in a 90 degree angle to each other.",
"doc_lines": "L3933-L3937",
"kind": 2,
"detail": "Function",
"token": "vector."
},
{
"prefix": "hypot",
"body": "hypot(${1:x}, ${2:y})",
"desc": "`math.hypot(x, y)`\n* Get the hypotenuse of a triangle with legs x and y.\n Useful for distance calculation.",
"doc_lines": "L3965-L3967",
"kind": 2,
"detail": "Function",
"token": "math."
},
{
"prefix": "sign",
"body": "sign(${1:x}, ${2:tolerance})",
"desc": "`math.sign(x, tolerance)`: returns `-1`, `0` or `1`\n* Get the sign of a number.\n* tolerance: number, default: `0.0`\n* If the absolute value of `x` is within the `tolerance` or `x` is NaN,\n `0` is returned.",
"doc_lines": "L3968-L3972",
"kind": 2,
"detail": "Function",
"token": "math."
},
{
"prefix": "factorial",
"body": "factorial(${1:x})",
"desc": "`math.factorial(x)`: returns the factorial of `x`",
"doc_lines": "L3973-L3973",
"kind": 2,
"detail": "Function",
"token": "math."
},
{
"prefix": "round",
"body": "round(${1:x})",
"desc": "`math.round(x)`: Returns `x` rounded to the nearest integer.\n* At a multiple of 0.5, rounds away from zero.",
"doc_lines": "L3974-L3975",
"kind": 2,
"detail": "Function",
"token": "math."
},
{
"prefix": "split",
"body": "split(${1:str}, ${2:separator}, ${3:include_empty}, ${4:max_splits}, ${5:sep_is_pattern})",
"desc": "`string.split(str, separator, include_empty, max_splits, sep_is_pattern)`\n* `separator`: string, cannot be empty, default: `\",\"`\n* `include_empty`: boolean, default: `false`\n* `max_splits`: number, if it's negative, splits aren't limited,\n default: `-1`\n* `sep_is_pattern`: boolean, it specifies whether separator is a plain\n string or a pattern (regex), default: `false`\n* e.g. `\"a,b\":split\",\"` returns `{\"a\",\"b\"}`",
"doc_lines": "L3976-L3983",
"kind": 2,
"detail": "Function",
"token": "string."
},
{
"prefix": "wrap_text",
"body": "wrap_text(${1:str}, ${2:limit}, ${3:as_table})",
"desc": "`minetest.wrap_text(str, limit, as_table)`: returns a string or table\n* Adds newlines to the string to keep it within the specified character\n limit\n* Note that the returned lines may be longer than the limit since it only\n splits at word borders.\n* `limit`: number, maximal amount of characters in one line\n* `as_table`: boolean, if set to true, a table of lines instead of a string\n is returned, default: `false`",
"doc_lines": "L3986-L3993",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "pos_to_string",
"body": "pos_to_string(${1:pos}, ${2:decimal_places})",
"desc": "`minetest.pos_to_string(pos, decimal_places)`: returns string `\"(X,Y,Z)\"`\n* `pos`: table {x=X, y=Y, z=Z}\n* Converts the position `pos` to a human-readable, printable string\n* `decimal_places`: number, if specified, the x, y and z values of\n the position are rounded to the given decimal place.",
"doc_lines": "L3994-L3998",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "string_to_pos",
"body": "string_to_pos(${1:string})",
"desc": "`minetest.string_to_pos(string)`: returns a position or `nil`\n* Same but in reverse.\n* If the string can't be parsed to a position, nothing is returned.",
"doc_lines": "L3999-L4001",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "string_to_area",
"body": "string_to_area(\"(${1:X1}, ${2:Y1}, ${3:Z1}) (X2, Y2, Z2)\", relative_to)",
"desc": "`minetest.string_to_area(\"(X1, Y1, Z1) (X2, Y2, Z2)\", relative_to)`:\n* returns two positions\n* Converts a string representing an area box into two positions\n* X1, Y1, ... Z2 are coordinates\n* `relative_to`: Optional. If set to a position, each coordinate\n can use the tilde notation for relative positions\n* Tilde notation\n * `\"~\"`: Relative coordinate\n * `\"~<number>\"`: Relative coordinate plus `<number>`\n* Example: `minetest.string_to_area(\"(1,2,3) (~5,~-5,~)\", {x=10,y=10,z=10})`\n returns `{x=1,y=2,z=3}, {x=15,y=5,z=10}`",
"doc_lines": "L4002-L4012",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "formspec_escape",
"body": "formspec_escape(${1:string})",
"desc": "`minetest.formspec_escape(string)`: returns a string\n* escapes the characters \"[\", \"]\", \"\\\", \",\" and \";\", which cannot be used\n in formspecs.",
"doc_lines": "L4013-L4015",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "is_yes",
"body": "is_yes(${1:arg})",
"desc": "`minetest.is_yes(arg)`\n* returns true if passed 'y', 'yes', 'true' or a number that isn't zero.",
"doc_lines": "L4016-L4017",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "is_nan",
"body": "is_nan(${1:arg})",
"desc": "`minetest.is_nan(arg)`\n* returns true when the passed number represents NaN.",
"doc_lines": "L4018-L4019",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "get_us_time",
"body": "get_us_time()",
"desc": "`minetest.get_us_time()`\n* returns time with microsecond precision. May not return wall time.",
"doc_lines": "L4020-L4021",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "copy",
"body": "copy(${1:table})",
"desc": "`table.copy(table)`: returns a table\n* returns a deep copy of `table`",
"doc_lines": "L4022-L4023",
"kind": 2,
"detail": "Function",
"token": "table."
},
{
"prefix": "indexof",
"body": "indexof(${1:list}, ${2:val})",
"desc": "`table.indexof(list, val)`: returns the smallest numerical index containing\n the value `val` in the table `list`. Non-numerical indices are ignored.\n If `val` could not be found, `-1` is returned. `list` must not have\n negative indices.",
"doc_lines": "L4024-L4027",
"kind": 2,
"detail": "Function",
"token": "table."
},
{
"prefix": "insert_all",
"body": "insert_all(${1:table}, ${2:other_table})",
"desc": "`table.insert_all(table, other_table)`:\n* Appends all values in `other_table` to `table` - uses `#table + 1` to\n find new indices.",
"doc_lines": "L4028-L4030",
"kind": 2,
"detail": "Function",
"token": "table."
},
{
"prefix": "key_value_swap",
"body": "key_value_swap(${1:t})",
"desc": "`table.key_value_swap(t)`: returns a table with keys and values swapped\n* If multiple keys in `t` map to the same value, it is unspecified which\n value maps to that key.",
"doc_lines": "L4031-L4033",
"kind": 2,
"detail": "Function",
"token": "table."
},
{
"prefix": "shuffle",
"body": "shuffle(${1:table}, [${2:from]}, [${3:to]}, [${4:random_func]})",
"desc": "`table.shuffle(table, [from], [to], [random_func])`:\n* Shuffles elements `from` to `to` in `table` in place\n* `from` defaults to `1`\n* `to` defaults to `#table`\n* `random_func` defaults to `math.random`. This function receives two\n integers as arguments and should return a random integer inclusively\n between them.",
"doc_lines": "L4034-L4040",
"kind": 2,
"detail": "Function",
"token": "table."
},
{
"prefix": "pointed_thing_to_face_pos",
"body": "pointed_thing_to_face_pos(${1:placer}, ${2:pointed_thing})",
"desc": "`minetest.pointed_thing_to_face_pos(placer, pointed_thing)`: returns a\n position.\n* returns the exact position on the surface of a pointed node",
"doc_lines": "L4041-L4043",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "get_tool_wear_after_use",
"body": "get_tool_wear_after_use(${1:uses }${2:[, initial_wear]})",
"desc": "`minetest.get_tool_wear_after_use(uses [, initial_wear])`\n* Simulates a tool being used once and returns the added wear,\n such that, if only this function is used to calculate wear,\n the tool will break exactly after `uses` times of uses\n* `uses`: Number of times the tool can be used\n* `initial_wear`: The initial wear the tool starts with (default: 0)",
"doc_lines": "L4044-L4049",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "get_dig_params",
"body": "get_dig_params(${1:groups}, ${2:tool_capabilities }${3:[, wear]})",
"desc": "`minetest.get_dig_params(groups, tool_capabilities [, wear])`:\nSimulates an item that digs a node.\nReturns a table with the following fields:\n* `diggable`: `true` if node can be dug, `false` otherwise.\n* `time`: Time it would take to dig the node.\n* `wear`: How much wear would be added to the tool (ignored for non-tools).\n`time` and `wear` are meaningless if node's not diggable\nParameters:\n* `groups`: Table of the node groups of the node that would be dug\n* `tool_capabilities`: Tool capabilities table of the item\n* `wear`: Amount of wear the tool starts with (default: 0)",
"doc_lines": "L4050-L4060",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "get_hit_params",
"body": "get_hit_params(${1:groups}, ${2:tool_capabilities }${3:[, time_from_last_punch }${4:[, wear]]})",
"desc": "`minetest.get_hit_params(groups, tool_capabilities [, time_from_last_punch [, wear]])`:\nSimulates an item that punches an object.\nReturns a table with the following fields:\n* `hp`: How much damage the punch would cause (between -65535 and 65535).\n* `wear`: How much wear would be added to the tool (ignored for non-tools).\nParameters:\n* `groups`: Damage groups of the object\n* `tool_capabilities`: Tool capabilities table of the item\n* `time_from_last_punch`: time in seconds since last punch action\n* `wear`: Amount of wear the item starts with (default: 0)",
"doc_lines": "L4061-L4070",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "get_translator",
"body": "get_translator(${1:textdomain})",
"desc": "`minetest.get_translator(textdomain)` is a simple wrapper around\n `minetest.translate`, and `minetest.get_translator(textdomain)(str, ...)` is\n equivalent to `minetest.translate(textdomain, str, ...)`.\n It is intended to be used in the following way, so that it avoids verbose\n repetitions of `minetest.translate`:\n\n ```lua\n local S = minetest.get_translator(textdomain)\n S(str, ...)\n ```\n\n As an extra commodity, if `textdomain` is nil, it is assumed to be \"\" instead.",
"doc_lines": "L4091-L4102",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "translate",
"body": "translate(${1:textdomain}, ${2:str}, ${3:...})",
"desc": "`minetest.translate(textdomain, str, ...)` translates the string `str` with\n the given `textdomain` for disambiguation. The textdomain must match the\n textdomain specified in the translation file in order to get the string\n translated. This can be used so that a string is translated differently in\n different contexts.\n It is advised to use the name of the mod as textdomain whenever possible, to\n avoid clashes with other mods.\n This function must be given a number of arguments equal to the number of\n arguments the translated string expects.\n Arguments are literal strings -- they will not be translated.",
"doc_lines": "L4104-L4113",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "read_from_map",
"body": "read_from_map(${1:p1}, ${2:p2})",
"desc": "`read_from_map(p1, p2)`: Loads a chunk of map into the VoxelManip object\n containing the region formed by `p1` and `p2`.\n* returns actual emerged `pmin`, actual emerged `pmax`",
"doc_lines": "L4860-L4862",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "write_to_map",
"body": "write_to_map([${1:light]})",
"desc": "`write_to_map([light])`: Writes the data loaded from the `VoxelManip` back to\n the map.\n* **important**: data must be set using `VoxelManip:set_data()` before\n calling this.\n* if `light` is true, then lighting is automatically recalculated.\n The default value is true.\n If `light` is false, no light calculations happen, and you should correct\n all modified blocks with `minetest.fix_light()` as soon as possible.\n Keep in mind that modifying the map where light is incorrect can cause\n more lighting bugs.",
"doc_lines": "L4863-L4872",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "get_node_at",
"body": "get_node_at(${1:pos})",
"desc": "`get_node_at(pos)`: Returns a `MapNode` table of the node currently loaded in\n the `VoxelManip` at that position",
"doc_lines": "L4873-L4874",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "set_node_at",
"body": "set_node_at(${1:pos}, ${2:node})",
"desc": "`set_node_at(pos, node)`: Sets a specific `MapNode` in the `VoxelManip` at\n that position.",
"doc_lines": "L4875-L4876",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "get_data",
"body": "get_data([${1:buffer]})",
"desc": "`get_data([buffer])`: Retrieves the node content data loaded into the\n `VoxelManip` object.\n* returns raw node data in the form of an array of node content IDs\n* if the param `buffer` is present, this table will be used to store the\n result instead.",
"doc_lines": "L4877-L4881",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "set_data",
"body": "set_data(${1:data})",
"desc": "`set_data(data)`: Sets the data contents of the `VoxelManip` object",
"doc_lines": "L4882-L4882",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "update_map",
"body": "update_map()",
"desc": "`update_map()`: Does nothing, kept for compatibility.",
"doc_lines": "L4883-L4883",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "set_lighting",
"body": "set_lighting(${1:light}, [${2:p1}, ${3:p2]})",
"desc": "`set_lighting(light, [p1, p2])`: Set the lighting within the `VoxelManip` to\n a uniform value.\n* `light` is a table, `{day=<0...15>, night=<0...15>}`\n* To be used only by a `VoxelManip` object from\n `minetest.get_mapgen_object`.\n* (`p1`, `p2`) is the area in which lighting is set, defaults to the whole\n area if left out.",
"doc_lines": "L4884-L4890",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "get_light_data",
"body": "get_light_data([${1:buffer]})",
"desc": "`get_light_data([buffer])`: Gets the light data read into the\n `VoxelManip` object\n* Returns an array (indices 1 to volume) of integers ranging from `0` to\n `255`.\n* Each value is the bitwise combination of day and night light values\n (`0` to `15` each).\n* `light = day + (night * 16)`\n* If the param `buffer` is present, this table will be used to store the\n result instead.",
"doc_lines": "L4891-L4899",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "set_light_data",
"body": "set_light_data(${1:light_data})",
"desc": "`set_light_data(light_data)`: Sets the `param1` (light) contents of each node\n in the `VoxelManip`.\n* expects lighting data in the same format that `get_light_data()` returns",
"doc_lines": "L4900-L4902",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "get_param2_data",
"body": "get_param2_data([${1:buffer]})",
"desc": "`get_param2_data([buffer])`: Gets the raw `param2` data read into the\n `VoxelManip` object.\n* Returns an array (indices 1 to volume) of integers ranging from `0` to\n `255`.\n* If the param `buffer` is present, this table will be used to store the\n result instead.",
"doc_lines": "L4903-L4908",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "set_param2_data",
"body": "set_param2_data(${1:param2_data})",
"desc": "`set_param2_data(param2_data)`: Sets the `param2` contents of each node in\n the `VoxelManip`.",
"doc_lines": "L4909-L4910",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "calc_lighting",
"body": "calc_lighting([${1:p1}, ${2:p2]}, [${3:propagate_shadow]})",
"desc": "`calc_lighting([p1, p2], [propagate_shadow])`: Calculate lighting within the\n `VoxelManip`.\n* To be used only by a `VoxelManip` object from\n `minetest.get_mapgen_object`.\n* (`p1`, `p2`) is the area in which lighting is set, defaults to the whole\n area if left out or nil. For almost all uses these should be left out\n or nil to use the default.\n* `propagate_shadow` is an optional boolean deciding whether shadows in a\n generated mapchunk above are propagated down into the mapchunk, defaults\n to `true` if left out.",
"doc_lines": "L4911-L4920",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "update_liquids",
"body": "update_liquids()",
"desc": "`update_liquids()`: Update liquid flow",
"doc_lines": "L4921-L4921",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "was_modified",
"body": "was_modified()",
"desc": "`was_modified()`: Returns `true` or `false` if the data in the voxel\n manipulator had been modified since the last read from map, due to a call to\n `minetest.set_data()` on the loaded area elsewhere.",
"doc_lines": "L4922-L4924",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "get_emerged_area",
"body": "get_emerged_area()",
"desc": "`get_emerged_area()`: Returns actual emerged minimum and maximum positions.",
"doc_lines": "L4925-L4925",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "getExtent",
"body": "getExtent()",
"desc": "`getExtent()`: returns a 3D vector containing the size of the area formed by\n `MinEdge` and `MaxEdge`.",
"doc_lines": "L4937-L4938",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "getVolume",
"body": "getVolume()",
"desc": "`getVolume()`: returns the volume of the area formed by `MinEdge` and\n `MaxEdge`.",
"doc_lines": "L4939-L4940",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "index",
"body": "index(${1:x}, ${2:y}, ${3:z})",
"desc": "`index(x, y, z)`: returns the index of an absolute position in a flat array\n starting at `1`.\n* `x`, `y` and `z` must be integers to avoid an incorrect index result.\n* The position (x, y, z) is not checked for being inside the area volume,\n being outside can cause an incorrect index result.\n* Useful for things like `VoxelManip`, raw Schematic specifiers,\n `PerlinNoiseMap:get2d`/`3dMap`, and so on.",
"doc_lines": "L4941-L4947",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "indexp",
"body": "indexp(${1:p})",
"desc": "`indexp(p)`: same functionality as `index(x, y, z)` but takes a vector.\n* As with `index(x, y, z)`, the components of `p` must be integers, and `p`\n is not checked for being inside the area volume.",
"doc_lines": "L4948-L4950",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "position",
"body": "position(${1:i})",
"desc": "`position(i)`: returns the absolute position vector corresponding to index\n `i`.",
"doc_lines": "L4951-L4952",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "contains",
"body": "contains(${1:x}, ${2:y}, ${3:z})",
"desc": "`contains(x, y, z)`: check if (`x`,`y`,`z`) is inside area formed by\n `MinEdge` and `MaxEdge`.",
"doc_lines": "L4953-L4954",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "containsp",
"body": "containsp(${1:p})",
"desc": "`containsp(p)`: same as above, except takes a vector",
"doc_lines": "L4955-L4955",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "containsi",
"body": "containsi(${1:i})",
"desc": "`containsi(i)`: same as above, except takes an index `i`",
"doc_lines": "L4956-L4956",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "iter",
"body": "iter(${1:minx}, ${2:miny}, ${3:minz}, ${4:maxx}, ${5:maxy}, ${6:maxz})",
"desc": "`iter(minx, miny, minz, maxx, maxy, maxz)`: returns an iterator that returns\n indices.\n* from (`minx`,`miny`,`minz`) to (`maxx`,`maxy`,`maxz`) in the order of\n `[z [y [x]]]`.",
"doc_lines": "L4957-L4960",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "iterp",
"body": "iterp(${1:minp}, ${2:maxp})",
"desc": "`iterp(minp, maxp)`: same as above, except takes a vector",
"doc_lines": "L4961-L4961",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "on_activate",
"body": "on_activate(${1:self}, ${2:staticdata}, ${3:dtime_s})",
"desc": "`on_activate(self, staticdata, dtime_s)`\n* Called when the object is instantiated.\n* `dtime_s` is the time passed since the object was unloaded, which can be\n used for updating the entity state.",
"doc_lines": "L5069-L5072",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "on_deactivate",
"body": "on_deactivate(${1:self}, ${2:removal})",
"desc": "`on_deactivate(self, removal)`\n* Called when the object is about to get removed or unloaded.",
"doc_lines": "L5073-L5074",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "on_step",
"body": "on_step(${1:self}, ${2:dtime}, ${3:moveresult})",
"desc": "`on_step(self, dtime, moveresult)`\n* Called on every server tick, after movement and collision processing.\n* `dtime`: elapsed time since last call\n* `moveresult`: table with collision info (only available if physical=true)",
"doc_lines": "L5081-L5084",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "on_punch",
"body": "on_punch(${1:self}, ${2:puncher}, ${3:time_from_last_punch}, ${4:tool_capabilities}, ${5:dir}, ${6:damage})",
"desc": "`on_punch(self, puncher, time_from_last_punch, tool_capabilities, dir, damage)`\n* Called when somebody punches the object.\n* Note that you probably want to handle most punches using the automatic\n armor group system.\n* `puncher`: an `ObjectRef` (can be `nil`)\n* `time_from_last_punch`: Meant for disallowing spamming of clicks\n (can be `nil`).\n* `tool_capabilities`: capability table of used item (can be `nil`)\n* `dir`: unit vector of direction of punch. Always defined. Points from the\n puncher to the punched.\n* `damage`: damage that will be done to entity.\n* Can return `true` to prevent the default damage mechanism.",
"doc_lines": "L5085-L5096",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "on_death",
"body": "on_death(${1:self}, ${2:killer})",
"desc": "`on_death(self, killer)`\n* Called when the object dies.\n* `killer`: an `ObjectRef` (can be `nil`)",
"doc_lines": "L5097-L5099",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "on_rightclick",
"body": "on_rightclick(${1:self}, ${2:clicker})",
"desc": "`on_rightclick(self, clicker)`\n* Called when `clicker` pressed the 'place/use' key while pointing\n to the object (not necessarily an actual rightclick)\n* `clicker`: an `ObjectRef` (may or may not be a player)",
"doc_lines": "L5100-L5103",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "on_attach_child",
"body": "on_attach_child(${1:self}, ${2:child})",
"desc": "`on_attach_child(self, child)`\n* `child`: an `ObjectRef` of the child that attaches",
"doc_lines": "L5104-L5105",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "on_detach_child",
"body": "on_detach_child(${1:self}, ${2:child})",
"desc": "`on_detach_child(self, child)`\n* `child`: an `ObjectRef` of the child that detaches",
"doc_lines": "L5106-L5107",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "on_detach",
"body": "on_detach(${1:self}, ${2:parent})",
"desc": "`on_detach(self, parent)`\n* `parent`: an `ObjectRef` (can be `nil`) from where it got detached\n* This happens before the parent object is removed from the world",
"doc_lines": "L5108-L5110",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "get_staticdata",
"body": "get_staticdata(${1:self})",
"desc": "`get_staticdata(self)`\n* Should return a string that will be passed to `on_activate` when the\n object is instantiated the next time.",
"doc_lines": "L5111-L5113",
"kind": 1,
"detail": "Method",
"token": ":"
},
{
"prefix": "get_current_modname",
"body": "get_current_modname()",
"desc": "`minetest.get_current_modname()`: returns the currently loading mod's name,\n when loading a mod.",
"doc_lines": "L5318-L5319",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "get_modpath",
"body": "get_modpath(${1:modname})",
"desc": "`minetest.get_modpath(modname)`: returns the directory path for a mod,\n e.g. `\"/home/user/.minetest/usermods/modname\"`.\n* Returns nil if the mod is not enabled or does not exist (not installed).\n* Works regardless of whether the mod has been loaded yet.\n* Useful for loading additional `.lua` modules or static data from a mod,\n or checking if a mod is enabled.",
"doc_lines": "L5320-L5325",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "get_modnames",
"body": "get_modnames()",
"desc": "`minetest.get_modnames()`: returns a list of enabled mods, sorted alphabetically.\n* Does not include disabled mods, even if they are installed.",
"doc_lines": "L5326-L5327",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "get_game_info",
"body": "get_game_info()",
"desc": "`minetest.get_game_info()`: returns a table containing information about the\n current game. Note that other meta information (e.g. version/release number)\n can be manually read from `game.conf` in the game's root directory.\n\n ```lua\n {\n id = string,\n title = string,\n author = string,\n -- The root directory of the game\n path = string,\n }\n ```",
"doc_lines": "L5328-L5340",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "get_worldpath",
"body": "get_worldpath()",
"desc": "`minetest.get_worldpath()`: returns e.g. `\"/home/user/.minetest/world\"`\n* Useful for storing custom data",
"doc_lines": "L5342-L5343",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "get_mod_data_path",
"body": "get_mod_data_path()",
"desc": "`minetest.get_mod_data_path()`: returns e.g. `\"/home/user/.minetest/mod_data/mymod\"`\n* Useful for storing custom data *independently of worlds*.\n* Must be called during mod load time.\n* Can read or write to this directory at any time.\n* It's possible that multiple Minetest instances are running at the same\n time, which may lead to corruption if you are not careful.",
"doc_lines": "L5344-L5349",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "is_singleplayer",
"body": "is_singleplayer()",
"desc": "`minetest.is_singleplayer()`",
"doc_lines": "L5350-L5350",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "has_feature",
"body": "has_feature(${1:arg})",
"desc": "`minetest.has_feature(arg)`: returns `boolean, missing_features`\n* `arg`: string or table in format `{foo=true, bar=true}`\n* `missing_features`: `{foo=true, bar=true}`",
"doc_lines": "L5455-L5457",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "get_player_information",
"body": "get_player_information(${1:player_name})",
"desc": "`minetest.get_player_information(player_name)`: Table containing information\n about a player. Example return value:\n\n ```lua\n {\n address = \"127.0.0.1\", -- IP address of client\n ip_version = 4, -- IPv4 / IPv6\n connection_uptime = 200, -- seconds since client connected\n protocol_version = 32, -- protocol version used by client\n formspec_version = 2, -- supported formspec version\n lang_code = \"fr\", -- Language code used for translation\n\n -- the following keys can be missing if no stats have been collected yet\n min_rtt = 0.01, -- minimum round trip time\n max_rtt = 0.2, -- maximum round trip time\n avg_rtt = 0.02, -- average round trip time\n min_jitter = 0.01, -- minimum packet time jitter\n max_jitter = 0.5, -- maximum packet time jitter\n avg_jitter = 0.03, -- average packet time jitter\n -- the following information is available in a debug build only!!!\n -- DO NOT USE IN MODS\n --ser_vers = 26, -- serialization version used by client\n --major = 0, -- major version number\n --minor = 4, -- minor version number\n --patch = 10, -- patch version number\n --vers_string = \"0.4.9-git\", -- full version string\n --state = \"Active\" -- current client state\n }\n ```",
"doc_lines": "L5458-L5486",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "get_player_window_information",
"body": "get_player_window_information(${1:player_name})",
"desc": "`minetest.get_player_window_information(player_name)`:\n\n ```lua\n -- Will only be present if the client sent this information (requires v5.7+)\n --\n -- Note that none of these things are constant, they are likely to change during a client\n -- connection as the player resizes the window and moves it between monitors\n --\n -- real_gui_scaling and real_hud_scaling can be used instead of DPI.\n -- OSes don't necessarily give the physical DPI, as they may allow user configuration.\n -- real_*_scaling is just OS DPI / 96 but with another level of user configuration.\n {\n -- Current size of the in-game render target (pixels).\n --\n -- This is usually the window size, but may be smaller in certain situations,\n -- such as side-by-side mode.\n size = {\n x = 1308,\n y = 577,\n },\n\n -- Estimated maximum formspec size before Minetest will start shrinking the\n -- formspec to fit. For a fullscreen formspec, use a size 10-20% larger than\n -- this and `padding[-0.01,-0.01]`.\n max_formspec_size = {\n x = 20,\n y = 11.25\n },\n\n -- GUI Scaling multiplier\n -- Equal to the setting `gui_scaling` multiplied by `dpi / 96`\n real_gui_scaling = 1,\n\n -- HUD Scaling multiplier\n -- Equal to the setting `hud_scaling` multiplied by `dpi / 96`\n real_hud_scaling = 1,\n\n -- Whether the touchscreen controls are enabled.\n -- Usually (but not always) `true` on Android.\n -- Requires at least Minetest 5.9.0 on the client. For older clients, it\n -- is always set to `false`.\n touch_controls = false,\n }\n ```",
"doc_lines": "L5488-L5531",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "mkdir",
"body": "mkdir(${1:path})",
"desc": "`minetest.mkdir(path)`: returns success.\n* Creates a directory specified by `path`, creating parent directories\n if they don't exist.",
"doc_lines": "L5533-L5535",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "rmdir",
"body": "rmdir(${1:path}, ${2:recursive})",
"desc": "`minetest.rmdir(path, recursive)`: returns success.\n* Removes a directory specified by `path`.\n* If `recursive` is set to `true`, the directory is recursively removed.\n Otherwise, the directory will only be removed if it is empty.\n* Returns true on success, false on failure.",
"doc_lines": "L5536-L5540",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "cpdir",
"body": "cpdir(${1:source}, ${2:destination})",
"desc": "`minetest.cpdir(source, destination)`: returns success.\n* Copies a directory specified by `path` to `destination`\n* Any files in `destination` will be overwritten if they already exist.\n* Returns true on success, false on failure.",
"doc_lines": "L5541-L5544",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "mvdir",
"body": "mvdir(${1:source}, ${2:destination})",
"desc": "`minetest.mvdir(source, destination)`: returns success.\n* Moves a directory specified by `path` to `destination`.\n* If the `destination` is a non-empty directory, then the move will fail.\n* Returns true on success, false on failure.",
"doc_lines": "L5545-L5548",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "get_dir_list",
"body": "get_dir_list(${1:path}, [${2:is_dir]})",
"desc": "`minetest.get_dir_list(path, [is_dir])`: returns list of entry names\n* is_dir is one of:\n * nil: return all entries,\n * true: return only subdirectory names, or\n * false: return only file names.",
"doc_lines": "L5549-L5553",
"kind": 2,
"detail": "Function",
"token": "minetest."
},
{
"prefix": "safe_file_write",
"body": "safe_file_write(${1:path}, ${2:content})",
"desc": "`minetest.safe_file_write(path, content)`: returns boolean indicating success\n* Replaces contents of file at path with new contents in a safe (atomic)\n way. Use this instead of below code when writing e.g. database files:\n `local f = io.open(path, \"wb\"); f:write(content); f:close()`",
"doc_lines": "L5554-L5557",
"kind": 2,
"detail": "Function",
"token": "minetest."
},