redscript-mc 2.5.0 → 2.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +80 -0
- package/README.md +5 -75
- package/README.zh.md +165 -147
- package/ROADMAP.md +195 -0
- package/dist/data/linalg/function/_vec2d_len_sq_fx.mcfunction +17 -0
- package/dist/data/linalg/function/_vec3d_len_sq_fx.mcfunction +27 -0
- package/dist/data/linalg/function/load.mcfunction +1 -0
- package/dist/data/linalg/function/mat2d_det.mcfunction +16 -0
- package/dist/data/linalg/function/mat2d_mul_r0c0.mcfunction +16 -0
- package/dist/data/linalg/function/mat2d_mul_r0c1.mcfunction +16 -0
- package/dist/data/linalg/function/mat2d_mul_r1c0.mcfunction +16 -0
- package/dist/data/linalg/function/mat2d_mul_r1c1.mcfunction +16 -0
- package/dist/data/linalg/function/mat2d_vecmul_x.mcfunction +16 -0
- package/dist/data/linalg/function/mat2d_vecmul_y.mcfunction +16 -0
- package/dist/data/linalg/function/solve2d_x.mcfunction +27 -0
- package/dist/data/linalg/function/solve2d_y.mcfunction +27 -0
- package/dist/data/linalg/function/vec2d_dist.mcfunction +15 -0
- package/dist/data/linalg/function/vec2d_dot.mcfunction +16 -0
- package/dist/data/linalg/function/vec2d_length.mcfunction +21 -0
- package/dist/data/linalg/function/vec2d_normalize_x.mcfunction +8 -0
- package/dist/data/linalg/function/vec2d_normalize_x__merge_1.mcfunction +10 -0
- package/dist/data/linalg/function/vec2d_normalize_x__then_0.mcfunction +3 -0
- package/dist/data/linalg/function/vec2d_normalize_y.mcfunction +8 -0
- package/dist/data/linalg/function/vec2d_normalize_y__merge_1.mcfunction +10 -0
- package/dist/data/linalg/function/vec2d_normalize_y__then_0.mcfunction +3 -0
- package/dist/data/linalg/function/vec3d_cross_x.mcfunction +16 -0
- package/dist/data/linalg/function/vec3d_cross_y.mcfunction +16 -0
- package/dist/data/linalg/function/vec3d_cross_z.mcfunction +16 -0
- package/dist/data/linalg/function/vec3d_dist.mcfunction +21 -0
- package/dist/data/linalg/function/vec3d_dot.mcfunction +26 -0
- package/dist/data/linalg/function/vec3d_length.mcfunction +31 -0
- package/dist/data/linalg/function/vec3d_normalize_x.mcfunction +9 -0
- package/dist/data/linalg/function/vec3d_normalize_x__merge_1.mcfunction +11 -0
- package/dist/data/linalg/function/vec3d_normalize_x__then_0.mcfunction +3 -0
- package/dist/data/linalg/function/vec3d_normalize_y.mcfunction +9 -0
- package/dist/data/linalg/function/vec3d_normalize_y__merge_1.mcfunction +11 -0
- package/dist/data/linalg/function/vec3d_normalize_y__then_0.mcfunction +3 -0
- package/dist/data/linalg/function/vec3d_normalize_z.mcfunction +9 -0
- package/dist/data/linalg/function/vec3d_normalize_z__merge_1.mcfunction +11 -0
- package/dist/data/linalg/function/vec3d_normalize_z__then_0.mcfunction +3 -0
- package/dist/data/math_hp/function/cos_hp.mcfunction +8 -0
- package/dist/data/math_hp/function/div3_hp.mcfunction +23 -0
- package/dist/data/math_hp/function/div_hp.mcfunction +13 -0
- package/dist/data/math_hp/function/init_div.mcfunction +1 -0
- package/dist/data/math_hp/function/init_trig.mcfunction +1 -0
- package/dist/data/math_hp/function/ln_5term.mcfunction +6 -0
- package/dist/data/math_hp/function/ln_5term__loop_body_1.mcfunction +8 -0
- package/dist/data/math_hp/function/ln_5term__loop_body_4.mcfunction +8 -0
- package/dist/data/math_hp/function/ln_5term__loop_exit_2.mcfunction +1 -0
- package/dist/data/math_hp/function/ln_5term__loop_exit_5.mcfunction +61 -0
- package/dist/data/math_hp/function/ln_5term__loop_header_0.mcfunction +3 -0
- package/dist/data/math_hp/function/ln_5term__loop_header_3.mcfunction +6 -0
- package/dist/data/math_hp/function/load.mcfunction +1 -0
- package/dist/data/math_hp/function/norm3_hp.mcfunction +43 -0
- package/dist/data/math_hp/function/sin_hp.mcfunction +8 -0
- package/dist/data/math_hp/function/sqrt_hp.mcfunction +17 -0
- package/dist/data/math_hp/function/sqrt_hp__merge_1.mcfunction +21 -0
- package/dist/data/math_hp/function/sqrt_hp__then_0.mcfunction +2 -0
- package/dist/data/minecraft/tags/function/load.json +1 -2
- package/dist/data/minecraft/tags/function/tick.json +1 -1
- package/dist/data/readme_demo/function/_draw.mcfunction +1 -0
- package/dist/data/readme_demo/function/_init.mcfunction +1 -0
- package/dist/data/readme_demo/function/_math_init.mcfunction +4 -0
- package/dist/data/readme_demo/function/_wave_tick.mcfunction +1 -0
- package/dist/data/readme_demo/function/_wave_tick__foreach_t8.mcfunction +109 -0
- package/dist/data/readme_demo/function/acos_approx.mcfunction +7 -0
- package/dist/data/readme_demo/function/approx_eq.mcfunction +10 -0
- package/dist/data/readme_demo/function/approx_eq__merge_1.mcfunction +3 -0
- package/dist/data/readme_demo/function/approx_eq__merge_3.mcfunction +2 -0
- package/dist/data/readme_demo/function/approx_eq__then_0.mcfunction +4 -0
- package/dist/data/readme_demo/function/approx_eq__then_2.mcfunction +2 -0
- package/dist/data/readme_demo/function/asin_approx.mcfunction +5 -0
- package/dist/data/readme_demo/function/asin_approx__merge_1.mcfunction +3 -0
- package/dist/data/readme_demo/function/asin_approx__merge_10.mcfunction +5 -0
- package/dist/data/readme_demo/function/asin_approx__merge_4.mcfunction +12 -0
- package/dist/data/readme_demo/function/asin_approx__merge_7.mcfunction +14 -0
- package/dist/data/readme_demo/function/asin_approx__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/asin_approx__then_3.mcfunction +2 -0
- package/dist/data/readme_demo/function/asin_approx__then_6.mcfunction +2 -0
- package/dist/data/readme_demo/function/asin_approx__then_9.mcfunction +2 -0
- package/dist/data/readme_demo/function/cbrt_fx.mcfunction +5 -0
- package/dist/data/readme_demo/function/cbrt_fx__loop_body_6.mcfunction +7 -0
- package/dist/data/readme_demo/function/cbrt_fx__loop_exit_7.mcfunction +1 -0
- package/dist/data/readme_demo/function/cbrt_fx__loop_header_5.mcfunction +4 -0
- package/dist/data/readme_demo/function/cbrt_fx__merge_1.mcfunction +8 -0
- package/dist/data/readme_demo/function/cbrt_fx__merge_11.mcfunction +5 -0
- package/dist/data/readme_demo/function/cbrt_fx__merge_13.mcfunction +4 -0
- package/dist/data/readme_demo/function/cbrt_fx__merge_4.mcfunction +2 -0
- package/dist/data/readme_demo/function/cbrt_fx__merge_9.mcfunction +13 -0
- package/dist/data/readme_demo/function/cbrt_fx__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/cbrt_fx__then_10.mcfunction +2 -0
- package/dist/data/readme_demo/function/cbrt_fx__then_12.mcfunction +2 -0
- package/dist/data/readme_demo/function/cbrt_fx__then_3.mcfunction +2 -0
- package/dist/data/readme_demo/function/cbrt_fx__then_8.mcfunction +2 -0
- package/dist/data/readme_demo/function/cbrt_newton.mcfunction +5 -0
- package/dist/data/readme_demo/function/cbrt_newton__else_7.mcfunction +2 -0
- package/dist/data/readme_demo/function/cbrt_newton__merge_1.mcfunction +11 -0
- package/dist/data/readme_demo/function/cbrt_newton__merge_4.mcfunction +1 -0
- package/dist/data/readme_demo/function/cbrt_newton__merge_6.mcfunction +1 -0
- package/dist/data/readme_demo/function/cbrt_newton__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/cbrt_newton__then_3.mcfunction +17 -0
- package/dist/data/readme_demo/function/cbrt_newton__then_5.mcfunction +11 -0
- package/dist/data/readme_demo/function/ceil_div.mcfunction +9 -0
- package/dist/data/readme_demo/function/combinations.mcfunction +6 -0
- package/dist/data/readme_demo/function/combinations__loop_body_9.mcfunction +15 -0
- package/dist/data/readme_demo/function/combinations__loop_exit_10.mcfunction +1 -0
- package/dist/data/readme_demo/function/combinations__loop_header_8.mcfunction +3 -0
- package/dist/data/readme_demo/function/combinations__merge_1.mcfunction +3 -0
- package/dist/data/readme_demo/function/combinations__merge_4.mcfunction +6 -0
- package/dist/data/readme_demo/function/combinations__merge_7.mcfunction +3 -0
- package/dist/data/readme_demo/function/combinations__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/combinations__then_3.mcfunction +2 -0
- package/dist/data/readme_demo/function/combinations__then_6.mcfunction +4 -0
- package/dist/data/readme_demo/function/cos_fixed.mcfunction +7 -0
- package/dist/data/readme_demo/function/cubic_disc_fx.mcfunction +26 -0
- package/dist/data/readme_demo/function/cubic_newton.mcfunction +8 -0
- package/dist/data/readme_demo/function/cubic_newton__loop_body_1.mcfunction +55 -0
- package/dist/data/readme_demo/function/cubic_newton__loop_exit_2.mcfunction +1 -0
- package/dist/data/readme_demo/function/cubic_newton__loop_header_0.mcfunction +4 -0
- package/dist/data/readme_demo/function/cubic_newton__merge_10.mcfunction +1 -0
- package/dist/data/readme_demo/function/cubic_newton__merge_4.mcfunction +4 -0
- package/dist/data/readme_demo/function/cubic_newton__merge_6.mcfunction +4 -0
- package/dist/data/readme_demo/function/cubic_newton__merge_8.mcfunction +4 -0
- package/dist/data/readme_demo/function/cubic_newton__then_3.mcfunction +2 -0
- package/dist/data/readme_demo/function/cubic_newton__then_5.mcfunction +13 -0
- package/dist/data/readme_demo/function/cubic_newton__then_7.mcfunction +4 -0
- package/dist/data/readme_demo/function/cubic_newton__then_9.mcfunction +2 -0
- package/dist/data/readme_demo/function/divfix.mcfunction +6 -0
- package/dist/data/readme_demo/function/divfix__merge_1.mcfunction +6 -0
- package/dist/data/readme_demo/function/divfix__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/exp_fx.mcfunction +16 -0
- package/dist/data/readme_demo/function/exp_fx__loop_body_10.mcfunction +8 -0
- package/dist/data/readme_demo/function/exp_fx__loop_body_5.mcfunction +8 -0
- package/dist/data/readme_demo/function/exp_fx__loop_exit_11.mcfunction +1 -0
- package/dist/data/readme_demo/function/exp_fx__loop_exit_6.mcfunction +1 -0
- package/dist/data/readme_demo/function/exp_fx__loop_header_4.mcfunction +3 -0
- package/dist/data/readme_demo/function/exp_fx__loop_header_9.mcfunction +3 -0
- package/dist/data/readme_demo/function/exp_fx__merge_1.mcfunction +47 -0
- package/dist/data/readme_demo/function/exp_fx__merge_3.mcfunction +4 -0
- package/dist/data/readme_demo/function/exp_fx__merge_8.mcfunction +1 -0
- package/dist/data/readme_demo/function/exp_fx__then_0.mcfunction +7 -0
- package/dist/data/readme_demo/function/exp_fx__then_2.mcfunction +2 -0
- package/dist/data/readme_demo/function/exp_fx__then_7.mcfunction +5 -0
- package/dist/data/readme_demo/function/factorial.mcfunction +5 -0
- package/dist/data/readme_demo/function/factorial__loop_body_4.mcfunction +7 -0
- package/dist/data/readme_demo/function/factorial__loop_exit_5.mcfunction +1 -0
- package/dist/data/readme_demo/function/factorial__loop_header_3.mcfunction +3 -0
- package/dist/data/readme_demo/function/factorial__merge_1.mcfunction +3 -0
- package/dist/data/readme_demo/function/factorial__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/gamma_int.mcfunction +5 -0
- package/dist/data/readme_demo/function/gamma_int__merge_1.mcfunction +6 -0
- package/dist/data/readme_demo/function/gamma_int__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/gcd.mcfunction +7 -0
- package/dist/data/readme_demo/function/gcd__loop_body_5.mcfunction +5 -0
- package/dist/data/readme_demo/function/gcd__loop_exit_6.mcfunction +1 -0
- package/dist/data/readme_demo/function/gcd__loop_header_4.mcfunction +4 -0
- package/dist/data/readme_demo/function/gcd__merge_1.mcfunction +5 -0
- package/dist/data/readme_demo/function/gcd__merge_3.mcfunction +1 -0
- package/dist/data/readme_demo/function/gcd__then_0.mcfunction +4 -0
- package/dist/data/readme_demo/function/gcd__then_2.mcfunction +4 -0
- package/dist/data/readme_demo/function/isqrt.mcfunction +5 -0
- package/dist/data/readme_demo/function/isqrt__loop_body_10.mcfunction +8 -0
- package/dist/data/readme_demo/function/isqrt__loop_body_13.mcfunction +11 -0
- package/dist/data/readme_demo/function/isqrt__loop_body_7.mcfunction +8 -0
- package/dist/data/readme_demo/function/isqrt__loop_exit_11.mcfunction +2 -0
- package/dist/data/readme_demo/function/isqrt__loop_exit_14.mcfunction +1 -0
- package/dist/data/readme_demo/function/isqrt__loop_exit_8.mcfunction +9 -0
- package/dist/data/readme_demo/function/isqrt__loop_header_12.mcfunction +4 -0
- package/dist/data/readme_demo/function/isqrt__loop_header_6.mcfunction +4 -0
- package/dist/data/readme_demo/function/isqrt__loop_header_9.mcfunction +3 -0
- package/dist/data/readme_demo/function/isqrt__merge_1.mcfunction +4 -0
- package/dist/data/readme_demo/function/isqrt__merge_16.mcfunction +5 -0
- package/dist/data/readme_demo/function/isqrt__merge_4.mcfunction +3 -0
- package/dist/data/readme_demo/function/isqrt__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/isqrt__then_15.mcfunction +1 -0
- package/dist/data/readme_demo/function/isqrt__then_3.mcfunction +2 -0
- package/dist/data/readme_demo/function/lcm.mcfunction +11 -0
- package/dist/data/readme_demo/function/lcm__merge_1.mcfunction +5 -0
- package/dist/data/readme_demo/function/lcm__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/lerp.mcfunction +13 -0
- package/dist/data/readme_demo/function/ln.mcfunction +9 -0
- package/dist/data/readme_demo/function/ln__loop_body_1.mcfunction +8 -0
- package/dist/data/readme_demo/function/ln__loop_body_4.mcfunction +8 -0
- package/dist/data/readme_demo/function/ln__loop_exit_2.mcfunction +1 -0
- package/dist/data/readme_demo/function/ln__loop_exit_5.mcfunction +37 -0
- package/dist/data/readme_demo/function/ln__loop_header_0.mcfunction +3 -0
- package/dist/data/readme_demo/function/ln__loop_header_3.mcfunction +6 -0
- package/dist/data/readme_demo/function/load.mcfunction +1 -0
- package/dist/data/readme_demo/function/log10_fx.mcfunction +11 -0
- package/dist/data/readme_demo/function/log2_fx.mcfunction +11 -0
- package/dist/data/readme_demo/function/log2_int.mcfunction +5 -0
- package/dist/data/readme_demo/function/log2_int__loop_body_4.mcfunction +8 -0
- package/dist/data/readme_demo/function/log2_int__loop_exit_5.mcfunction +1 -0
- package/dist/data/readme_demo/function/log2_int__loop_header_3.mcfunction +4 -0
- package/dist/data/readme_demo/function/log2_int__merge_1.mcfunction +3 -0
- package/dist/data/readme_demo/function/log2_int__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/loga_fx.mcfunction +10 -0
- package/dist/data/readme_demo/function/loga_fx__merge_1.mcfunction +9 -0
- package/dist/data/readme_demo/function/loga_fx__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/map.mcfunction +12 -0
- package/dist/data/readme_demo/function/map__merge_1.mcfunction +11 -0
- package/dist/data/readme_demo/function/map__then_0.mcfunction +1 -0
- package/dist/data/readme_demo/function/mulfix.mcfunction +8 -0
- package/dist/data/readme_demo/function/newton_step.mcfunction +7 -0
- package/dist/data/readme_demo/function/newton_step__merge_1.mcfunction +8 -0
- package/dist/data/readme_demo/function/newton_step__then_0.mcfunction +1 -0
- package/dist/data/readme_demo/function/pow_int.mcfunction +6 -0
- package/dist/data/readme_demo/function/pow_int__loop_body_4.mcfunction +7 -0
- package/dist/data/readme_demo/function/pow_int__loop_exit_5.mcfunction +1 -0
- package/dist/data/readme_demo/function/pow_int__loop_header_3.mcfunction +4 -0
- package/dist/data/readme_demo/function/pow_int__merge_1.mcfunction +4 -0
- package/dist/data/readme_demo/function/pow_int__merge_7.mcfunction +8 -0
- package/dist/data/readme_demo/function/pow_int__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/pow_int__then_6.mcfunction +4 -0
- package/dist/data/readme_demo/function/quadratic_disc.mcfunction +12 -0
- package/dist/data/readme_demo/function/quadratic_x1.mcfunction +7 -0
- package/dist/data/readme_demo/function/quadratic_x1__merge_1.mcfunction +13 -0
- package/dist/data/readme_demo/function/quadratic_x1__merge_4.mcfunction +15 -0
- package/dist/data/readme_demo/function/quadratic_x1__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/quadratic_x1__then_3.mcfunction +2 -0
- package/dist/data/readme_demo/function/quadratic_x2.mcfunction +7 -0
- package/dist/data/readme_demo/function/quadratic_x2__merge_1.mcfunction +13 -0
- package/dist/data/readme_demo/function/quadratic_x2__merge_4.mcfunction +15 -0
- package/dist/data/readme_demo/function/quadratic_x2__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/quadratic_x2__then_3.mcfunction +2 -0
- package/dist/data/readme_demo/function/sign.mcfunction +5 -0
- package/dist/data/readme_demo/function/sign__merge_1.mcfunction +4 -0
- package/dist/data/readme_demo/function/sign__merge_4.mcfunction +2 -0
- package/dist/data/readme_demo/function/sign__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/sign__then_3.mcfunction +2 -0
- package/dist/data/readme_demo/function/simpson_step.mcfunction +16 -0
- package/dist/data/readme_demo/function/sin_fixed.mcfunction +9 -0
- package/dist/data/readme_demo/function/sin_fixed__merge_1.mcfunction +4 -0
- package/dist/data/readme_demo/function/sin_fixed__merge_3.mcfunction +4 -0
- package/dist/data/readme_demo/function/sin_fixed__merge_6.mcfunction +4 -0
- package/dist/data/readme_demo/function/sin_fixed__merge_9.mcfunction +10 -0
- package/dist/data/readme_demo/function/sin_fixed__then_0.mcfunction +4 -0
- package/dist/data/readme_demo/function/sin_fixed__then_2.mcfunction +6 -0
- package/dist/data/readme_demo/function/sin_fixed__then_5.mcfunction +8 -0
- package/dist/data/readme_demo/function/sin_fixed__then_8.mcfunction +10 -0
- package/dist/data/readme_demo/function/smootherstep.mcfunction +10 -0
- package/dist/data/readme_demo/function/smootherstep__merge_1.mcfunction +12 -0
- package/dist/data/readme_demo/function/smootherstep__merge_4.mcfunction +4 -0
- package/dist/data/readme_demo/function/smootherstep__merge_6.mcfunction +27 -0
- package/dist/data/readme_demo/function/smootherstep__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/smootherstep__then_3.mcfunction +2 -0
- package/dist/data/readme_demo/function/smootherstep__then_5.mcfunction +2 -0
- package/dist/data/readme_demo/function/smoothstep.mcfunction +10 -0
- package/dist/data/readme_demo/function/smoothstep__merge_1.mcfunction +12 -0
- package/dist/data/readme_demo/function/smoothstep__merge_4.mcfunction +4 -0
- package/dist/data/readme_demo/function/smoothstep__merge_6.mcfunction +15 -0
- package/dist/data/readme_demo/function/smoothstep__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/smoothstep__then_3.mcfunction +2 -0
- package/dist/data/readme_demo/function/smoothstep__then_5.mcfunction +2 -0
- package/dist/data/readme_demo/function/solve2x2_x.mcfunction +17 -0
- package/dist/data/readme_demo/function/solve2x2_x__merge_1.mcfunction +12 -0
- package/dist/data/readme_demo/function/solve2x2_x__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/solve2x2_y.mcfunction +17 -0
- package/dist/data/readme_demo/function/solve2x2_y__merge_1.mcfunction +12 -0
- package/dist/data/readme_demo/function/solve2x2_y__then_0.mcfunction +2 -0
- package/dist/data/readme_demo/function/sqrt_fixed.mcfunction +8 -0
- package/dist/data/readme_demo/function/sqrt_fx.mcfunction +8 -0
- package/dist/data/readme_demo/function/start.mcfunction +2 -0
- package/dist/data/readme_demo/function/stop.mcfunction +1 -0
- package/dist/data/readme_demo/function/trapezoid_step.mcfunction +11 -0
- package/dist/data/stdextra/function/__load.mcfunction +2 -0
- package/dist/data/stdextra/function/load.mcfunction +1 -0
- package/dist/data/stdextra/function/test_bigint.mcfunction +52 -0
- package/dist/data/stdextra/function/test_bits.mcfunction +33 -0
- package/dist/data/stdextra/function/test_list_sort.mcfunction +55 -0
- package/dist/data/stdextra/function/test_random.mcfunction +17 -0
- package/dist/data/stdextra/function/test_random__merge_1.mcfunction +4 -0
- package/dist/data/stdextra/function/test_random__merge_11.mcfunction +1 -0
- package/dist/data/stdextra/function/test_random__merge_3.mcfunction +14 -0
- package/dist/data/stdextra/function/test_random__merge_5.mcfunction +8 -0
- package/dist/data/stdextra/function/test_random__merge_7.mcfunction +1 -0
- package/dist/data/stdextra/function/test_random__merge_9.mcfunction +1 -0
- package/dist/data/stdextra/function/test_random__then_0.mcfunction +4 -0
- package/dist/data/stdextra/function/test_random__then_10.mcfunction +2 -0
- package/dist/data/stdextra/function/test_random__then_2.mcfunction +2 -0
- package/dist/data/stdextra/function/test_random__then_4.mcfunction +4 -0
- package/dist/data/stdextra/function/test_random__then_6.mcfunction +2 -0
- package/dist/data/stdextra/function/test_random__then_8.mcfunction +4 -0
- package/dist/data/test/function/__dyn_idx_test_arrays_nums.mcfunction +1 -0
- package/dist/data/test/function/__dyn_idx_test_arrays_parent.mcfunction +1 -0
- package/dist/data/test/function/__dyn_idx_test_arrays_queue.mcfunction +1 -0
- package/dist/data/test/function/__dyn_idx_test_arrays_rev.mcfunction +1 -0
- package/dist/data/test/function/__dyn_idx_test_arrays_visited.mcfunction +1 -0
- package/dist/data/test/function/__dyn_wrt_test_arrays_parent.mcfunction +1 -0
- package/dist/data/test/function/__dyn_wrt_test_arrays_visited.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_1.mcfunction +2 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_1__loop_body_1.mcfunction +17 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_1__loop_body_1_continue.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_1__loop_body_1_yield.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_1__loop_header_0.mcfunction +4 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_1__loop_header_0_exit.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2.mcfunction +2 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__else_8.mcfunction +19 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__loop_body_4.mcfunction +9 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__loop_header_3.mcfunction +3 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__loop_header_3_exit.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_10.mcfunction +11 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_12.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_14.mcfunction +11 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_16.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_18.mcfunction +11 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_20.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_22.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_24.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_7.mcfunction +6 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_7_continue.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__merge_7_yield.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_11.mcfunction +15 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_13.mcfunction +13 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_15.mcfunction +15 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_17.mcfunction +13 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_19.mcfunction +15 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_21.mcfunction +13 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_23.mcfunction +15 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_6.mcfunction +2 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_2__then_9.mcfunction +13 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3.mcfunction +2 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3__else_32.mcfunction +4 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3__loop_body_28.mcfunction +6 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3__loop_header_27.mcfunction +4 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3__loop_header_27_exit.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3__merge_31.mcfunction +6 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3__merge_31_continue.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3__merge_31_yield.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_3__then_30.mcfunction +2 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_4.mcfunction +2 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_4__loop_body_34.mcfunction +16 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_4__loop_body_34_continue.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_4__loop_body_34_yield.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_4__loop_header_33.mcfunction +4 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_4__loop_header_33_exit.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_5.mcfunction +16 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_cont_5__merge_26.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_tick.mcfunction +4 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__call_1.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__call_2.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__call_3.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__call_4.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__call_5.mcfunction +1 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__check_2.mcfunction +4 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__check_3.mcfunction +4 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__check_4.mcfunction +4 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__check_5.mcfunction +4 -0
- package/dist/data/test/function/_coro_pathfind_bfs_coro_tick__done.mcfunction +1 -0
- package/dist/data/test/function/_hsl_chroma_x.mcfunction +1 -2
- package/dist/data/test/function/aabb_contains.mcfunction +1 -2
- package/dist/data/test/function/aabb_contains__merge_1.mcfunction +1 -2
- package/dist/data/test/function/aabb_contains__merge_10.mcfunction +1 -2
- package/dist/data/test/function/aabb_contains__merge_13.mcfunction +1 -2
- package/dist/data/test/function/aabb_contains__merge_4.mcfunction +1 -2
- package/dist/data/test/function/aabb_contains__merge_7.mcfunction +1 -2
- package/dist/data/test/function/acos_approx.mcfunction +7 -0
- package/dist/data/test/function/add_to_team.mcfunction +5 -0
- package/dist/data/test/function/angle_diff.mcfunction +1 -2
- package/dist/data/test/function/angle_normalize__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/angle_normalize__loop_header_3.mcfunction +1 -2
- package/dist/data/test/function/angry_at.mcfunction +1 -0
- package/dist/data/test/function/apply_damage.mcfunction +12 -0
- package/dist/data/test/function/apply_damage__else_2.mcfunction +2 -0
- package/dist/data/test/function/apply_damage__merge_1.mcfunction +1 -0
- package/dist/data/test/function/apply_damage__then_0.mcfunction +2 -0
- package/dist/data/test/function/arr_test.mcfunction +4 -0
- package/dist/data/test/function/asin_approx.mcfunction +5 -0
- package/dist/data/test/function/asin_approx__merge_1.mcfunction +3 -0
- package/dist/data/test/function/asin_approx__merge_10.mcfunction +5 -0
- package/dist/data/test/function/asin_approx__merge_4.mcfunction +12 -0
- package/dist/data/test/function/asin_approx__merge_7.mcfunction +14 -0
- package/dist/data/test/function/asin_approx__then_0.mcfunction +2 -0
- package/dist/data/test/function/asin_approx__then_3.mcfunction +2 -0
- package/dist/data/test/function/asin_approx__then_6.mcfunction +2 -0
- package/dist/data/test/function/asin_approx__then_9.mcfunction +2 -0
- package/dist/data/test/function/barrier_wall.mcfunction +1 -0
- package/dist/data/test/function/bernoulli.mcfunction +1 -2
- package/dist/data/test/function/bernoulli__merge_1.mcfunction +1 -2
- package/dist/data/test/function/bigint_chunk.mcfunction +2 -0
- package/dist/data/test/function/bigint_div_small.mcfunction +6 -0
- package/dist/data/test/function/bigint_div_small__loop_body_1.mcfunction +12 -0
- package/dist/data/test/function/bigint_div_small__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/bigint_div_small__loop_header_0.mcfunction +3 -0
- package/dist/data/test/function/bigint_mod_small.mcfunction +6 -0
- package/dist/data/test/function/bigint_mod_small__loop_body_1.mcfunction +12 -0
- package/dist/data/test/function/bigint_mod_small__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/bigint_mod_small__loop_header_0.mcfunction +3 -0
- package/dist/data/test/function/bit_and__loop_body_1.mcfunction +1 -2
- package/dist/data/test/function/bit_and__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/bit_and__then_3.mcfunction +1 -2
- package/dist/data/test/function/bit_clear__loop_exit_2.mcfunction +1 -2
- package/dist/data/test/function/bit_clear__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/bit_get__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/bit_not__loop_body_1.mcfunction +1 -2
- package/dist/data/test/function/bit_not__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/bit_or__loop_body_1.mcfunction +1 -2
- package/dist/data/test/function/bit_or__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/bit_or__merge_4.mcfunction +1 -2
- package/dist/data/test/function/bit_or__then_5.mcfunction +1 -2
- package/dist/data/test/function/bit_set__loop_exit_2.mcfunction +1 -2
- package/dist/data/test/function/bit_set__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/bit_shl__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/bit_shr__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/bit_toggle__loop_exit_2.mcfunction +1 -2
- package/dist/data/test/function/bit_toggle__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/bit_xor__loop_body_1.mcfunction +1 -2
- package/dist/data/test/function/bit_xor__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/buff_all.mcfunction +22 -0
- package/dist/data/test/function/cbrt_newton.mcfunction +5 -0
- package/dist/data/test/function/cbrt_newton__else_7.mcfunction +2 -0
- package/dist/data/test/function/cbrt_newton__merge_1.mcfunction +11 -0
- package/dist/data/test/function/cbrt_newton__merge_4.mcfunction +1 -0
- package/dist/data/test/function/cbrt_newton__merge_6.mcfunction +1 -0
- package/dist/data/test/function/cbrt_newton__then_0.mcfunction +2 -0
- package/dist/data/test/function/cbrt_newton__then_3.mcfunction +17 -0
- package/dist/data/test/function/cbrt_newton__then_5.mcfunction +11 -0
- package/dist/data/test/function/check_holding_item.mcfunction +1 -0
- package/dist/data/test/function/check_look_down.mcfunction +1 -0
- package/dist/data/test/function/check_look_down__foreach_t0.mcfunction +2 -0
- package/dist/data/test/function/check_look_straight.mcfunction +1 -0
- package/dist/data/test/function/check_look_straight__foreach_t0.mcfunction +2 -0
- package/dist/data/test/function/check_look_up.mcfunction +1 -0
- package/dist/data/test/function/check_look_up__foreach_t0.mcfunction +2 -0
- package/dist/data/test/function/cleanup_teams.mcfunction +8 -0
- package/dist/data/test/function/clear_area.mcfunction +1 -0
- package/dist/data/test/function/clear_effect.mcfunction +1 -0
- package/dist/data/test/function/clear_effects.mcfunction +1 -0
- package/dist/data/test/function/clear_inventory.mcfunction +1 -0
- package/dist/data/test/function/cooldown_ready.mcfunction +7 -0
- package/dist/data/test/function/cooldown_ready__merge_1.mcfunction +4 -0
- package/dist/data/test/function/cooldown_ready__merge_4.mcfunction +2 -0
- package/dist/data/test/function/cooldown_ready__then_0.mcfunction +2 -0
- package/dist/data/test/function/cooldown_ready__then_3.mcfunction +2 -0
- package/dist/data/test/function/cooldown_start.mcfunction +3 -0
- package/dist/data/test/function/cooldown_tick.mcfunction +7 -0
- package/dist/data/test/function/cooldown_tick__else_5.mcfunction +2 -0
- package/dist/data/test/function/cooldown_tick__merge_1.mcfunction +4 -0
- package/dist/data/test/function/cooldown_tick__merge_4.mcfunction +1 -0
- package/dist/data/test/function/cooldown_tick__merge_7.mcfunction +1 -0
- package/dist/data/test/function/cooldown_tick__then_0.mcfunction +1 -0
- package/dist/data/test/function/cooldown_tick__then_3.mcfunction +7 -0
- package/dist/data/test/function/cooldown_tick__then_6.mcfunction +2 -0
- package/dist/data/test/function/cos_hp.mcfunction +4 -2
- package/dist/data/test/function/create_blue_team.mcfunction +10 -0
- package/dist/data/test/function/create_green_team.mcfunction +10 -0
- package/dist/data/test/function/create_health_bar.mcfunction +24 -0
- package/dist/data/test/function/create_progress_bar.mcfunction +24 -0
- package/dist/data/test/function/create_red_team.mcfunction +10 -0
- package/dist/data/test/function/create_team.mcfunction +8 -0
- package/dist/data/test/function/create_timer_bar.mcfunction +30 -0
- package/dist/data/test/function/create_yellow_team.mcfunction +10 -0
- package/dist/data/test/function/cubic_disc_fx.mcfunction +26 -0
- package/dist/data/test/function/cubic_newton.mcfunction +8 -0
- package/dist/data/test/function/cubic_newton__loop_body_1.mcfunction +55 -0
- package/dist/data/test/function/cubic_newton__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/cubic_newton__loop_header_0.mcfunction +4 -0
- package/dist/data/test/function/cubic_newton__merge_10.mcfunction +1 -0
- package/dist/data/test/function/cubic_newton__merge_4.mcfunction +4 -0
- package/dist/data/test/function/cubic_newton__merge_6.mcfunction +4 -0
- package/dist/data/test/function/cubic_newton__merge_8.mcfunction +4 -0
- package/dist/data/test/function/cubic_newton__then_3.mcfunction +2 -0
- package/dist/data/test/function/cubic_newton__then_5.mcfunction +13 -0
- package/dist/data/test/function/cubic_newton__then_7.mcfunction +4 -0
- package/dist/data/test/function/cubic_newton__then_9.mcfunction +2 -0
- package/dist/data/test/function/curve_length_2d.mcfunction +6 -0
- package/dist/data/test/function/curve_length_2d__loop_body_1.mcfunction +32 -0
- package/dist/data/test/function/curve_length_2d__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/curve_length_2d__loop_header_0.mcfunction +5 -0
- package/dist/data/test/function/cylinder_contains.mcfunction +1 -2
- package/dist/data/test/function/damage.mcfunction +9 -0
- package/dist/data/test/function/damage__else_2.mcfunction +2 -0
- package/dist/data/test/function/damage__merge_1.mcfunction +1 -0
- package/dist/data/test/function/damage__then_0.mcfunction +2 -0
- package/dist/data/test/function/deriv_central.mcfunction +7 -0
- package/dist/data/test/function/deriv_central__merge_1.mcfunction +10 -0
- package/dist/data/test/function/deriv_central__then_0.mcfunction +2 -0
- package/dist/data/test/function/deriv_forward.mcfunction +7 -0
- package/dist/data/test/function/deriv_forward__merge_1.mcfunction +8 -0
- package/dist/data/test/function/deriv_forward__then_0.mcfunction +2 -0
- package/dist/data/test/function/disable_fire_spread.mcfunction +1 -0
- package/dist/data/test/function/disable_keep_inventory.mcfunction +1 -0
- package/dist/data/test/function/disable_mob_griefing.mcfunction +1 -0
- package/dist/data/test/function/div3_hp.mcfunction +23 -0
- package/dist/data/test/function/div_hp.mcfunction +13 -0
- package/dist/data/test/function/draw_circle.mcfunction +8 -0
- package/dist/data/test/function/draw_circle__loop_body_1.mcfunction +34 -0
- package/dist/data/test/function/draw_circle__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/draw_circle__loop_header_0.mcfunction +3 -0
- package/dist/data/test/function/draw_helix.mcfunction +10 -0
- package/dist/data/test/function/draw_helix__loop_body_1.mcfunction +42 -0
- package/dist/data/test/function/draw_helix__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/draw_helix__loop_header_0.mcfunction +3 -0
- package/dist/data/test/function/draw_line_2d.mcfunction +9 -0
- package/dist/data/test/function/draw_line_2d__loop_body_1.mcfunction +34 -0
- package/dist/data/test/function/draw_line_2d__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/draw_line_2d__loop_header_0.mcfunction +3 -0
- package/dist/data/test/function/ease_in_expo.mcfunction +1 -2
- package/dist/data/test/function/ease_in_out_back.mcfunction +1 -2
- package/dist/data/test/function/ease_in_out_bounce.mcfunction +1 -2
- package/dist/data/test/function/ease_in_out_cubic.mcfunction +1 -2
- package/dist/data/test/function/ease_in_out_quad.mcfunction +1 -2
- package/dist/data/test/function/ease_in_out_sine.mcfunction +1 -2
- package/dist/data/test/function/ease_out_bounce.mcfunction +1 -2
- package/dist/data/test/function/ease_out_bounce__merge_1.mcfunction +1 -2
- package/dist/data/test/function/ease_out_bounce__merge_4.mcfunction +1 -2
- package/dist/data/test/function/ease_out_expo.mcfunction +1 -2
- package/dist/data/test/function/enable_keep_inventory.mcfunction +1 -0
- package/dist/data/test/function/end_sparkles_at.mcfunction +1 -0
- package/dist/data/test/function/enemy_health.mcfunction +2 -0
- package/dist/data/test/function/example_right_click.mcfunction +1 -0
- package/dist/data/test/function/example_right_click__foreach_t0.mcfunction +5 -0
- package/dist/data/test/function/example_right_click__foreach_t0__merge_1.mcfunction +1 -0
- package/dist/data/test/function/example_right_click__foreach_t0__then_0.mcfunction +3 -0
- package/dist/data/test/function/exp_dist_approx.mcfunction +1 -2
- package/dist/data/test/function/exp_dist_approx__merge_1.mcfunction +1 -2
- package/dist/data/test/function/exp_dist_approx__merge_3.mcfunction +1 -2
- package/dist/data/test/function/explosion_effect.mcfunction +1 -0
- package/dist/data/test/function/fbm_1d__loop_exit_2.mcfunction +1 -2
- package/dist/data/test/function/fbm_1d__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/fbm_2d__loop_exit_2.mcfunction +1 -2
- package/dist/data/test/function/fbm_2d__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/flames.mcfunction +1 -0
- package/dist/data/test/function/gather_all.mcfunction +8 -0
- package/dist/data/test/function/give_kit_archer.mcfunction +6 -0
- package/dist/data/test/function/give_kit_mage.mcfunction +5 -0
- package/dist/data/test/function/give_kit_warrior.mcfunction +6 -0
- package/dist/data/test/function/glass_box.mcfunction +2 -0
- package/dist/data/test/function/glow.mcfunction +1 -0
- package/dist/data/test/function/goto_arena.mcfunction +7 -0
- package/dist/data/test/function/goto_lobby.mcfunction +7 -0
- package/dist/data/test/function/happy_at.mcfunction +1 -0
- package/dist/data/test/function/hash_1d_pos.mcfunction +1 -2
- package/dist/data/test/function/hash_2d_pos.mcfunction +1 -2
- package/dist/data/test/function/heal.mcfunction +5 -0
- package/dist/data/test/function/heap_new.mcfunction +7 -0
- package/dist/data/test/function/heap_new__loop_body_1.mcfunction +7 -0
- package/dist/data/test/function/heap_new__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/heap_new__loop_header_0.mcfunction +4 -0
- package/dist/data/test/function/heap_peek.mcfunction +2 -0
- package/dist/data/test/function/heap_pop.mcfunction +4 -0
- package/dist/data/test/function/heap_pop__else_13.mcfunction +2 -0
- package/dist/data/test/function/heap_pop__loop_body_1.mcfunction +14 -0
- package/dist/data/test/function/heap_pop__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/heap_pop__loop_header_0.mcfunction +4 -0
- package/dist/data/test/function/heap_pop__merge_10.mcfunction +1 -0
- package/dist/data/test/function/heap_pop__merge_12.mcfunction +1 -0
- package/dist/data/test/function/heap_pop__merge_4.mcfunction +3 -0
- package/dist/data/test/function/heap_pop__merge_6.mcfunction +1 -0
- package/dist/data/test/function/heap_pop__merge_8.mcfunction +3 -0
- package/dist/data/test/function/heap_pop__then_11.mcfunction +2 -0
- package/dist/data/test/function/heap_pop__then_3.mcfunction +3 -0
- package/dist/data/test/function/heap_pop__then_5.mcfunction +2 -0
- package/dist/data/test/function/heap_pop__then_7.mcfunction +3 -0
- package/dist/data/test/function/heap_pop__then_9.mcfunction +2 -0
- package/dist/data/test/function/heap_push.mcfunction +6 -0
- package/dist/data/test/function/heap_push__else_5.mcfunction +2 -0
- package/dist/data/test/function/heap_push__else_8.mcfunction +2 -0
- package/dist/data/test/function/heap_push__loop_body_1.mcfunction +4 -0
- package/dist/data/test/function/heap_push__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/heap_push__loop_header_0.mcfunction +4 -0
- package/dist/data/test/function/heap_push__merge_4.mcfunction +1 -0
- package/dist/data/test/function/heap_push__merge_7.mcfunction +1 -0
- package/dist/data/test/function/heap_push__then_3.mcfunction +7 -0
- package/dist/data/test/function/heap_push__then_6.mcfunction +2 -0
- package/dist/data/test/function/heap_size.mcfunction +2 -0
- package/dist/data/test/function/hearts_at.mcfunction +1 -0
- package/dist/data/test/function/hide_bar.mcfunction +4 -0
- package/dist/data/test/function/hsl_to_b.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_b__merge_1.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_b__merge_12.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_b__merge_3.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_b__merge_6.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_b__merge_9.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_g.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_g__merge_1.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_g__merge_12.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_g__merge_3.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_g__merge_6.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_g__merge_9.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_r.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_r__merge_1.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_r__merge_12.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_r__merge_3.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_r__merge_6.mcfunction +1 -2
- package/dist/data/test/function/hsl_to_r__merge_9.mcfunction +1 -2
- package/dist/data/test/function/init_div.mcfunction +1 -0
- package/dist/data/test/function/insertion_sort.mcfunction +4 -0
- package/dist/data/test/function/insertion_sort__else_11.mcfunction +2 -0
- package/dist/data/test/function/insertion_sort__else_8.mcfunction +2 -0
- package/dist/data/test/function/insertion_sort__loop_body_1.mcfunction +6 -0
- package/dist/data/test/function/insertion_sort__loop_body_4.mcfunction +4 -0
- package/dist/data/test/function/insertion_sort__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/insertion_sort__loop_exit_5.mcfunction +4 -0
- package/dist/data/test/function/insertion_sort__loop_header_0.mcfunction +3 -0
- package/dist/data/test/function/insertion_sort__loop_header_3.mcfunction +4 -0
- package/dist/data/test/function/insertion_sort__merge_10.mcfunction +1 -0
- package/dist/data/test/function/insertion_sort__merge_7.mcfunction +1 -0
- package/dist/data/test/function/insertion_sort__then_6.mcfunction +3 -0
- package/dist/data/test/function/insertion_sort__then_9.mcfunction +4 -0
- package/dist/data/test/function/insertion_sort_desc.mcfunction +4 -0
- package/dist/data/test/function/insertion_sort_desc__else_11.mcfunction +2 -0
- package/dist/data/test/function/insertion_sort_desc__else_8.mcfunction +2 -0
- package/dist/data/test/function/insertion_sort_desc__loop_body_1.mcfunction +6 -0
- package/dist/data/test/function/insertion_sort_desc__loop_body_4.mcfunction +4 -0
- package/dist/data/test/function/insertion_sort_desc__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/insertion_sort_desc__loop_exit_5.mcfunction +4 -0
- package/dist/data/test/function/insertion_sort_desc__loop_header_0.mcfunction +3 -0
- package/dist/data/test/function/insertion_sort_desc__loop_header_3.mcfunction +4 -0
- package/dist/data/test/function/insertion_sort_desc__merge_10.mcfunction +1 -0
- package/dist/data/test/function/insertion_sort_desc__merge_7.mcfunction +1 -0
- package/dist/data/test/function/insertion_sort_desc__then_6.mcfunction +3 -0
- package/dist/data/test/function/insertion_sort_desc__then_9.mcfunction +4 -0
- package/dist/data/test/function/integrate_simpson.mcfunction +7 -0
- package/dist/data/test/function/integrate_simpson__loop_body_6.mcfunction +7 -0
- package/dist/data/test/function/integrate_simpson__loop_exit_7.mcfunction +6 -0
- package/dist/data/test/function/integrate_simpson__loop_header_5.mcfunction +5 -0
- package/dist/data/test/function/integrate_simpson__merge_1.mcfunction +8 -0
- package/dist/data/test/function/integrate_simpson__merge_11.mcfunction +4 -0
- package/dist/data/test/function/integrate_simpson__merge_4.mcfunction +5 -0
- package/dist/data/test/function/integrate_simpson__merge_9.mcfunction +7 -0
- package/dist/data/test/function/integrate_simpson__then_0.mcfunction +6 -0
- package/dist/data/test/function/integrate_simpson__then_10.mcfunction +6 -0
- package/dist/data/test/function/integrate_simpson__then_3.mcfunction +4 -0
- package/dist/data/test/function/integrate_simpson__then_8.mcfunction +6 -0
- package/dist/data/test/function/integrate_trapezoid.mcfunction +7 -0
- package/dist/data/test/function/integrate_trapezoid__loop_body_4.mcfunction +7 -0
- package/dist/data/test/function/integrate_trapezoid__loop_exit_5.mcfunction +6 -0
- package/dist/data/test/function/integrate_trapezoid__loop_header_3.mcfunction +5 -0
- package/dist/data/test/function/integrate_trapezoid__merge_1.mcfunction +11 -0
- package/dist/data/test/function/integrate_trapezoid__then_0.mcfunction +2 -0
- package/dist/data/test/function/interactions_init.mcfunction +9 -0
- package/dist/data/test/function/invisible.mcfunction +1 -0
- package/dist/data/test/function/is_op.mcfunction +2 -0
- package/dist/data/test/function/is_op__exec_t1.mcfunction +1 -0
- package/dist/data/test/function/is_sneaking.mcfunction +5 -0
- package/dist/data/test/function/is_sneaking__merge_1.mcfunction +2 -0
- package/dist/data/test/function/is_sneaking__then_0.mcfunction +2 -0
- package/dist/data/test/function/jump.mcfunction +1 -0
- package/dist/data/test/function/launch_up.mcfunction +6 -0
- package/dist/data/test/function/list_max3.mcfunction +1 -2
- package/dist/data/test/function/list_max3__merge_1.mcfunction +1 -2
- package/dist/data/test/function/list_max5.mcfunction +1 -2
- package/dist/data/test/function/list_max5__merge_1.mcfunction +1 -2
- package/dist/data/test/function/list_max5__merge_3.mcfunction +1 -2
- package/dist/data/test/function/list_max5__merge_5.mcfunction +1 -2
- package/dist/data/test/function/list_min3.mcfunction +1 -2
- package/dist/data/test/function/list_min3__merge_1.mcfunction +1 -2
- package/dist/data/test/function/list_min5.mcfunction +1 -2
- package/dist/data/test/function/list_min5__merge_1.mcfunction +1 -2
- package/dist/data/test/function/list_min5__merge_3.mcfunction +1 -2
- package/dist/data/test/function/list_min5__merge_5.mcfunction +1 -2
- package/dist/data/test/function/list_sort_asc__loop_body_4.mcfunction +1 -2
- package/dist/data/test/function/list_sort_asc__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/list_sort_asc__loop_header_3.mcfunction +1 -2
- package/dist/data/test/function/list_sort_desc__loop_body_4.mcfunction +1 -2
- package/dist/data/test/function/list_sort_desc__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/list_sort_desc__loop_header_3.mcfunction +1 -2
- package/dist/data/test/function/max_heap_pop.mcfunction +4 -0
- package/dist/data/test/function/max_heap_pop__else_13.mcfunction +2 -0
- package/dist/data/test/function/max_heap_pop__loop_body_1.mcfunction +14 -0
- package/dist/data/test/function/max_heap_pop__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/max_heap_pop__loop_header_0.mcfunction +4 -0
- package/dist/data/test/function/max_heap_pop__merge_10.mcfunction +1 -0
- package/dist/data/test/function/max_heap_pop__merge_12.mcfunction +1 -0
- package/dist/data/test/function/max_heap_pop__merge_4.mcfunction +3 -0
- package/dist/data/test/function/max_heap_pop__merge_6.mcfunction +1 -0
- package/dist/data/test/function/max_heap_pop__merge_8.mcfunction +3 -0
- package/dist/data/test/function/max_heap_pop__then_11.mcfunction +2 -0
- package/dist/data/test/function/max_heap_pop__then_3.mcfunction +3 -0
- package/dist/data/test/function/max_heap_pop__then_5.mcfunction +2 -0
- package/dist/data/test/function/max_heap_pop__then_7.mcfunction +3 -0
- package/dist/data/test/function/max_heap_pop__then_9.mcfunction +2 -0
- package/dist/data/test/function/max_heap_push.mcfunction +6 -0
- package/dist/data/test/function/max_heap_push__else_5.mcfunction +2 -0
- package/dist/data/test/function/max_heap_push__else_8.mcfunction +2 -0
- package/dist/data/test/function/max_heap_push__loop_body_1.mcfunction +4 -0
- package/dist/data/test/function/max_heap_push__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/max_heap_push__loop_header_0.mcfunction +4 -0
- package/dist/data/test/function/max_heap_push__merge_4.mcfunction +1 -0
- package/dist/data/test/function/max_heap_push__merge_7.mcfunction +1 -0
- package/dist/data/test/function/max_heap_push__then_3.mcfunction +7 -0
- package/dist/data/test/function/max_heap_push__then_6.mcfunction +2 -0
- package/dist/data/test/function/newton_step.mcfunction +7 -0
- package/dist/data/test/function/newton_step__merge_1.mcfunction +8 -0
- package/dist/data/test/function/newton_step__then_0.mcfunction +1 -0
- package/dist/data/test/function/night_vision.mcfunction +1 -0
- package/dist/data/test/function/norm3_hp.mcfunction +43 -0
- package/dist/data/test/function/normal_approx12.mcfunction +1 -2
- package/dist/data/test/function/normal_approx12__merge_1.mcfunction +1 -2
- package/dist/data/test/function/normal_approx12__merge_11.mcfunction +1 -2
- package/dist/data/test/function/normal_approx12__merge_13.mcfunction +1 -2
- package/dist/data/test/function/normal_approx12__merge_15.mcfunction +1 -2
- package/dist/data/test/function/normal_approx12__merge_17.mcfunction +1 -2
- package/dist/data/test/function/normal_approx12__merge_19.mcfunction +1 -2
- package/dist/data/test/function/normal_approx12__merge_21.mcfunction +1 -2
- package/dist/data/test/function/normal_approx12__merge_3.mcfunction +1 -2
- package/dist/data/test/function/normal_approx12__merge_5.mcfunction +1 -2
- package/dist/data/test/function/normal_approx12__merge_7.mcfunction +1 -2
- package/dist/data/test/function/normal_approx12__merge_9.mcfunction +1 -2
- package/dist/data/test/function/on_double_sneak.mcfunction +1 -0
- package/dist/data/test/function/on_double_sneak__foreach_t0.mcfunction +9 -0
- package/dist/data/test/function/on_double_sneak__foreach_t0__merge_1.mcfunction +1 -0
- package/dist/data/test/function/on_double_sneak__foreach_t0__merge_3.mcfunction +2 -0
- package/dist/data/test/function/on_double_sneak__foreach_t0__then_0.mcfunction +6 -0
- package/dist/data/test/function/on_double_sneak__foreach_t0__then_2.mcfunction +2 -0
- package/dist/data/test/function/on_right_click.mcfunction +1 -0
- package/dist/data/test/function/on_right_click__foreach_t1.mcfunction +5 -0
- package/dist/data/test/function/on_right_click__foreach_t1__merge_1.mcfunction +1 -0
- package/dist/data/test/function/on_right_click__foreach_t1__then_0.mcfunction +3 -0
- package/dist/data/test/function/on_sneak_click.mcfunction +1 -0
- package/dist/data/test/function/on_sneak_click__foreach_t0.mcfunction +7 -0
- package/dist/data/test/function/on_sneak_click__foreach_t0__else_4.mcfunction +3 -0
- package/dist/data/test/function/on_sneak_click__foreach_t0__merge_1.mcfunction +1 -0
- package/dist/data/test/function/on_sneak_click__foreach_t0__merge_3.mcfunction +1 -0
- package/dist/data/test/function/on_sneak_click__foreach_t0__then_0.mcfunction +4 -0
- package/dist/data/test/function/on_sneak_click__foreach_t0__then_2.mcfunction +3 -0
- package/dist/data/test/function/on_sneak_start.mcfunction +1 -0
- package/dist/data/test/function/on_sneak_start__foreach_t0.mcfunction +5 -0
- package/dist/data/test/function/on_sneak_start__foreach_t0__else_2.mcfunction +2 -0
- package/dist/data/test/function/on_sneak_start__foreach_t0__merge_1.mcfunction +1 -0
- package/dist/data/test/function/on_sneak_start__foreach_t0__then_0.mcfunction +2 -0
- package/dist/data/test/function/particle_at_fx.mcfunction +1 -0
- package/dist/data/test/function/particle_dot.mcfunction +1 -0
- package/dist/data/test/function/pathfind_bfs.mcfunction +11 -0
- package/dist/data/test/function/pathfind_bfs__else_33.mcfunction +4 -0
- package/dist/data/test/function/pathfind_bfs__else_8.mcfunction +19 -0
- package/dist/data/test/function/pathfind_bfs__loop_body_1.mcfunction +10 -0
- package/dist/data/test/function/pathfind_bfs__loop_body_29.mcfunction +6 -0
- package/dist/data/test/function/pathfind_bfs__loop_body_35.mcfunction +9 -0
- package/dist/data/test/function/pathfind_bfs__loop_body_4.mcfunction +9 -0
- package/dist/data/test/function/pathfind_bfs__loop_exit_2.mcfunction +24 -0
- package/dist/data/test/function/pathfind_bfs__loop_exit_30.mcfunction +6 -0
- package/dist/data/test/function/pathfind_bfs__loop_exit_36.mcfunction +1 -0
- package/dist/data/test/function/pathfind_bfs__loop_exit_5.mcfunction +6 -0
- package/dist/data/test/function/pathfind_bfs__loop_header_0.mcfunction +4 -0
- package/dist/data/test/function/pathfind_bfs__loop_header_28.mcfunction +4 -0
- package/dist/data/test/function/pathfind_bfs__loop_header_3.mcfunction +3 -0
- package/dist/data/test/function/pathfind_bfs__loop_header_34.mcfunction +4 -0
- package/dist/data/test/function/pathfind_bfs__merge_10.mcfunction +11 -0
- package/dist/data/test/function/pathfind_bfs__merge_12.mcfunction +1 -0
- package/dist/data/test/function/pathfind_bfs__merge_14.mcfunction +11 -0
- package/dist/data/test/function/pathfind_bfs__merge_16.mcfunction +1 -0
- package/dist/data/test/function/pathfind_bfs__merge_18.mcfunction +11 -0
- package/dist/data/test/function/pathfind_bfs__merge_20.mcfunction +1 -0
- package/dist/data/test/function/pathfind_bfs__merge_22.mcfunction +1 -0
- package/dist/data/test/function/pathfind_bfs__merge_24.mcfunction +1 -0
- package/dist/data/test/function/pathfind_bfs__merge_26.mcfunction +5 -0
- package/dist/data/test/function/pathfind_bfs__merge_32.mcfunction +1 -0
- package/dist/data/test/function/pathfind_bfs__merge_7.mcfunction +1 -0
- package/dist/data/test/function/pathfind_bfs__then_11.mcfunction +15 -0
- package/dist/data/test/function/pathfind_bfs__then_13.mcfunction +13 -0
- package/dist/data/test/function/pathfind_bfs__then_15.mcfunction +15 -0
- package/dist/data/test/function/pathfind_bfs__then_17.mcfunction +13 -0
- package/dist/data/test/function/pathfind_bfs__then_19.mcfunction +15 -0
- package/dist/data/test/function/pathfind_bfs__then_21.mcfunction +13 -0
- package/dist/data/test/function/pathfind_bfs__then_23.mcfunction +15 -0
- package/dist/data/test/function/pathfind_bfs__then_25.mcfunction +1 -0
- package/dist/data/test/function/pathfind_bfs__then_31.mcfunction +2 -0
- package/dist/data/test/function/pathfind_bfs__then_6.mcfunction +3 -0
- package/dist/data/test/function/pathfind_bfs__then_9.mcfunction +13 -0
- package/dist/data/test/function/pathfind_bfs_coro.mcfunction +1 -0
- package/dist/data/test/function/pcg_output.mcfunction +1 -2
- package/dist/data/test/function/pf_heuristic.mcfunction +14 -0
- package/dist/data/test/function/pf_heuristic__merge_1.mcfunction +4 -0
- package/dist/data/test/function/pf_heuristic__merge_3.mcfunction +6 -0
- package/dist/data/test/function/pf_heuristic__then_0.mcfunction +4 -0
- package/dist/data/test/function/pf_heuristic__then_2.mcfunction +4 -0
- package/dist/data/test/function/pf_is_blocked.mcfunction +7 -0
- package/dist/data/test/function/pf_is_blocked__merge_1.mcfunction +4 -0
- package/dist/data/test/function/pf_is_blocked__merge_10.mcfunction +4 -0
- package/dist/data/test/function/pf_is_blocked__merge_4.mcfunction +4 -0
- package/dist/data/test/function/pf_is_blocked__merge_7.mcfunction +4 -0
- package/dist/data/test/function/pf_is_blocked__then_0.mcfunction +2 -0
- package/dist/data/test/function/pf_is_blocked__then_3.mcfunction +2 -0
- package/dist/data/test/function/pf_is_blocked__then_6.mcfunction +2 -0
- package/dist/data/test/function/pf_is_blocked__then_9.mcfunction +2 -0
- package/dist/data/test/function/pf_new_map.mcfunction +4 -0
- package/dist/data/test/function/pf_new_map__loop_body_1.mcfunction +7 -0
- package/dist/data/test/function/pf_new_map__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/pf_new_map__loop_header_0.mcfunction +4 -0
- package/dist/data/test/function/pf_noop.mcfunction +1 -0
- package/dist/data/test/function/pf_pack.mcfunction +8 -0
- package/dist/data/test/function/pf_set_blocked.mcfunction +5 -0
- package/dist/data/test/function/pf_set_open.mcfunction +5 -0
- package/dist/data/test/function/pf_unpack_x.mcfunction +5 -0
- package/dist/data/test/function/pf_unpack_z.mcfunction +5 -0
- package/dist/data/test/function/popcount__loop_body_1.mcfunction +1 -2
- package/dist/data/test/function/popcount__loop_header_0.mcfunction +1 -2
- package/dist/data/test/function/portal_effect.mcfunction +1 -0
- package/dist/data/test/function/random_bool.mcfunction +1 -2
- package/dist/data/test/function/random_range.mcfunction +1 -2
- package/dist/data/test/function/regen.mcfunction +1 -0
- package/dist/data/test/function/remove_bar.mcfunction +3 -0
- package/dist/data/test/function/remove_from_teams.mcfunction +3 -0
- package/dist/data/test/function/remove_item.mcfunction +1 -0
- package/dist/data/test/function/resistance.mcfunction +1 -0
- package/dist/data/test/function/rgb_to_h.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_h__merge_1.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_h__merge_12.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_h__merge_3.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_h__merge_5.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_h__merge_7.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_h__merge_9.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_h__then_11.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_l.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_l__merge_1.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_l__merge_3.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_l__merge_5.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_s.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_s__merge_1.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_s__merge_3.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_s__merge_5.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_s__merge_7.mcfunction +1 -2
- package/dist/data/test/function/rgb_to_s__merge_9.mcfunction +1 -2
- package/dist/data/test/function/riemann_left.mcfunction +6 -0
- package/dist/data/test/function/riemann_left__loop_body_1.mcfunction +7 -0
- package/dist/data/test/function/riemann_left__loop_exit_2.mcfunction +6 -0
- package/dist/data/test/function/riemann_left__loop_header_0.mcfunction +5 -0
- package/dist/data/test/function/riemann_mid.mcfunction +6 -0
- package/dist/data/test/function/riemann_mid__loop_body_1.mcfunction +7 -0
- package/dist/data/test/function/riemann_mid__loop_exit_2.mcfunction +6 -0
- package/dist/data/test/function/riemann_mid__loop_header_0.mcfunction +3 -0
- package/dist/data/test/function/riemann_right.mcfunction +6 -0
- package/dist/data/test/function/riemann_right__loop_body_1.mcfunction +7 -0
- package/dist/data/test/function/riemann_right__loop_exit_2.mcfunction +6 -0
- package/dist/data/test/function/riemann_right__loop_header_0.mcfunction +3 -0
- package/dist/data/test/function/running_m2.mcfunction +16 -0
- package/dist/data/test/function/running_mean.mcfunction +7 -0
- package/dist/data/test/function/running_mean__merge_1.mcfunction +13 -0
- package/dist/data/test/function/running_mean__then_0.mcfunction +1 -0
- package/dist/data/test/function/second_deriv.mcfunction +8 -0
- package/dist/data/test/function/second_deriv__merge_1.mcfunction +14 -0
- package/dist/data/test/function/second_deriv__then_0.mcfunction +2 -0
- package/dist/data/test/function/set_day.mcfunction +1 -0
- package/dist/data/test/function/set_easy.mcfunction +1 -0
- package/dist/data/test/function/set_hard.mcfunction +1 -0
- package/dist/data/test/function/set_midnight.mcfunction +1 -0
- package/dist/data/test/function/set_night.mcfunction +1 -0
- package/dist/data/test/function/set_noon.mcfunction +1 -0
- package/dist/data/test/function/set_normal.mcfunction +1 -0
- package/dist/data/test/function/set_peaceful.mcfunction +1 -0
- package/dist/data/test/function/setup_four_teams.mcfunction +4 -0
- package/dist/data/test/function/setup_two_teams.mcfunction +2 -0
- package/dist/data/test/function/show_bar.mcfunction +4 -0
- package/dist/data/test/function/simpson_step.mcfunction +16 -0
- package/dist/data/test/function/sin_hp.mcfunction +4 -2
- package/dist/data/test/function/slow_fall.mcfunction +1 -0
- package/dist/data/test/function/smoke.mcfunction +1 -0
- package/dist/data/test/function/sort2_max.mcfunction +1 -2
- package/dist/data/test/function/sort2_min.mcfunction +1 -2
- package/dist/data/test/function/sort3.mcfunction +1 -2
- package/dist/data/test/function/sort3__merge_1.mcfunction +1 -2
- package/dist/data/test/function/sort3__merge_3.mcfunction +1 -2
- package/dist/data/test/function/sort3__merge_5.mcfunction +1 -2
- package/dist/data/test/function/sort3__merge_7.mcfunction +1 -2
- package/dist/data/test/function/sort4.mcfunction +1 -2
- package/dist/data/test/function/sort4__merge_1.mcfunction +1 -2
- package/dist/data/test/function/sort4__merge_11.mcfunction +1 -2
- package/dist/data/test/function/sort4__merge_14.mcfunction +1 -2
- package/dist/data/test/function/sort4__merge_3.mcfunction +1 -2
- package/dist/data/test/function/sort4__merge_5.mcfunction +1 -2
- package/dist/data/test/function/sort4__merge_7.mcfunction +1 -2
- package/dist/data/test/function/sort4__merge_9.mcfunction +1 -2
- package/dist/data/test/function/sort5.mcfunction +1 -2
- package/dist/data/test/function/sort5__merge_1.mcfunction +1 -2
- package/dist/data/test/function/sort5__merge_11.mcfunction +1 -2
- package/dist/data/test/function/sort5__merge_13.mcfunction +1 -2
- package/dist/data/test/function/sort5__merge_15.mcfunction +1 -2
- package/dist/data/test/function/sort5__merge_17.mcfunction +1 -2
- package/dist/data/test/function/sort5__merge_19.mcfunction +1 -2
- package/dist/data/test/function/sort5__merge_22.mcfunction +1 -2
- package/dist/data/test/function/sort5__merge_25.mcfunction +1 -2
- package/dist/data/test/function/sort5__merge_3.mcfunction +1 -2
- package/dist/data/test/function/sort5__merge_5.mcfunction +1 -2
- package/dist/data/test/function/sort5__merge_7.mcfunction +1 -2
- package/dist/data/test/function/sort5__merge_9.mcfunction +1 -2
- package/dist/data/test/function/sort_merge.mcfunction +10 -0
- package/dist/data/test/function/sort_merge__else_11.mcfunction +7 -0
- package/dist/data/test/function/sort_merge__else_14.mcfunction +2 -0
- package/dist/data/test/function/sort_merge__else_5.mcfunction +3 -0
- package/dist/data/test/function/sort_merge__else_8.mcfunction +7 -0
- package/dist/data/test/function/sort_merge__loop_body_1.mcfunction +3 -0
- package/dist/data/test/function/sort_merge__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/sort_merge__loop_header_0.mcfunction +4 -0
- package/dist/data/test/function/sort_merge__merge_10.mcfunction +1 -0
- package/dist/data/test/function/sort_merge__merge_13.mcfunction +1 -0
- package/dist/data/test/function/sort_merge__merge_4.mcfunction +1 -0
- package/dist/data/test/function/sort_merge__merge_7.mcfunction +1 -0
- package/dist/data/test/function/sort_merge__then_12.mcfunction +7 -0
- package/dist/data/test/function/sort_merge__then_3.mcfunction +3 -0
- package/dist/data/test/function/sort_merge__then_6.mcfunction +3 -0
- package/dist/data/test/function/sort_merge__then_9.mcfunction +7 -0
- package/dist/data/test/function/sparkles_at.mcfunction +1 -0
- package/dist/data/test/function/speed.mcfunction +1 -0
- package/dist/data/test/function/sphere_contains.mcfunction +1 -2
- package/dist/data/test/function/spread_players.mcfunction +1 -0
- package/dist/data/test/function/sqrt_fx.mcfunction +5 -8
- package/dist/data/test/function/sqrt_hp.mcfunction +17 -0
- package/dist/data/test/function/sqrt_hp__merge_1.mcfunction +21 -0
- package/dist/data/test/function/sqrt_hp__then_0.mcfunction +2 -0
- package/dist/data/test/function/std_dev_approx.mcfunction +5 -0
- package/dist/data/test/function/std_dev_approx__merge_1.mcfunction +13 -0
- package/dist/data/test/function/std_dev_approx__then_0.mcfunction +2 -0
- package/dist/data/test/function/str_len.mcfunction +2 -0
- package/dist/data/test/function/strength.mcfunction +1 -0
- package/dist/data/test/function/t.mcfunction +3 -0
- package/dist/data/test/function/teleport_to.mcfunction +9 -0
- package/dist/data/test/function/teleport_to_entity.mcfunction +5 -0
- package/dist/data/test/function/test.mcfunction +5 -0
- package/dist/data/test/function/test__loop_body_1.mcfunction +9 -0
- package/dist/data/test/function/test__loop_exit_2.mcfunction +1 -0
- package/dist/data/test/function/test__loop_header_0.mcfunction +3 -0
- package/dist/data/test/function/tile_of.mcfunction +1 -2
- package/dist/data/test/function/timer/done.mcfunction +1 -2
- package/dist/data/test/function/timer/remaining.mcfunction +1 -2
- package/dist/data/test/function/timer/tick.mcfunction +1 -2
- package/dist/data/test/function/timer/tick__then_0.mcfunction +1 -2
- package/dist/data/test/function/totem_at.mcfunction +1 -0
- package/dist/data/test/function/trapezoid_step.mcfunction +11 -0
- package/dist/data/test/function/uniform_frac.mcfunction +1 -2
- package/dist/data/test/function/uniform_int.mcfunction +1 -2
- package/dist/data/test/function/update_bar.mcfunction +5 -0
- package/dist/data/test/function/update_bar_color.mcfunction +6 -0
- package/dist/data/test/function/update_bar_color__else_2.mcfunction +4 -0
- package/dist/data/test/function/update_bar_color__else_5.mcfunction +4 -0
- package/dist/data/test/function/update_bar_color__merge_1.mcfunction +1 -0
- package/dist/data/test/function/update_bar_color__merge_4.mcfunction +1 -0
- package/dist/data/test/function/update_bar_color__then_0.mcfunction +4 -0
- package/dist/data/test/function/update_bar_color__then_3.mcfunction +4 -0
- package/dist/data/test/function/value_noise_1d.mcfunction +1 -2
- package/dist/data/test/function/value_noise_2d.mcfunction +1 -2
- package/dist/data/test/function/value_noise_2d__merge_1.mcfunction +1 -2
- package/dist/data/test/function/variance_from_m2.mcfunction +6 -0
- package/dist/data/test/function/variance_from_m2__merge_1.mcfunction +5 -0
- package/dist/data/test/function/variance_from_m2__then_0.mcfunction +2 -0
- package/dist/data/test/function/weapon_damage.mcfunction +5 -0
- package/dist/data/test/function/weather_clear.mcfunction +1 -0
- package/dist/data/test/function/weather_rain.mcfunction +1 -0
- package/dist/data/test/function/weather_thunder.mcfunction +1 -0
- package/dist/data/test/function/weighted2.mcfunction +1 -2
- package/dist/data/test/function/weighted2__merge_1.mcfunction +1 -2
- package/dist/data/test/function/weighted3.mcfunction +1 -2
- package/dist/data/test/function/weighted3__merge_1.mcfunction +1 -2
- package/dist/data/test/function/weighted3__merge_3.mcfunction +1 -2
- package/dist/data/test_dmul/function/__double_mul_macro.mcfunction +1 -0
- package/dist/data/test_dmul/function/double_mul_fixed.mcfunction +6 -0
- package/dist/data/test_dmul/function/load.mcfunction +1 -0
- package/dist/data/test_double_fn/function/double_test.mcfunction +2 -0
- package/dist/data/test_double_fn/function/load.mcfunction +1 -0
- package/dist/data/test_double_fn2/function/double_test.mcfunction +2 -0
- package/dist/data/test_double_fn2/function/load.mcfunction +1 -0
- package/dist/data/test_double_pass/function/caller_fn.mcfunction +4 -0
- package/dist/data/test_double_pass/function/consume_double.mcfunction +2 -0
- package/dist/data/test_double_pass/function/load.mcfunction +1 -0
- package/dist/data/test_macro/function/load.mcfunction +1 -0
- package/dist/data/test_macro/function/macro_helper.mcfunction +1 -0
- package/dist/data/test_macro3/function/__dmul_macro.mcfunction +1 -0
- package/dist/data/test_macro3/function/double_mul_test.mcfunction +7 -0
- package/dist/data/test_macro3/function/load.mcfunction +1 -0
- package/dist/data/test_ret_double/function/load.mcfunction +1 -0
- package/dist/data/test_ret_double/function/make_double.mcfunction +3 -0
- package/dist/data/test_ret_double/function/use_it.mcfunction +3 -0
- package/dist/pack.mcmeta +1 -1
- package/dist/src/__tests__/array-dynamic.test.js +42 -0
- package/dist/src/__tests__/builtins.test.d.ts +1 -0
- package/dist/src/__tests__/builtins.test.js +55 -0
- package/dist/src/__tests__/compile-all.test.js +1 -0
- package/dist/src/__tests__/diagnostics.test.js +8 -11
- package/dist/src/__tests__/double.test.d.ts +7 -0
- package/dist/src/__tests__/double.test.js +464 -0
- package/dist/src/__tests__/e2e/ecs-stdlib.test.d.ts +7 -0
- package/dist/src/__tests__/e2e/ecs-stdlib.test.js +328 -0
- package/dist/src/__tests__/e2e/events-stdlib.test.d.ts +1 -0
- package/dist/src/__tests__/e2e/events-stdlib.test.js +81 -0
- package/dist/src/__tests__/e2e/fft-stdlib.test.d.ts +13 -0
- package/dist/src/__tests__/e2e/fft-stdlib.test.js +288 -0
- package/dist/src/__tests__/e2e/for-in-array.test.d.ts +4 -0
- package/dist/src/__tests__/e2e/for-in-array.test.js +59 -0
- package/dist/src/__tests__/e2e/macros.test.js +7 -7
- package/dist/src/__tests__/e2e/ode-stdlib.test.d.ts +1 -0
- package/dist/src/__tests__/e2e/ode-stdlib.test.js +91 -0
- package/dist/src/__tests__/e2e/stdlib-e2e.test.js +1616 -0
- package/dist/src/__tests__/emit/compile.test.d.ts +1 -0
- package/dist/src/__tests__/emit/compile.test.js +95 -0
- package/dist/src/__tests__/emit/index.test.d.ts +1 -0
- package/dist/src/__tests__/emit/index.test.js +180 -0
- package/dist/src/__tests__/emit/modules-extra.test.d.ts +1 -0
- package/dist/src/__tests__/emit/modules-extra.test.js +77 -0
- package/dist/src/__tests__/enum.test.js +4 -6
- package/dist/src/__tests__/fixed.test.d.ts +7 -0
- package/dist/src/__tests__/fixed.test.js +148 -0
- package/dist/src/__tests__/float-lint.test.d.ts +7 -0
- package/dist/src/__tests__/float-lint.test.js +96 -0
- package/dist/src/__tests__/float.test.d.ts +7 -0
- package/dist/src/__tests__/float.test.js +148 -0
- package/dist/src/__tests__/for-each.test.d.ts +1 -0
- package/dist/src/__tests__/for-each.test.js +125 -0
- package/dist/src/__tests__/for-range.test.d.ts +1 -0
- package/dist/src/__tests__/for-range.test.js +136 -0
- package/dist/src/__tests__/generics.test.js +4 -4
- package/dist/src/__tests__/impl.test.d.ts +1 -0
- package/dist/src/__tests__/impl.test.js +199 -0
- package/dist/src/__tests__/lsp-logic.test.d.ts +1 -0
- package/dist/src/__tests__/lsp-logic.test.js +145 -0
- package/dist/src/__tests__/match.test.d.ts +10 -0
- package/dist/src/__tests__/match.test.js +197 -0
- package/dist/src/__tests__/mc-integration/item-entity-events.test.d.ts +18 -0
- package/dist/src/__tests__/mc-integration/item-entity-events.test.js +287 -0
- package/dist/src/__tests__/mc-integration/stdlib-coverage-2.test.d.ts +13 -0
- package/dist/src/__tests__/mc-integration/stdlib-coverage-2.test.js +833 -0
- package/dist/src/__tests__/mc-integration/stdlib-coverage.test.d.ts +13 -0
- package/dist/src/__tests__/mc-integration/stdlib-coverage.test.js +707 -0
- package/dist/src/__tests__/mc-integration/syntax-coverage.test.d.ts +9 -0
- package/dist/src/__tests__/mc-integration/syntax-coverage.test.js +442 -0
- package/dist/src/__tests__/mc-integration.test.js +835 -5
- package/dist/src/__tests__/optimizer/constant_fold.test.js +105 -0
- package/dist/src/__tests__/optimizer/coroutine.test.js +3 -2
- package/dist/src/__tests__/parser.test.js +5 -5
- package/dist/src/__tests__/runtime.test.js +143 -238
- package/dist/src/__tests__/stdlib/arr-len.test.d.ts +13 -0
- package/dist/src/__tests__/stdlib/arr-len.test.js +195 -0
- package/dist/src/__tests__/stdlib/calculus.test.d.ts +5 -0
- package/dist/src/__tests__/stdlib/calculus.test.js +123 -0
- package/dist/src/__tests__/stdlib/dialog.test.d.ts +6 -0
- package/dist/src/__tests__/stdlib/dialog.test.js +142 -0
- package/dist/src/__tests__/stdlib/easing.test.d.ts +5 -0
- package/dist/src/__tests__/stdlib/easing.test.js +117 -0
- package/dist/src/__tests__/stdlib/geometry.test.d.ts +5 -0
- package/dist/src/__tests__/stdlib/geometry.test.js +163 -0
- package/dist/src/__tests__/stdlib/heap.test.d.ts +4 -0
- package/dist/src/__tests__/stdlib/heap.test.js +141 -0
- package/dist/src/__tests__/stdlib/list.test.d.ts +5 -0
- package/dist/src/__tests__/stdlib/list.test.js +134 -0
- package/dist/src/__tests__/stdlib/matrix.test.d.ts +5 -0
- package/dist/src/__tests__/stdlib/matrix.test.js +148 -0
- package/dist/src/__tests__/stdlib/pathfind.test.d.ts +4 -0
- package/dist/src/__tests__/stdlib/pathfind.test.js +167 -0
- package/dist/src/__tests__/stdlib/scheduler.test.d.ts +6 -0
- package/dist/src/__tests__/stdlib/scheduler.test.js +177 -0
- package/dist/src/__tests__/stdlib/sort-v2.test.d.ts +4 -0
- package/dist/src/__tests__/stdlib/sort-v2.test.js +131 -0
- package/dist/src/__tests__/stdlib/sort.test.d.ts +4 -0
- package/dist/src/__tests__/stdlib/sort.test.js +128 -0
- package/dist/src/__tests__/stdlib/state.test.d.ts +5 -0
- package/dist/src/__tests__/stdlib/state.test.js +176 -0
- package/dist/src/__tests__/typechecker-strict.test.js +21 -21
- package/dist/src/__tests__/typechecker.test.js +5 -3
- package/dist/src/ast/types.d.ts +28 -2
- package/dist/src/emit/compile.js +30 -3
- package/dist/src/emit/index.d.ts +2 -0
- package/dist/src/emit/index.js +20 -1
- package/dist/src/emit/modules.js +3 -2
- package/dist/src/events/types.d.ts +1 -1
- package/dist/src/events/types.js +5 -2
- package/dist/src/hir/lower.js +88 -2
- package/dist/src/hir/monomorphize.js +11 -5
- package/dist/src/hir/types.d.ts +20 -1
- package/dist/src/lexer/index.d.ts +1 -1
- package/dist/src/lexer/index.js +10 -1
- package/dist/src/lir/lower.js +7 -0
- package/dist/src/lsp/server.js +912 -56
- package/dist/src/mc-test/client.d.ts +13 -1
- package/dist/src/mc-test/client.js +29 -1
- package/dist/src/mir/lower.js +703 -74
- package/dist/src/mir/types.d.ts +5 -0
- package/dist/src/mir/verify.js +2 -0
- package/dist/src/optimizer/constant_fold.js +10 -6
- package/dist/src/optimizer/coroutine.js +90 -33
- package/dist/src/optimizer/interprocedural.js +4 -0
- package/dist/src/parser/index.d.ts +5 -0
- package/dist/src/parser/index.js +171 -39
- package/dist/src/runtime/index.js +24 -0
- package/dist/src/typechecker/index.d.ts +8 -1
- package/dist/src/typechecker/index.js +73 -14
- package/docs/LANGUAGE_REFERENCE.md +302 -67
- package/docs/stdlib/README.md +54 -0
- package/docs/stdlib/advanced.md +276 -0
- package/docs/stdlib/bigint.md +285 -0
- package/docs/stdlib/bits.md +159 -0
- package/docs/stdlib/bossbar.md +101 -0
- package/docs/stdlib/calculus.md +141 -0
- package/docs/stdlib/color.md +125 -0
- package/docs/stdlib/combat.md +41 -0
- package/docs/stdlib/cooldown.md +48 -0
- package/docs/stdlib/easing.md +157 -0
- package/docs/stdlib/effects.md +101 -0
- package/docs/stdlib/expr.md +38 -0
- package/docs/stdlib/geometry.md +130 -0
- package/docs/stdlib/interactions.md +111 -0
- package/docs/stdlib/inventory.md +53 -0
- package/docs/stdlib/list.md +189 -0
- package/docs/stdlib/math.md +334 -0
- package/docs/stdlib/math_hp.md +185 -0
- package/docs/stdlib/matrix.md +123 -0
- package/docs/stdlib/mobs.md +131 -0
- package/docs/stdlib/noise.md +103 -0
- package/docs/stdlib/parabola.md +119 -0
- package/docs/stdlib/particles.md +123 -0
- package/docs/stdlib/physics.md +148 -0
- package/docs/stdlib/player.md +43 -0
- package/docs/stdlib/quaternion.md +159 -0
- package/docs/stdlib/random.md +86 -0
- package/docs/stdlib/sets.md +68 -0
- package/docs/stdlib/signal.md +141 -0
- package/docs/stdlib/spawn.md +65 -0
- package/docs/stdlib/strings.md +17 -0
- package/docs/stdlib/tags.md +117 -0
- package/docs/stdlib/teams.md +87 -0
- package/docs/stdlib/timer.md +126 -0
- package/docs/stdlib/vec.md +193 -0
- package/docs/stdlib/world.md +151 -0
- package/editors/vscode/build.mjs +31 -12
- package/editors/vscode/out/extension.js +3670 -200
- package/editors/vscode/out/lsp-server.js +14854 -0
- package/editors/vscode/package-lock.json +3 -3
- package/editors/vscode/package.json +1 -1
- package/editors/vscode/snippets/redscript.json +109 -30
- package/editors/vscode/src/extension.ts +15 -13
- package/examples/readme-demo.mcrs +4 -4
- package/jest.config.js +5 -2
- package/package.json +1 -1
- package/scripts/postbuild.js +20 -0
- package/src/__tests__/array-dynamic.test.ts +42 -0
- package/src/__tests__/builtins.test.ts +66 -0
- package/src/__tests__/compile-all.test.ts +3 -2
- package/src/__tests__/diagnostics.test.ts +8 -10
- package/src/__tests__/double.test.ts +478 -0
- package/src/__tests__/e2e/ecs-stdlib.test.ts +371 -0
- package/src/__tests__/e2e/events-stdlib.test.ts +50 -0
- package/src/__tests__/e2e/fft-stdlib.test.ts +313 -0
- package/src/__tests__/e2e/macros.test.ts +7 -7
- package/src/__tests__/e2e/ode-stdlib.test.ts +68 -0
- package/src/__tests__/e2e/stdlib-e2e.test.ts +1952 -0
- package/src/__tests__/emit/compile.test.ts +102 -0
- package/src/__tests__/emit/index.test.ts +189 -0
- package/src/__tests__/emit/modules-extra.test.ts +80 -0
- package/src/__tests__/enum.test.ts +4 -6
- package/src/__tests__/fixed.test.ts +159 -0
- package/src/__tests__/fixtures/coroutine-mc-test.mcrs +58 -0
- package/src/__tests__/fixtures/for-range.mcrs +15 -0
- package/src/__tests__/fixtures/heap-sort-mc-test.mcrs +87 -0
- package/src/__tests__/fixtures/impl-test.mcrs +13 -44
- package/src/__tests__/fixtures/stdlib-extra-test.mcrs +226 -0
- package/src/__tests__/fixtures/stdlib-math-integration.mcrs +28 -0
- package/src/__tests__/fixtures/stdlib-math-test.mcrs +53 -0
- package/src/__tests__/float-lint.test.ts +102 -0
- package/src/__tests__/float.test.ts +158 -0
- package/src/__tests__/for-each.test.ts +135 -0
- package/src/__tests__/for-range.test.ts +149 -0
- package/src/__tests__/generics.test.ts +4 -4
- package/src/__tests__/impl.test.ts +207 -0
- package/src/__tests__/lsp-logic.test.ts +162 -0
- package/src/__tests__/match.test.ts +212 -0
- package/src/__tests__/mc-integration/item-entity-events.test.ts +298 -0
- package/src/__tests__/mc-integration/stdlib-coverage-2.test.ts +817 -0
- package/src/__tests__/mc-integration/stdlib-coverage.test.ts +699 -0
- package/src/__tests__/mc-integration/syntax-coverage.test.ts +464 -0
- package/src/__tests__/mc-integration.test.ts +889 -5
- package/src/__tests__/optimizer/constant_fold.test.ts +115 -0
- package/src/__tests__/optimizer/coroutine.test.ts +3 -2
- package/src/__tests__/parser.test.ts +5 -5
- package/src/__tests__/runtime.test.ts +194 -0
- package/src/__tests__/stdlib/arr-len.test.ts +231 -0
- package/src/__tests__/stdlib/calculus.test.ts +99 -0
- package/src/__tests__/stdlib/dialog.test.ts +132 -0
- package/src/__tests__/stdlib/easing.test.ts +97 -0
- package/src/__tests__/stdlib/geometry.test.ts +171 -0
- package/src/__tests__/stdlib/heap.test.ts +121 -0
- package/src/__tests__/stdlib/list.test.ts +117 -0
- package/src/__tests__/stdlib/matrix.test.ts +140 -0
- package/src/__tests__/stdlib/pathfind.test.ts +151 -0
- package/src/__tests__/stdlib/scheduler.test.ts +171 -0
- package/src/__tests__/stdlib/sort-v2.test.ts +111 -0
- package/src/__tests__/stdlib/sort.test.ts +106 -0
- package/src/__tests__/stdlib/state.test.ts +164 -0
- package/src/__tests__/typechecker-strict.test.ts +21 -21
- package/src/__tests__/typechecker.test.ts +5 -3
- package/src/ast/types.ts +16 -3
- package/src/emit/compile.ts +32 -3
- package/src/emit/index.ts +24 -1
- package/src/emit/modules.ts +2 -1
- package/src/events/types.ts +5 -2
- package/src/examples/capture_the_flag.mcrs +2 -2
- package/src/examples/hunger_games.mcrs +4 -4
- package/src/examples/parkour_race.mcrs +8 -8
- package/src/examples/tutorial_01_hello.mcrs +63 -0
- package/src/examples/tutorial_02_variables.mcrs +157 -0
- package/src/examples/tutorial_03_functions_structs.mcrs +162 -0
- package/src/examples/tutorial_04_selectors.mcrs +139 -0
- package/src/examples/tutorial_05_decorators.mcrs +131 -0
- package/src/examples/tutorial_06_math_particles.mcrs +123 -0
- package/src/examples/tutorial_07_random.mcrs +142 -0
- package/src/examples/tutorial_08_coroutine.mcrs +163 -0
- package/src/examples/tutorial_09_precision.mcrs +154 -0
- package/src/examples/tutorial_10_kill_race.mcrs +289 -0
- package/src/examples/zombie_survival.mcrs +7 -7
- package/src/hir/lower.ts +101 -4
- package/src/hir/monomorphize.ts +11 -6
- package/src/hir/types.ts +14 -1
- package/src/lexer/index.ts +11 -2
- package/src/lir/lower.ts +8 -0
- package/src/lsp/server.ts +894 -54
- package/src/mc-test/client.ts +32 -1
- package/src/mir/lower.ts +703 -74
- package/src/mir/types.ts +1 -0
- package/src/mir/verify.ts +2 -0
- package/src/optimizer/constant_fold.ts +11 -6
- package/src/optimizer/coroutine.ts +89 -29
- package/src/optimizer/interprocedural.ts +4 -0
- package/src/parser/index.ts +175 -41
- package/src/runtime/index.ts +26 -0
- package/src/stdlib/advanced.mcrs +47 -0
- package/src/stdlib/bigint.mcrs +251 -0
- package/src/stdlib/calculus.mcrs +150 -0
- package/src/stdlib/color.mcrs +102 -82
- package/src/stdlib/combat.mcrs +18 -12
- package/src/stdlib/dialog.mcrs +55 -0
- package/src/stdlib/ecs.mcrs +238 -0
- package/src/stdlib/events.mcrs +29 -0
- package/src/stdlib/expr.mcrs +117 -0
- package/src/stdlib/fft.mcrs +177 -0
- package/src/stdlib/geometry.mcrs +89 -0
- package/src/stdlib/graph.mcrs +274 -0
- package/src/stdlib/heap.mcrs +175 -0
- package/src/stdlib/linalg.mcrs +260 -0
- package/src/stdlib/list.mcrs +99 -0
- package/src/stdlib/math.mcrs +121 -5
- package/src/stdlib/math_hp.mcrs +452 -0
- package/src/stdlib/matrix.mcrs +113 -0
- package/src/stdlib/ode.mcrs +168 -0
- package/src/stdlib/parabola.mcrs +160 -0
- package/src/stdlib/particles.mcrs +69 -0
- package/src/stdlib/pathfind.mcrs +321 -0
- package/src/stdlib/quaternion.mcrs +192 -0
- package/src/stdlib/random.mcrs +46 -1
- package/src/stdlib/scheduler.mcrs +271 -0
- package/src/stdlib/signal.mcrs +223 -0
- package/src/stdlib/sort.mcrs +194 -0
- package/src/stdlib/state.mcrs +65 -0
- package/src/stdlib/world.mcrs +24 -0
- package/src/typechecker/index.ts +88 -15
- package/test_trig.ts +43 -0
|
@@ -338,10 +338,10 @@ describe('MC Integration Tests', () => {
|
|
|
338
338
|
test('counter.mcrs: tick function increments scoreboard over time', async () => {
|
|
339
339
|
if (!serverOnline) return
|
|
340
340
|
|
|
341
|
-
await mc.ticks(
|
|
341
|
+
await mc.ticks(60) // Wait 3s (counter was already init'd in beforeAll)
|
|
342
342
|
const count = await mc.scoreboard('counter', 'ticks')
|
|
343
343
|
expect(count).toBeGreaterThan(0)
|
|
344
|
-
console.log(` counter/ticks after setup+
|
|
344
|
+
console.log(` counter/ticks after setup+60 ticks: ${count}`)
|
|
345
345
|
})
|
|
346
346
|
|
|
347
347
|
// ─── Test 3: setblock ────────────────────────────────────────────────
|
|
@@ -432,11 +432,11 @@ describe('MC Integration Tests', () => {
|
|
|
432
432
|
|
|
433
433
|
// Reset counter
|
|
434
434
|
await mc.command('/scoreboard players set #tick_counter ticks 0')
|
|
435
|
-
await mc.ticks(
|
|
435
|
+
await mc.ticks(60) // 3s
|
|
436
436
|
|
|
437
437
|
const ticks = await mc.scoreboard('#tick_counter', 'ticks')
|
|
438
|
-
expect(ticks).toBeGreaterThanOrEqual(10) // At least 10 of
|
|
439
|
-
console.log(` #tick_counter after
|
|
438
|
+
expect(ticks).toBeGreaterThanOrEqual(10) // At least 10 of 60 ticks fired
|
|
439
|
+
console.log(` #tick_counter after 60 ticks: ${ticks}`)
|
|
440
440
|
})
|
|
441
441
|
|
|
442
442
|
// ─── Test 10: fullReset clears blocks ─────────────────────────────────
|
|
@@ -906,3 +906,887 @@ describe('MC Integration - Extended Coverage', () => {
|
|
|
906
906
|
expect(await mc.scoreboard('#foreach_at_count', 'rs')).toBe(3)
|
|
907
907
|
})
|
|
908
908
|
})
|
|
909
|
+
|
|
910
|
+
// ─── stdlib math integration ──────────────────────────────────────────────────
|
|
911
|
+
|
|
912
|
+
const MATH_SRC = fs.readFileSync(
|
|
913
|
+
path.join(__dirname, '../stdlib/math.mcrs'),
|
|
914
|
+
'utf-8',
|
|
915
|
+
)
|
|
916
|
+
|
|
917
|
+
function writeFixtureWithLibs(fileName: string, namespace: string, librarySources: string[]): void {
|
|
918
|
+
const source = fs.readFileSync(path.join(FIXTURE_DIR, fileName), 'utf-8')
|
|
919
|
+
fs.mkdirSync(DATAPACK_DIR, { recursive: true })
|
|
920
|
+
if (!fs.existsSync(path.join(DATAPACK_DIR, 'pack.mcmeta'))) {
|
|
921
|
+
fs.writeFileSync(path.join(DATAPACK_DIR, 'pack.mcmeta'), JSON.stringify({
|
|
922
|
+
pack: { pack_format: 48, description: 'RedScript integration tests' }
|
|
923
|
+
}))
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
const result = compile(source, { namespace, librarySources })
|
|
927
|
+
|
|
928
|
+
for (const file of result.files) {
|
|
929
|
+
if (file.path === 'pack.mcmeta') continue
|
|
930
|
+
const filePath = path.join(DATAPACK_DIR, file.path)
|
|
931
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true })
|
|
932
|
+
|
|
933
|
+
if (file.path.includes('data/minecraft/tags/') && fs.existsSync(filePath)) {
|
|
934
|
+
const existing = JSON.parse(fs.readFileSync(filePath, 'utf-8'))
|
|
935
|
+
const incoming = JSON.parse(file.content)
|
|
936
|
+
const merged = { values: [...new Set([...(existing.values ?? []), ...(incoming.values ?? [])])] }
|
|
937
|
+
fs.writeFileSync(filePath, JSON.stringify(merged, null, 2))
|
|
938
|
+
} else {
|
|
939
|
+
fs.writeFileSync(filePath, file.content)
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
describe('MC Integration - stdlib math', () => {
|
|
945
|
+
beforeAll(async () => {
|
|
946
|
+
if (!serverOnline) return
|
|
947
|
+
|
|
948
|
+
writeFixtureWithLibs('stdlib-math-integration.mcrs', 'stdmath', [MATH_SRC])
|
|
949
|
+
await mc.reload()
|
|
950
|
+
await mc.command('/function stdmath:__load').catch(() => {})
|
|
951
|
+
await mc.ticks(5)
|
|
952
|
+
})
|
|
953
|
+
|
|
954
|
+
test('factorial(5) == 120', async () => {
|
|
955
|
+
if (!serverOnline) return
|
|
956
|
+
await mc.command('/function stdmath:test_math_basic')
|
|
957
|
+
await mc.ticks(5)
|
|
958
|
+
expect(await mc.scoreboard('#factorial_5', 'rs')).toBe(120)
|
|
959
|
+
})
|
|
960
|
+
|
|
961
|
+
test('combinations(5,2) == 10', async () => {
|
|
962
|
+
if (!serverOnline) return
|
|
963
|
+
await mc.command('/function stdmath:test_math_basic')
|
|
964
|
+
await mc.ticks(5)
|
|
965
|
+
expect(await mc.scoreboard('#combinations_5_2', 'rs')).toBe(10)
|
|
966
|
+
})
|
|
967
|
+
|
|
968
|
+
test('gcd(12,8) == 4', async () => {
|
|
969
|
+
if (!serverOnline) return
|
|
970
|
+
await mc.command('/function stdmath:test_math_basic')
|
|
971
|
+
await mc.ticks(5)
|
|
972
|
+
expect(await mc.scoreboard('#gcd_12_8', 'rs')).toBe(4)
|
|
973
|
+
})
|
|
974
|
+
|
|
975
|
+
test('isqrt(144) == 12', async () => {
|
|
976
|
+
if (!serverOnline) return
|
|
977
|
+
await mc.command('/function stdmath:test_math_basic')
|
|
978
|
+
await mc.ticks(5)
|
|
979
|
+
expect(await mc.scoreboard('#isqrt_144', 'rs')).toBe(12)
|
|
980
|
+
})
|
|
981
|
+
|
|
982
|
+
test('log2_int(1024) == 10', async () => {
|
|
983
|
+
if (!serverOnline) return
|
|
984
|
+
await mc.command('/function stdmath:test_math_basic')
|
|
985
|
+
await mc.ticks(5)
|
|
986
|
+
expect(await mc.scoreboard('#log2_1024', 'rs')).toBe(10)
|
|
987
|
+
})
|
|
988
|
+
|
|
989
|
+
test('pow_int(2,10) == 1024', async () => {
|
|
990
|
+
if (!serverOnline) return
|
|
991
|
+
await mc.command('/function stdmath:test_math_basic')
|
|
992
|
+
await mc.ticks(5)
|
|
993
|
+
expect(await mc.scoreboard('#pow_2_10', 'rs')).toBe(1024)
|
|
994
|
+
})
|
|
995
|
+
|
|
996
|
+
test('abs(-42) == 42', async () => {
|
|
997
|
+
if (!serverOnline) return
|
|
998
|
+
await mc.command('/function stdmath:test_math_basic')
|
|
999
|
+
await mc.ticks(5)
|
|
1000
|
+
expect(await mc.scoreboard('#abs_neg42', 'rs')).toBe(42)
|
|
1001
|
+
})
|
|
1002
|
+
|
|
1003
|
+
test('clamp(15,0,10) == 10', async () => {
|
|
1004
|
+
if (!serverOnline) return
|
|
1005
|
+
await mc.command('/function stdmath:test_math_basic')
|
|
1006
|
+
await mc.ticks(5)
|
|
1007
|
+
expect(await mc.scoreboard('#clamp_hi', 'rs')).toBe(10)
|
|
1008
|
+
})
|
|
1009
|
+
|
|
1010
|
+
test('sqrt_fx(40000) == 20000', async () => {
|
|
1011
|
+
if (!serverOnline) return
|
|
1012
|
+
await mc.command('/function stdmath:test_math_sqrt')
|
|
1013
|
+
await mc.ticks(5)
|
|
1014
|
+
expect(await mc.scoreboard('#sqrt_fx_40000', 'rs')).toBe(20000)
|
|
1015
|
+
})
|
|
1016
|
+
|
|
1017
|
+
test('cbrt_fx(27) == 3', async () => {
|
|
1018
|
+
if (!serverOnline) return
|
|
1019
|
+
await mc.command('/function stdmath:test_math_sqrt')
|
|
1020
|
+
await mc.ticks(5)
|
|
1021
|
+
expect(await mc.scoreboard('#cbrt_27', 'rs')).toBe(3)
|
|
1022
|
+
})
|
|
1023
|
+
|
|
1024
|
+
test('approx_eq(100,103,5) == 1', async () => {
|
|
1025
|
+
if (!serverOnline) return
|
|
1026
|
+
await mc.command('/function stdmath:test_math_approx')
|
|
1027
|
+
await mc.ticks(5)
|
|
1028
|
+
expect(await mc.scoreboard('#apeq_yes', 'rs')).toBe(1)
|
|
1029
|
+
})
|
|
1030
|
+
|
|
1031
|
+
test('approx_eq(100,110,5) == 0', async () => {
|
|
1032
|
+
if (!serverOnline) return
|
|
1033
|
+
await mc.command('/function stdmath:test_math_approx')
|
|
1034
|
+
await mc.ticks(5)
|
|
1035
|
+
expect(await mc.scoreboard('#apeq_no', 'rs')).toBe(0)
|
|
1036
|
+
})
|
|
1037
|
+
})
|
|
1038
|
+
|
|
1039
|
+
// ─── stdlib extra (random, bits, list_sort, bigint, math_hp) ─────────────────
|
|
1040
|
+
|
|
1041
|
+
const RANDOM_SRC = fs.readFileSync(path.join(__dirname, '../stdlib/random.mcrs'), 'utf-8')
|
|
1042
|
+
const BITS_SRC = fs.readFileSync(path.join(__dirname, '../stdlib/bits.mcrs'), 'utf-8')
|
|
1043
|
+
const LIST_SRC = fs.readFileSync(path.join(__dirname, '../stdlib/list.mcrs'), 'utf-8')
|
|
1044
|
+
const BIGINT_SRC = fs.readFileSync(path.join(__dirname, '../stdlib/bigint.mcrs'), 'utf-8')
|
|
1045
|
+
const MATH_HP_SRC = fs.readFileSync(path.join(__dirname, '../stdlib/math_hp.mcrs'), 'utf-8')
|
|
1046
|
+
const HEAP_SRC = fs.readFileSync(path.join(__dirname, '../stdlib/heap.mcrs'), 'utf-8')
|
|
1047
|
+
const SORT_SRC = fs.readFileSync(path.join(__dirname, '../stdlib/sort.mcrs'), 'utf-8')
|
|
1048
|
+
|
|
1049
|
+
describe('MC Integration - stdlib extra (random/bits/list/bigint)', () => {
|
|
1050
|
+
beforeAll(async () => {
|
|
1051
|
+
if (!serverOnline) return
|
|
1052
|
+
writeFixtureWithLibs('stdlib-extra-test.mcrs', 'stdextra',
|
|
1053
|
+
[MATH_SRC, MATH_HP_SRC, RANDOM_SRC, BITS_SRC, LIST_SRC, BIGINT_SRC])
|
|
1054
|
+
await mc.reload()
|
|
1055
|
+
await mc.ticks(10)
|
|
1056
|
+
await mc.command('/function stdextra:__load').catch(() => {})
|
|
1057
|
+
await mc.ticks(5)
|
|
1058
|
+
})
|
|
1059
|
+
|
|
1060
|
+
test('next_lcg(12345) is deterministic and non-zero', async () => {
|
|
1061
|
+
if (!serverOnline) return
|
|
1062
|
+
await mc.command('/function stdextra:test_random')
|
|
1063
|
+
await mc.ticks(5)
|
|
1064
|
+
const v = await mc.scoreboard('#lcg_12345', 'rsex')
|
|
1065
|
+
expect(typeof v).toBe('number')
|
|
1066
|
+
expect(v).not.toBe(0)
|
|
1067
|
+
})
|
|
1068
|
+
|
|
1069
|
+
test('two consecutive lcg calls produce different values', async () => {
|
|
1070
|
+
if (!serverOnline) return
|
|
1071
|
+
await mc.command('/function stdextra:test_random')
|
|
1072
|
+
await mc.ticks(5)
|
|
1073
|
+
expect(await mc.scoreboard('#lcg_different', 'rsex')).toBe(1)
|
|
1074
|
+
})
|
|
1075
|
+
|
|
1076
|
+
test('random_range stays in [0, 10)', async () => {
|
|
1077
|
+
if (!serverOnline) return
|
|
1078
|
+
await mc.command('/function stdextra:test_random')
|
|
1079
|
+
await mc.ticks(5)
|
|
1080
|
+
expect(await mc.scoreboard('#rand_in_range', 'rsex')).toBe(1)
|
|
1081
|
+
})
|
|
1082
|
+
|
|
1083
|
+
test('random_bool returns 0 or 1', async () => {
|
|
1084
|
+
if (!serverOnline) return
|
|
1085
|
+
await mc.command('/function stdextra:test_random')
|
|
1086
|
+
await mc.ticks(5)
|
|
1087
|
+
expect(await mc.scoreboard('#rand_bool_valid', 'rsex')).toBe(1)
|
|
1088
|
+
})
|
|
1089
|
+
|
|
1090
|
+
test('bit_get(5, 0) == 1', async () => {
|
|
1091
|
+
if (!serverOnline) return
|
|
1092
|
+
await mc.command('/function stdextra:test_bits')
|
|
1093
|
+
await mc.ticks(5)
|
|
1094
|
+
expect(await mc.scoreboard('#bit_get_5_0', 'rsex')).toBe(1)
|
|
1095
|
+
})
|
|
1096
|
+
|
|
1097
|
+
test('bit_get(5, 1) == 0', async () => {
|
|
1098
|
+
if (!serverOnline) return
|
|
1099
|
+
await mc.command('/function stdextra:test_bits')
|
|
1100
|
+
await mc.ticks(5)
|
|
1101
|
+
expect(await mc.scoreboard('#bit_get_5_1', 'rsex')).toBe(0)
|
|
1102
|
+
})
|
|
1103
|
+
|
|
1104
|
+
test('bit_shl(1, 3) == 8', async () => {
|
|
1105
|
+
if (!serverOnline) return
|
|
1106
|
+
await mc.command('/function stdextra:test_bits')
|
|
1107
|
+
await mc.ticks(5)
|
|
1108
|
+
expect(await mc.scoreboard('#bit_shl_1_3', 'rsex')).toBe(8)
|
|
1109
|
+
})
|
|
1110
|
+
|
|
1111
|
+
test('bit_shr(8, 2) == 2', async () => {
|
|
1112
|
+
if (!serverOnline) return
|
|
1113
|
+
await mc.command('/function stdextra:test_bits')
|
|
1114
|
+
await mc.ticks(5)
|
|
1115
|
+
expect(await mc.scoreboard('#bit_shr_8_2', 'rsex')).toBe(2)
|
|
1116
|
+
})
|
|
1117
|
+
|
|
1118
|
+
test('popcount(7) == 3', async () => {
|
|
1119
|
+
if (!serverOnline) return
|
|
1120
|
+
await mc.command('/function stdextra:test_bits')
|
|
1121
|
+
await mc.ticks(5)
|
|
1122
|
+
expect(await mc.scoreboard('#popcount_7', 'rsex')).toBe(3)
|
|
1123
|
+
})
|
|
1124
|
+
|
|
1125
|
+
test('popcount(0) == 0', async () => {
|
|
1126
|
+
if (!serverOnline) return
|
|
1127
|
+
await mc.command('/function stdextra:test_bits')
|
|
1128
|
+
await mc.ticks(5)
|
|
1129
|
+
expect(await mc.scoreboard('#popcount_0', 'rsex')).toBe(0)
|
|
1130
|
+
})
|
|
1131
|
+
|
|
1132
|
+
test('sort3(30,10,20, 0) == 10 (min)', async () => {
|
|
1133
|
+
if (!serverOnline) return
|
|
1134
|
+
await mc.command('/function stdextra:test_list_sort')
|
|
1135
|
+
await mc.ticks(5)
|
|
1136
|
+
expect(await mc.scoreboard('#sort3_min', 'rsex')).toBe(10)
|
|
1137
|
+
})
|
|
1138
|
+
|
|
1139
|
+
test('sort3(30,10,20, 2) == 30 (max)', async () => {
|
|
1140
|
+
if (!serverOnline) return
|
|
1141
|
+
await mc.command('/function stdextra:test_list_sort')
|
|
1142
|
+
await mc.ticks(5)
|
|
1143
|
+
expect(await mc.scoreboard('#sort3_max', 'rsex')).toBe(30)
|
|
1144
|
+
})
|
|
1145
|
+
|
|
1146
|
+
test('sort4(40,10,30,20, 0) == 10 (min)', async () => {
|
|
1147
|
+
if (!serverOnline) return
|
|
1148
|
+
await mc.command('/function stdextra:test_list_sort')
|
|
1149
|
+
await mc.ticks(5)
|
|
1150
|
+
expect(await mc.scoreboard('#sort4_min', 'rsex')).toBe(10)
|
|
1151
|
+
})
|
|
1152
|
+
|
|
1153
|
+
test('sort4(40,10,30,20, 3) == 40 (max)', async () => {
|
|
1154
|
+
if (!serverOnline) return
|
|
1155
|
+
await mc.command('/function stdextra:test_list_sort')
|
|
1156
|
+
await mc.ticks(5)
|
|
1157
|
+
expect(await mc.scoreboard('#sort4_max', 'rsex')).toBe(40)
|
|
1158
|
+
})
|
|
1159
|
+
|
|
1160
|
+
test('list_min3(5,3,8) == 3', async () => {
|
|
1161
|
+
if (!serverOnline) return
|
|
1162
|
+
await mc.command('/function stdextra:test_list_sort')
|
|
1163
|
+
await mc.ticks(5)
|
|
1164
|
+
expect(await mc.scoreboard('#list_min3', 'rsex')).toBe(3)
|
|
1165
|
+
})
|
|
1166
|
+
|
|
1167
|
+
test('list_max3(5,3,8) == 8', async () => {
|
|
1168
|
+
if (!serverOnline) return
|
|
1169
|
+
await mc.command('/function stdextra:test_list_sort')
|
|
1170
|
+
await mc.ticks(5)
|
|
1171
|
+
expect(await mc.scoreboard('#list_max3', 'rsex')).toBe(8)
|
|
1172
|
+
})
|
|
1173
|
+
|
|
1174
|
+
test('avg3(10,20,30) == 20', async () => {
|
|
1175
|
+
if (!serverOnline) return
|
|
1176
|
+
await mc.command('/function stdextra:test_list_sort')
|
|
1177
|
+
await mc.ticks(5)
|
|
1178
|
+
expect(await mc.scoreboard('#avg3', 'rsex')).toBe(20)
|
|
1179
|
+
})
|
|
1180
|
+
|
|
1181
|
+
test('bigint3_add_lo(9999, 1) == 0', async () => {
|
|
1182
|
+
if (!serverOnline) return
|
|
1183
|
+
await mc.command('/function stdextra:test_bigint')
|
|
1184
|
+
await mc.ticks(5)
|
|
1185
|
+
expect(await mc.scoreboard('#bi3_add_lo', 'rsex')).toBe(0)
|
|
1186
|
+
})
|
|
1187
|
+
|
|
1188
|
+
test('bigint3_carry_lo(9999, 1) == 1', async () => {
|
|
1189
|
+
if (!serverOnline) return
|
|
1190
|
+
await mc.command('/function stdextra:test_bigint')
|
|
1191
|
+
await mc.ticks(5)
|
|
1192
|
+
expect(await mc.scoreboard('#bi3_carry_lo', 'rsex')).toBe(1)
|
|
1193
|
+
})
|
|
1194
|
+
|
|
1195
|
+
test('bigint3_cmp([1,0,0] vs [0,9999,9999]) == 1', async () => {
|
|
1196
|
+
if (!serverOnline) return
|
|
1197
|
+
await mc.command('/function stdextra:test_bigint')
|
|
1198
|
+
await mc.ticks(5)
|
|
1199
|
+
expect(await mc.scoreboard('#bi3_cmp_gt', 'rsex')).toBe(1)
|
|
1200
|
+
})
|
|
1201
|
+
|
|
1202
|
+
test('bigint3_cmp([0,9999,9999] vs [1,0,0]) == -1', async () => {
|
|
1203
|
+
if (!serverOnline) return
|
|
1204
|
+
await mc.command('/function stdextra:test_bigint')
|
|
1205
|
+
await mc.ticks(5)
|
|
1206
|
+
expect(await mc.scoreboard('#bi3_cmp_lt', 'rsex')).toBe(-1)
|
|
1207
|
+
})
|
|
1208
|
+
|
|
1209
|
+
test('int32_to_bigint3_hi(1023456789) == 10', async () => {
|
|
1210
|
+
if (!serverOnline) return
|
|
1211
|
+
await mc.command('/function stdextra:test_bigint')
|
|
1212
|
+
await mc.ticks(5)
|
|
1213
|
+
expect(await mc.scoreboard('#bi3_hi', 'rsex')).toBe(10)
|
|
1214
|
+
})
|
|
1215
|
+
|
|
1216
|
+
test('int32_to_bigint3_mid(1023456789) == 2345', async () => {
|
|
1217
|
+
if (!serverOnline) return
|
|
1218
|
+
await mc.command('/function stdextra:test_bigint')
|
|
1219
|
+
await mc.ticks(5)
|
|
1220
|
+
expect(await mc.scoreboard('#bi3_mid', 'rsex')).toBe(2345)
|
|
1221
|
+
})
|
|
1222
|
+
|
|
1223
|
+
test('int32_to_bigint3_lo(1023456789) == 6789', async () => {
|
|
1224
|
+
if (!serverOnline) return
|
|
1225
|
+
await mc.command('/function stdextra:test_bigint')
|
|
1226
|
+
await mc.ticks(5)
|
|
1227
|
+
expect(await mc.scoreboard('#bi3_lo', 'rsex')).toBe(6789)
|
|
1228
|
+
})
|
|
1229
|
+
})
|
|
1230
|
+
|
|
1231
|
+
// ─── stdlib math_hp integration ───────────────────────────────────────────────
|
|
1232
|
+
|
|
1233
|
+
describe('MC Integration - math_hp (ln_hp, double_mul_fixed)', () => {
|
|
1234
|
+
beforeAll(async () => {
|
|
1235
|
+
if (!serverOnline) return
|
|
1236
|
+
// stdextra is already written with MATH_HP_SRC in the previous describe's beforeAll.
|
|
1237
|
+
// Just need the scoreboard and a fresh reload.
|
|
1238
|
+
await mc.command('/scoreboard objectives add rshp dummy').catch(() => {})
|
|
1239
|
+
await mc.ticks(2)
|
|
1240
|
+
})
|
|
1241
|
+
|
|
1242
|
+
// ─── ln_hp ─────────────────────────────────────────────────────────────────
|
|
1243
|
+
|
|
1244
|
+
test('ln_hp(10000) == 0 [ln(1) = 0]', async () => {
|
|
1245
|
+
if (!serverOnline) return
|
|
1246
|
+
await mc.command('/function stdextra:test_ln_hp')
|
|
1247
|
+
await mc.ticks(5)
|
|
1248
|
+
expect(await mc.scoreboard('#ln_1', 'rshp')).toBe(0)
|
|
1249
|
+
})
|
|
1250
|
+
|
|
1251
|
+
test('ln_hp(27183) ≈ 10000 [ln(e) ≈ 1.0, tolerance ±10]', async () => {
|
|
1252
|
+
if (!serverOnline) return
|
|
1253
|
+
await mc.command('/function stdextra:test_ln_hp')
|
|
1254
|
+
await mc.ticks(5)
|
|
1255
|
+
const v = await mc.scoreboard('#ln_e', 'rshp')
|
|
1256
|
+
expect(v).toBeGreaterThanOrEqual(9990)
|
|
1257
|
+
expect(v).toBeLessThanOrEqual(10010)
|
|
1258
|
+
console.log(` ln_hp(27183) = ${v} (expect ≈10000) ✓`)
|
|
1259
|
+
})
|
|
1260
|
+
|
|
1261
|
+
test('ln_hp(20000) ≈ 6931 [ln(2), tolerance ±10]', async () => {
|
|
1262
|
+
if (!serverOnline) return
|
|
1263
|
+
await mc.command('/function stdextra:test_ln_hp')
|
|
1264
|
+
await mc.ticks(5)
|
|
1265
|
+
const v = await mc.scoreboard('#ln_2', 'rshp')
|
|
1266
|
+
expect(v).toBeGreaterThanOrEqual(6921)
|
|
1267
|
+
expect(v).toBeLessThanOrEqual(6941)
|
|
1268
|
+
console.log(` ln_hp(20000) = ${v} (expect ≈6931) ✓`)
|
|
1269
|
+
})
|
|
1270
|
+
|
|
1271
|
+
test('ln_hp(100000) ≈ 23026 [ln(10), tolerance ±20]', async () => {
|
|
1272
|
+
if (!serverOnline) return
|
|
1273
|
+
await mc.command('/function stdextra:test_ln_hp')
|
|
1274
|
+
await mc.ticks(5)
|
|
1275
|
+
const v = await mc.scoreboard('#ln_10', 'rshp')
|
|
1276
|
+
expect(v).toBeGreaterThanOrEqual(23006)
|
|
1277
|
+
expect(v).toBeLessThanOrEqual(23046)
|
|
1278
|
+
console.log(` ln_hp(100000) = ${v} (expect ≈23026) ✓`)
|
|
1279
|
+
})
|
|
1280
|
+
|
|
1281
|
+
// ─── double_mul_fixed ───────────────────────────────────────────────────────
|
|
1282
|
+
|
|
1283
|
+
test('double_mul_fixed(2.0d, 15000) ≈ 30000 [2.0 × 1.5 = 3.0, as fixed]', async () => {
|
|
1284
|
+
if (!serverOnline) return
|
|
1285
|
+
// Set f=15000 (1.5 in ×10000 fixed) which the fixture reads via scoreboard_get
|
|
1286
|
+
await mc.command('/scoreboard players set #dmul_f_in rshp 15000')
|
|
1287
|
+
await mc.command('/function stdextra:test_double_mul_fixed')
|
|
1288
|
+
await mc.ticks(5)
|
|
1289
|
+
const v = await mc.scoreboard('#dmul_result', 'rshp')
|
|
1290
|
+
// 2.0 × 1.5 = 3.0 → as fixed (×10000) = 30000
|
|
1291
|
+
expect(v).toBeGreaterThanOrEqual(29990)
|
|
1292
|
+
expect(v).toBeLessThanOrEqual(30010)
|
|
1293
|
+
console.log(` double_mul_fixed(2.0d, 15000) as fixed = ${v} (expect ≈30000) ✓`)
|
|
1294
|
+
})
|
|
1295
|
+
})
|
|
1296
|
+
|
|
1297
|
+
// ─── Bot API helpers ──────────────────────────────────────────────────────────
|
|
1298
|
+
|
|
1299
|
+
const BOT_URL = 'http://localhost:25562'
|
|
1300
|
+
|
|
1301
|
+
async function botGet(endpoint: string): Promise<any> {
|
|
1302
|
+
const res = await fetch(`${BOT_URL}${endpoint}`)
|
|
1303
|
+
return res.json()
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
async function botPost(endpoint: string, body: object = {}): Promise<any> {
|
|
1307
|
+
const res = await fetch(`${BOT_URL}${endpoint}`, {
|
|
1308
|
+
method: 'POST',
|
|
1309
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1310
|
+
body: JSON.stringify(body),
|
|
1311
|
+
})
|
|
1312
|
+
return res.json()
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
async function botItemCount(name: string): Promise<number> {
|
|
1316
|
+
const data = await botGet(`/inventory/count?name=${encodeURIComponent(name)}`)
|
|
1317
|
+
return (data as any).count ?? 0
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
async function clearBotInventory(): Promise<void> {
|
|
1321
|
+
await mc.command('clear TestBot')
|
|
1322
|
+
await botPost('/wait', { ticks: 5 })
|
|
1323
|
+
}
|
|
1324
|
+
|
|
1325
|
+
async function getNbt(storage: string, nbtPath: string): Promise<number | null> {
|
|
1326
|
+
const res = await fetch(
|
|
1327
|
+
`http://localhost:25561/nbt?storage=${encodeURIComponent(storage)}&path=${encodeURIComponent(nbtPath)}`
|
|
1328
|
+
)
|
|
1329
|
+
const data: any = await res.json()
|
|
1330
|
+
return typeof data.value === 'number' ? data.value : null
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
// ─── Player-facing tests ──────────────────────────────────────────────────────
|
|
1334
|
+
|
|
1335
|
+
let botOnline = false
|
|
1336
|
+
|
|
1337
|
+
describe('player-facing: bot setup', () => {
|
|
1338
|
+
beforeAll(async () => {
|
|
1339
|
+
try {
|
|
1340
|
+
const status: any = await botGet('/status')
|
|
1341
|
+
botOnline = status.connected === true
|
|
1342
|
+
} catch {
|
|
1343
|
+
botOnline = false
|
|
1344
|
+
}
|
|
1345
|
+
})
|
|
1346
|
+
|
|
1347
|
+
test('mineflayer TestBot is connected', () => {
|
|
1348
|
+
if (!botOnline) {
|
|
1349
|
+
console.warn(' ⚠ TestBot not running — skipping player-facing tests')
|
|
1350
|
+
}
|
|
1351
|
+
// Non-fatal: skip rather than fail if bot is not up
|
|
1352
|
+
expect(typeof botOnline).toBe('boolean')
|
|
1353
|
+
})
|
|
1354
|
+
})
|
|
1355
|
+
|
|
1356
|
+
describe('player-facing: give items', () => {
|
|
1357
|
+
beforeEach(async () => {
|
|
1358
|
+
if (!botOnline || !serverOnline) return
|
|
1359
|
+
await clearBotInventory()
|
|
1360
|
+
})
|
|
1361
|
+
|
|
1362
|
+
test('give command delivers diamond to TestBot', async () => {
|
|
1363
|
+
if (!botOnline || !serverOnline) return
|
|
1364
|
+
await mc.command('give TestBot minecraft:diamond 5')
|
|
1365
|
+
await botPost('/wait', { ticks: 10 })
|
|
1366
|
+
const count = await botItemCount('diamond')
|
|
1367
|
+
expect(count).toBe(5)
|
|
1368
|
+
console.log(` give TestBot diamond 5 → inventory count = ${count} ✓`)
|
|
1369
|
+
})
|
|
1370
|
+
|
|
1371
|
+
test('give gold_ingot to TestBot', async () => {
|
|
1372
|
+
if (!botOnline || !serverOnline) return
|
|
1373
|
+
await mc.command('give TestBot minecraft:gold_ingot 3')
|
|
1374
|
+
await botPost('/wait', { ticks: 10 })
|
|
1375
|
+
const count = await botItemCount('gold_ingot')
|
|
1376
|
+
expect(count).toBe(3)
|
|
1377
|
+
console.log(` give TestBot gold_ingot 3 → inventory count = ${count} ✓`)
|
|
1378
|
+
})
|
|
1379
|
+
})
|
|
1380
|
+
|
|
1381
|
+
describe('player-facing: effects', () => {
|
|
1382
|
+
test('effect give speed applies to TestBot', async () => {
|
|
1383
|
+
if (!botOnline || !serverOnline) return
|
|
1384
|
+
await mc.command('effect clear TestBot')
|
|
1385
|
+
await botPost('/wait', { ticks: 5 })
|
|
1386
|
+
await mc.command('effect give TestBot minecraft:speed 30 1')
|
|
1387
|
+
await botPost('/wait', { ticks: 10 })
|
|
1388
|
+
const data: any = await botGet('/effects')
|
|
1389
|
+
// Speed = MC effect id 1
|
|
1390
|
+
// mineflayer uses 0-based effect ids (speed = 0), MC uses 1-based (speed = 1)
|
|
1391
|
+
const hasSpeed = Array.isArray(data.effects) && data.effects.length > 0
|
|
1392
|
+
expect(hasSpeed).toBe(true)
|
|
1393
|
+
console.log(` effect give speed → effects: ${JSON.stringify(data.effects)} ✓`)
|
|
1394
|
+
})
|
|
1395
|
+
})
|
|
1396
|
+
|
|
1397
|
+
describe('double precision: NBT read/write via /nbt endpoint', () => {
|
|
1398
|
+
test('write double to rs:d and read it back', async () => {
|
|
1399
|
+
if (!serverOnline) return
|
|
1400
|
+
await mc.command('data modify storage rs:d result set value 3.14159d')
|
|
1401
|
+
await mc.ticks(2)
|
|
1402
|
+
const val = await getNbt('rs:d', 'result')
|
|
1403
|
+
expect(val).not.toBeNull()
|
|
1404
|
+
expect(val!).toBeCloseTo(3.14159, 4)
|
|
1405
|
+
console.log(` rs:d result = ${val} (expect ≈3.14159) ✓`)
|
|
1406
|
+
})
|
|
1407
|
+
|
|
1408
|
+
test('write integer double and read back as 1.0', async () => {
|
|
1409
|
+
if (!serverOnline) return
|
|
1410
|
+
await mc.command('data modify storage rs:d result set value 1.0d')
|
|
1411
|
+
await mc.ticks(2)
|
|
1412
|
+
const val = await getNbt('rs:d', 'result')
|
|
1413
|
+
expect(val).toBe(1.0)
|
|
1414
|
+
console.log(` rs:d result = ${val} (expect 1.0) ✓`)
|
|
1415
|
+
})
|
|
1416
|
+
})
|
|
1417
|
+
|
|
1418
|
+
// ─── @coroutine MC integration tests ─────────────────────────────────────────
|
|
1419
|
+
|
|
1420
|
+
describe('@coroutine: tick-spreading via /tick freeze+step', () => {
|
|
1421
|
+
const CORO_NS = 'coro_mc_test'
|
|
1422
|
+
const OBJ = `__${CORO_NS}`
|
|
1423
|
+
|
|
1424
|
+
beforeAll(async () => {
|
|
1425
|
+
if (!serverOnline) return
|
|
1426
|
+
writeFixtureFile('coroutine-mc-test.mcrs', CORO_NS)
|
|
1427
|
+
await mc.reload()
|
|
1428
|
+
})
|
|
1429
|
+
|
|
1430
|
+
test('sum(0..99) = 4950 with batch=10 after 15 ticks', async () => {
|
|
1431
|
+
if (!serverOnline) return
|
|
1432
|
+
// Reset accumulators
|
|
1433
|
+
await mc.command(`scoreboard players set $coro_sum_acc ${OBJ} 0`)
|
|
1434
|
+
await mc.command(`scoreboard players set $coro_done_count ${OBJ} 0`)
|
|
1435
|
+
|
|
1436
|
+
await mc.withTickControl(async (step) => {
|
|
1437
|
+
// Trigger: call trigger_coro_sum function directly
|
|
1438
|
+
await mc.command(`/function coro_mc_test:trigger_coro_sum`)
|
|
1439
|
+
// batch=10, 100 iters → need 10 ticks; give 15 for safety
|
|
1440
|
+
await step(15)
|
|
1441
|
+
})
|
|
1442
|
+
|
|
1443
|
+
const result = await mc.scoreboard('$coro_sum_acc', OBJ)
|
|
1444
|
+
const doneCount = await mc.scoreboard('$coro_done_count', OBJ)
|
|
1445
|
+
expect(result).toBe(4950)
|
|
1446
|
+
expect(doneCount).toBe(1)
|
|
1447
|
+
console.log(` coro sum(0..99) = ${result} (expect 4950), onDone = ${doneCount} ✓`)
|
|
1448
|
+
}, 30000)
|
|
1449
|
+
|
|
1450
|
+
test('partial: batch=5 — not complete after 3 ticks', async () => {
|
|
1451
|
+
if (!serverOnline) return
|
|
1452
|
+
// Reset
|
|
1453
|
+
await mc.command(`scoreboard players set $partial_acc ${OBJ} 0`)
|
|
1454
|
+
await mc.command(`scoreboard players set $partial_done ${OBJ} 0`)
|
|
1455
|
+
|
|
1456
|
+
await mc.tickFreeze()
|
|
1457
|
+
try {
|
|
1458
|
+
// Trigger
|
|
1459
|
+
await mc.command(`/function coro_mc_test:trigger_partial`)
|
|
1460
|
+
// Step only 3 ticks (need 10 for 50 iters / batch=5)
|
|
1461
|
+
await mc.tickStep(3)
|
|
1462
|
+
|
|
1463
|
+
const earlyDone = await mc.scoreboard('$partial_done', OBJ).catch(() => 0)
|
|
1464
|
+
// onDone not yet fired — proves tick spreading
|
|
1465
|
+
expect(earlyDone).toBe(0)
|
|
1466
|
+
console.log(` after 3 ticks: partial_done = ${earlyDone} (expect 0 — not yet complete) ✓`)
|
|
1467
|
+
|
|
1468
|
+
// Now advance enough to complete
|
|
1469
|
+
await mc.tickStep(10)
|
|
1470
|
+
} finally {
|
|
1471
|
+
await mc.tickUnfreeze()
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
const finalDone = await mc.scoreboard('$partial_done', OBJ)
|
|
1475
|
+
const finalAcc = await mc.scoreboard('$partial_acc', OBJ)
|
|
1476
|
+
expect(finalDone).toBe(1)
|
|
1477
|
+
expect(finalAcc).toBe(1225) // sum(0..49) = 1225
|
|
1478
|
+
console.log(` after 13 ticks: partial_done = ${finalDone}, acc = ${finalAcc} (expect 1225) ✓`)
|
|
1479
|
+
}, 30000)
|
|
1480
|
+
})
|
|
1481
|
+
|
|
1482
|
+
// ─── heap & sort stdlib MC integration tests ──────────────────────────────────
|
|
1483
|
+
|
|
1484
|
+
describe('MC Integration - heap & sort stdlib', () => {
|
|
1485
|
+
beforeAll(async () => {
|
|
1486
|
+
if (!serverOnline) return
|
|
1487
|
+
writeFixtureWithLibs('heap-sort-mc-test.mcrs', 'heap_sort_mc_test', [HEAP_SRC, SORT_SRC])
|
|
1488
|
+
await mc.reload()
|
|
1489
|
+
await mc.ticks(5)
|
|
1490
|
+
await mc.command('/function heap_sort_mc_test:load_fn').catch(() => {})
|
|
1491
|
+
await mc.ticks(3)
|
|
1492
|
+
})
|
|
1493
|
+
|
|
1494
|
+
test('MinHeap push/pop: push 5,1,3,2,4 → first 3 pops = 1,2,3', async () => {
|
|
1495
|
+
if (!serverOnline) return
|
|
1496
|
+
await mc.command('/function heap_sort_mc_test:test_min_heap')
|
|
1497
|
+
await mc.ticks(5)
|
|
1498
|
+
const encoded = await mc.scoreboard('#heap_min_top3', 'hsmc')
|
|
1499
|
+
expect(encoded).toBe(123) // 100*1 + 10*2 + 3
|
|
1500
|
+
const sizeAfter = await mc.scoreboard('#heap_size_after_pop3', 'hsmc')
|
|
1501
|
+
expect(sizeAfter).toBe(3) // 5 pushed, 2 pops (peek→pop→peek→pop→peek), 5-2=3
|
|
1502
|
+
console.log(` MinHeap top3 encoded=${encoded} (expect 123), size after 2 pops=${sizeAfter} (expect 3) ✓`)
|
|
1503
|
+
}, 20000)
|
|
1504
|
+
|
|
1505
|
+
test('MaxHeap push/pop: push 3,1,4,1,5 → first pop = 5, second = 4', async () => {
|
|
1506
|
+
if (!serverOnline) return
|
|
1507
|
+
await mc.command('/function heap_sort_mc_test:test_max_heap')
|
|
1508
|
+
await mc.ticks(5)
|
|
1509
|
+
const top = await mc.scoreboard('#max_heap_top', 'hsmc')
|
|
1510
|
+
expect(top).toBe(5)
|
|
1511
|
+
const second = await mc.scoreboard('#max_heap_second', 'hsmc')
|
|
1512
|
+
expect(second).toBe(4)
|
|
1513
|
+
console.log(` MaxHeap top=${top} (expect 5), second=${second} (expect 4) ✓`)
|
|
1514
|
+
}, 20000)
|
|
1515
|
+
|
|
1516
|
+
test('insertion_sort ascending: [30,10,50,20,40] → [10,20,30,40,50]', async () => {
|
|
1517
|
+
if (!serverOnline) return
|
|
1518
|
+
await mc.command('/function heap_sort_mc_test:test_sort_asc')
|
|
1519
|
+
await mc.ticks(5)
|
|
1520
|
+
const ok = await mc.scoreboard('#sort_asc_ok', 'hsmc')
|
|
1521
|
+
const first = await mc.scoreboard('#sort_asc_first', 'hsmc')
|
|
1522
|
+
const last = await mc.scoreboard('#sort_asc_last', 'hsmc')
|
|
1523
|
+
expect(ok).toBe(1)
|
|
1524
|
+
expect(first).toBe(10)
|
|
1525
|
+
expect(last).toBe(50)
|
|
1526
|
+
console.log(` sort_asc ok=${ok}, first=${first} (10), last=${last} (50) ✓`)
|
|
1527
|
+
}, 15000)
|
|
1528
|
+
|
|
1529
|
+
test('insertion_sort descending: [30,10,50,20,40] → [50,...,10]', async () => {
|
|
1530
|
+
if (!serverOnline) return
|
|
1531
|
+
await mc.command('/function heap_sort_mc_test:test_sort_desc')
|
|
1532
|
+
await mc.ticks(5)
|
|
1533
|
+
const ok = await mc.scoreboard('#sort_desc_ok', 'hsmc')
|
|
1534
|
+
expect(ok).toBe(1)
|
|
1535
|
+
console.log(` sort_desc ok=${ok} ✓`)
|
|
1536
|
+
}, 15000)
|
|
1537
|
+
|
|
1538
|
+
test('sort_merge([1,3,5], [2,4,6]) → NBT result = [1,2,3,4,5,6]', async () => {
|
|
1539
|
+
if (!serverOnline) return
|
|
1540
|
+
await mc.command('/function heap_sort_mc_test:test_sort_merge')
|
|
1541
|
+
await mc.ticks(5)
|
|
1542
|
+
const ran = await mc.scoreboard('#sort_merge_ran', 'hsmc')
|
|
1543
|
+
expect(ran).toBe(1)
|
|
1544
|
+
// Read result array from NBT storage directly via fetch
|
|
1545
|
+
const url = `http://localhost:25561/nbt?storage=${encodeURIComponent('heap_sort_mc_test:arrays')}&path=${encodeURIComponent('result')}`
|
|
1546
|
+
const resp = await fetch(url)
|
|
1547
|
+
const data = await resp.json() as { value: string }
|
|
1548
|
+
// result should be [1, 2, 3, 4, 5, 6]
|
|
1549
|
+
const nums = data.value.replace(/[\[\]]/g, '').split(',').map((s: string) => parseInt(s.trim(), 10))
|
|
1550
|
+
expect(nums).toEqual([1, 2, 3, 4, 5, 6])
|
|
1551
|
+
console.log(` sort_merge result = ${data.value} (expect [1,2,3,4,5,6]) ✓`)
|
|
1552
|
+
}, 15000)
|
|
1553
|
+
})
|
|
1554
|
+
|
|
1555
|
+
// ---------------------------------------------------------------------------
|
|
1556
|
+
// Entity tag: @s.tag / @s.untag / @s.has_tag (requires execute as TestBot)
|
|
1557
|
+
// ---------------------------------------------------------------------------
|
|
1558
|
+
|
|
1559
|
+
describe('MC Integration - entity tag methods (@s.tag/untag/has_tag)', () => {
|
|
1560
|
+
const NS = 'entity_tag_test'
|
|
1561
|
+
const OBJ = '__entity_tag_test'
|
|
1562
|
+
|
|
1563
|
+
beforeAll(async () => {
|
|
1564
|
+
if (!serverOnline) return
|
|
1565
|
+
|
|
1566
|
+
writeFixture(`
|
|
1567
|
+
namespace entity_tag_test
|
|
1568
|
+
|
|
1569
|
+
@load fn __load() {
|
|
1570
|
+
raw("scoreboard objectives add etag_obj dummy");
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
// Must be called with "execute as <player> run function ..."
|
|
1574
|
+
// so @s refers to the player entity.
|
|
1575
|
+
@keep fn test_tag_ops() {
|
|
1576
|
+
// 1. add tag
|
|
1577
|
+
@s.tag("etag_vip")
|
|
1578
|
+
|
|
1579
|
+
// 2. has_tag should return 1
|
|
1580
|
+
let has1: int = @s.has_tag("etag_vip")
|
|
1581
|
+
scoreboard_set("#has_after_tag", "etag_obj", has1)
|
|
1582
|
+
|
|
1583
|
+
// 3. remove tag
|
|
1584
|
+
@s.untag("etag_vip")
|
|
1585
|
+
|
|
1586
|
+
// 4. has_tag should return 0
|
|
1587
|
+
let has2: int = @s.has_tag("etag_vip")
|
|
1588
|
+
scoreboard_set("#has_after_untag", "etag_obj", has2)
|
|
1589
|
+
}
|
|
1590
|
+
`, NS)
|
|
1591
|
+
|
|
1592
|
+
await mc.reload()
|
|
1593
|
+
await mc.ticks(10)
|
|
1594
|
+
await mc.command(`/function ${NS}:__load`).catch(() => {})
|
|
1595
|
+
await mc.ticks(5)
|
|
1596
|
+
})
|
|
1597
|
+
|
|
1598
|
+
test('@s.tag adds tag, has_tag returns 1; @s.untag removes tag, has_tag returns 0', async () => {
|
|
1599
|
+
if (!serverOnline || !botOnline) return // requires TestBot as @s context
|
|
1600
|
+
|
|
1601
|
+
// Must run as TestBot so @s is an actual player entity
|
|
1602
|
+
await mc.command(`/execute as TestBot run function ${NS}:test_tag_ops`)
|
|
1603
|
+
await mc.ticks(5)
|
|
1604
|
+
|
|
1605
|
+
const hasAfterTag = await mc.scoreboard('#has_after_tag', 'etag_obj')
|
|
1606
|
+
const hasAfterUntag = await mc.scoreboard('#has_after_untag', 'etag_obj')
|
|
1607
|
+
|
|
1608
|
+
expect(hasAfterTag).toBe(1)
|
|
1609
|
+
expect(hasAfterUntag).toBe(0)
|
|
1610
|
+
|
|
1611
|
+
console.log(` has_after_tag=${hasAfterTag} (expect 1) ✓`)
|
|
1612
|
+
console.log(` has_after_untag=${hasAfterUntag} (expect 0) ✓`)
|
|
1613
|
+
}, 20000)
|
|
1614
|
+
})
|
|
1615
|
+
|
|
1616
|
+
// ===========================================================================
|
|
1617
|
+
// fft.mcrs — MC integration test for dft_real array param dynamic indexing
|
|
1618
|
+
// ===========================================================================
|
|
1619
|
+
describe('MC Integration - fft.mcrs dft_real', () => {
|
|
1620
|
+
const NS = 'fft_mc_test'
|
|
1621
|
+
|
|
1622
|
+
beforeAll(async () => {
|
|
1623
|
+
if (!serverOnline) return
|
|
1624
|
+
|
|
1625
|
+
const MATH_SRC = fs.readFileSync(path.join(__dirname, '../stdlib/math.mcrs'), 'utf-8')
|
|
1626
|
+
const FFT_SRC = fs.readFileSync(path.join(__dirname, '../stdlib/fft.mcrs'), 'utf-8')
|
|
1627
|
+
|
|
1628
|
+
const fftSrc = `
|
|
1629
|
+
namespace fft_mc_test
|
|
1630
|
+
|
|
1631
|
+
@load fn __load() {
|
|
1632
|
+
raw("scoreboard objectives add fft_obj dummy");
|
|
1633
|
+
_math_init()
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
@keep fn test_dft_re0(): int {
|
|
1637
|
+
let input: int[] = [10000, 10000, 10000, 10000]
|
|
1638
|
+
let re: int[] = [0, 0, 0, 0]
|
|
1639
|
+
let im: int[] = [0, 0, 0, 0]
|
|
1640
|
+
dft_real(input, 4, re, im)
|
|
1641
|
+
let v: int = re[0]
|
|
1642
|
+
scoreboard_set("#dft_re0", "fft_obj", v)
|
|
1643
|
+
return v
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1646
|
+
@keep fn test_dft_mag1(): int {
|
|
1647
|
+
let input: int[] = [10000, 0, -10000, 0]
|
|
1648
|
+
let re: int[] = [0, 0, 0, 0]
|
|
1649
|
+
let im: int[] = [0, 0, 0, 0]
|
|
1650
|
+
dft_real(input, 4, re, im)
|
|
1651
|
+
let mag: int = dft_magnitude(re, im, 1)
|
|
1652
|
+
scoreboard_set("#dft_mag1", "fft_obj", mag)
|
|
1653
|
+
return mag
|
|
1654
|
+
}
|
|
1655
|
+
`
|
|
1656
|
+
|
|
1657
|
+
// Use compile directly with librarySources (writeFixture doesn't support libs)
|
|
1658
|
+
fs.mkdirSync(DATAPACK_DIR, { recursive: true })
|
|
1659
|
+
if (!fs.existsSync(path.join(DATAPACK_DIR, 'pack.mcmeta'))) {
|
|
1660
|
+
fs.writeFileSync(path.join(DATAPACK_DIR, 'pack.mcmeta'), JSON.stringify({
|
|
1661
|
+
pack: { pack_format: 48, description: 'RedScript integration tests' }
|
|
1662
|
+
}))
|
|
1663
|
+
}
|
|
1664
|
+
const fftResult = compile(fftSrc, { namespace: NS, librarySources: [MATH_SRC, FFT_SRC] })
|
|
1665
|
+
for (const file of fftResult.files) {
|
|
1666
|
+
if (file.path === 'pack.mcmeta') continue
|
|
1667
|
+
const filePath = path.join(DATAPACK_DIR, file.path)
|
|
1668
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true })
|
|
1669
|
+
if (file.path.includes('data/minecraft/tags/') && fs.existsSync(filePath)) {
|
|
1670
|
+
const existing = JSON.parse(fs.readFileSync(filePath, 'utf-8'))
|
|
1671
|
+
const incoming = JSON.parse(file.content)
|
|
1672
|
+
const merged = { values: [...new Set([...(existing.values ?? []), ...(incoming.values ?? [])])] }
|
|
1673
|
+
fs.writeFileSync(filePath, JSON.stringify(merged, null, 2))
|
|
1674
|
+
} else {
|
|
1675
|
+
fs.writeFileSync(filePath, file.content)
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
await mc.reload()
|
|
1680
|
+
await mc.ticks(10)
|
|
1681
|
+
await mc.command(`/function ${NS}:__load`).catch(() => {})
|
|
1682
|
+
await mc.ticks(5)
|
|
1683
|
+
})
|
|
1684
|
+
|
|
1685
|
+
test('dft_real DC input: re[0] == 40000', async () => {
|
|
1686
|
+
if (!serverOnline) return
|
|
1687
|
+
await mc.command(`/function ${NS}:test_dft_re0`)
|
|
1688
|
+
await mc.ticks(3)
|
|
1689
|
+
const val = await mc.scoreboard('#dft_re0', 'fft_obj')
|
|
1690
|
+
expect(val).toBe(40000)
|
|
1691
|
+
}, 20000)
|
|
1692
|
+
|
|
1693
|
+
test('dft_real quarter-wave: X[1] magnitude ≈ 20000', async () => {
|
|
1694
|
+
if (!serverOnline) return
|
|
1695
|
+
await mc.command(`/function ${NS}:test_dft_mag1`)
|
|
1696
|
+
await mc.ticks(3)
|
|
1697
|
+
const val = await mc.scoreboard('#dft_mag1', 'fft_obj')
|
|
1698
|
+
expect(val).toBeGreaterThanOrEqual(19500)
|
|
1699
|
+
expect(val).toBeLessThanOrEqual(20500)
|
|
1700
|
+
}, 20000)
|
|
1701
|
+
})
|
|
1702
|
+
|
|
1703
|
+
// ===========================================================================
|
|
1704
|
+
// events.mcrs — MC integration test for @on(EventType) event handler system
|
|
1705
|
+
// ===========================================================================
|
|
1706
|
+
describe('MC Integration - @on(EventType) event system', () => {
|
|
1707
|
+
const NS = 'ev_mc_test'
|
|
1708
|
+
let botOnline = false
|
|
1709
|
+
|
|
1710
|
+
beforeAll(async () => {
|
|
1711
|
+
if (!serverOnline) return
|
|
1712
|
+
|
|
1713
|
+
const EVENTS_SRC = fs.readFileSync(path.join(__dirname, '../stdlib/events.mcrs'), 'utf-8')
|
|
1714
|
+
|
|
1715
|
+
const evSrc = `
|
|
1716
|
+
namespace ev_mc_test
|
|
1717
|
+
|
|
1718
|
+
@on(PlayerJoin) fn on_join(p: Player) {
|
|
1719
|
+
raw("scoreboard objectives add ev_obj dummy");
|
|
1720
|
+
scoreboard_add(p, "ev_obj", 1)
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1723
|
+
@on(PlayerDeath) fn on_death(p: Player) {
|
|
1724
|
+
raw("scoreboard objectives add ev_obj dummy");
|
|
1725
|
+
scoreboard_add(p, "ev_obj", 100)
|
|
1726
|
+
}
|
|
1727
|
+
`
|
|
1728
|
+
|
|
1729
|
+
// Compile with events.mcrs as library source
|
|
1730
|
+
fs.mkdirSync(DATAPACK_DIR, { recursive: true })
|
|
1731
|
+
if (!fs.existsSync(path.join(DATAPACK_DIR, 'pack.mcmeta'))) {
|
|
1732
|
+
fs.writeFileSync(path.join(DATAPACK_DIR, 'pack.mcmeta'), JSON.stringify({
|
|
1733
|
+
pack: { pack_format: 48, description: 'RedScript integration tests' }
|
|
1734
|
+
}))
|
|
1735
|
+
}
|
|
1736
|
+
const evResult = compile(evSrc, { namespace: NS, librarySources: [EVENTS_SRC] })
|
|
1737
|
+
for (const file of evResult.files) {
|
|
1738
|
+
if (file.path === 'pack.mcmeta') continue
|
|
1739
|
+
const filePath = path.join(DATAPACK_DIR, file.path)
|
|
1740
|
+
fs.mkdirSync(path.dirname(filePath), { recursive: true })
|
|
1741
|
+
if (file.path.includes('data/minecraft/tags/') && fs.existsSync(filePath)) {
|
|
1742
|
+
const existing = JSON.parse(fs.readFileSync(filePath, 'utf-8'))
|
|
1743
|
+
const incoming = JSON.parse(file.content)
|
|
1744
|
+
const merged = { values: [...new Set([...(existing.values ?? []), ...(incoming.values ?? [])])] }
|
|
1745
|
+
fs.writeFileSync(filePath, JSON.stringify(merged, null, 2))
|
|
1746
|
+
} else {
|
|
1747
|
+
fs.writeFileSync(filePath, file.content)
|
|
1748
|
+
}
|
|
1749
|
+
}
|
|
1750
|
+
|
|
1751
|
+
await mc.reload()
|
|
1752
|
+
await mc.ticks(20)
|
|
1753
|
+
|
|
1754
|
+
// Check if TestBot is online
|
|
1755
|
+
const status = await mc.status()
|
|
1756
|
+
botOnline = status.playerNames?.includes('TestBot') ?? false
|
|
1757
|
+
})
|
|
1758
|
+
|
|
1759
|
+
test('events.mcrs dispatcher loads without error', async () => {
|
|
1760
|
+
if (!serverOnline) return
|
|
1761
|
+
// If we got here, reload succeeded
|
|
1762
|
+
expect(serverOnline).toBe(true)
|
|
1763
|
+
}, 10000)
|
|
1764
|
+
|
|
1765
|
+
test('PlayerJoin: removing rs.joined tag fires @on(PlayerJoin) handlers', async () => {
|
|
1766
|
+
if (!serverOnline || !botOnline) return
|
|
1767
|
+
|
|
1768
|
+
// Reset score
|
|
1769
|
+
await mc.command(`scoreboard objectives add ev_obj dummy`).catch(() => {})
|
|
1770
|
+
await mc.command(`scoreboard players set TestBot ev_obj 0`)
|
|
1771
|
+
|
|
1772
|
+
// Simulate "join" by removing the rs.joined tag
|
|
1773
|
+
await mc.command(`tag TestBot remove rs.joined`)
|
|
1774
|
+
await mc.ticks(3) // wait for @tick to fire
|
|
1775
|
+
|
|
1776
|
+
const score = await mc.scoreboard('TestBot', 'ev_obj')
|
|
1777
|
+
expect(score).toBeGreaterThanOrEqual(1)
|
|
1778
|
+
console.log(` PlayerJoin handler fired: ev_obj = ${score} (expect >= 1) ✓`)
|
|
1779
|
+
}, 20000)
|
|
1780
|
+
|
|
1781
|
+
test('PlayerDeath: killing TestBot fires @on(PlayerDeath) handlers', async () => {
|
|
1782
|
+
if (!serverOnline || !botOnline) return
|
|
1783
|
+
|
|
1784
|
+
await mc.command(`scoreboard players set TestBot ev_obj 0`)
|
|
1785
|
+
await mc.command(`kill TestBot`)
|
|
1786
|
+
await mc.ticks(5)
|
|
1787
|
+
|
|
1788
|
+
const score = await mc.scoreboard('TestBot', 'ev_obj')
|
|
1789
|
+
expect(score).toBeGreaterThanOrEqual(100)
|
|
1790
|
+
console.log(` PlayerDeath handler fired: ev_obj = ${score} (expect >= 100) ✓`)
|
|
1791
|
+
}, 20000)
|
|
1792
|
+
})
|