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
package/src/mir/lower.ts
CHANGED
|
@@ -121,7 +121,7 @@ class FnContext {
|
|
|
121
121
|
/** Tuple variable tracking: varName → array of element temps (index = slot) */
|
|
122
122
|
readonly tupleVars = new Map<string, Temp[]>()
|
|
123
123
|
/** Array variable tracking: varName → { ns, pathPrefix } for NBT-backed int[] */
|
|
124
|
-
readonly arrayVars = new Map<string, { ns: string; pathPrefix: string }>()
|
|
124
|
+
readonly arrayVars = new Map<string, { ns: string; pathPrefix: string; knownLen?: number }>()
|
|
125
125
|
/** Macro function info for all functions in the module */
|
|
126
126
|
readonly macroInfo: Map<string, MacroFunctionInfo>
|
|
127
127
|
/** Function parameter info for call_macro generation */
|
|
@@ -138,6 +138,11 @@ class FnContext {
|
|
|
138
138
|
readonly timerCounter: { count: number; timerId: number }
|
|
139
139
|
/** Tracks temps whose values are known compile-time constants (for Timer static ID propagation) */
|
|
140
140
|
readonly constTemps = new Map<Temp, number>()
|
|
141
|
+
/** Tracks temps that hold fixed (×10000 fixed-point) values — for mul/div scale correction */
|
|
142
|
+
readonly floatTemps = new Set<Temp>()
|
|
143
|
+
/** Tracks double variables: varName → NBT storage path (without "rs:d " prefix) */
|
|
144
|
+
readonly doubleVars = new Map<string, string>()
|
|
145
|
+
private doubleVarCount = 0
|
|
141
146
|
/** HIR function definitions for array-arg monomorphization */
|
|
142
147
|
hirFunctions: Map<string, HIRFunction> = new Map()
|
|
143
148
|
/** Shared registry of already-generated specialized (monomorphized) MIR functions */
|
|
@@ -226,6 +231,13 @@ class FnContext {
|
|
|
226
231
|
getFnName(): string {
|
|
227
232
|
return this.fnName
|
|
228
233
|
}
|
|
234
|
+
|
|
235
|
+
/** Allocate a unique NBT storage path for a double variable */
|
|
236
|
+
freshDoubleVar(varName: string): string {
|
|
237
|
+
const path = `${this.namespace}_${this.fnName}_${varName}_${this.doubleVarCount++}`
|
|
238
|
+
this.doubleVars.set(varName, path)
|
|
239
|
+
return path
|
|
240
|
+
}
|
|
229
241
|
}
|
|
230
242
|
|
|
231
243
|
// ---------------------------------------------------------------------------
|
|
@@ -266,13 +278,22 @@ function lowerFunction(
|
|
|
266
278
|
}
|
|
267
279
|
|
|
268
280
|
// Create temps for parameters, skipping array-type params that are pre-bound
|
|
281
|
+
// and double-type params (which are passed via NBT __dp<i> slots instead of scoreboard)
|
|
269
282
|
const params: { name: Temp; isMacroParam: boolean }[] = []
|
|
270
283
|
const scope = new Map<string, Temp>()
|
|
284
|
+
let doubleParamSlot = 0
|
|
271
285
|
fn.params.forEach((p) => {
|
|
272
286
|
if (p.type.kind === 'array' && arrayArgBindings?.has(p.name)) {
|
|
273
287
|
// Array param already bound via arrayVars; no scoreboard slot needed
|
|
274
288
|
return
|
|
275
289
|
}
|
|
290
|
+
if (p.type.kind === 'named' && p.type.name === 'double') {
|
|
291
|
+
// double param: passed via NBT storage rs:d __dp<i> instead of scoreboard
|
|
292
|
+
const path = `__dp${doubleParamSlot++}`
|
|
293
|
+
ctx.doubleVars.set(p.name, path)
|
|
294
|
+
// No scoreboard param slot; callee reads from rs:d __dp<i> via doubleVars
|
|
295
|
+
return
|
|
296
|
+
}
|
|
276
297
|
const t = ctx.freshTemp()
|
|
277
298
|
params.push({ name: t, isMacroParam: fnMacroInfo?.macroParams.has(p.name) ?? false })
|
|
278
299
|
scope.set(p.name, t)
|
|
@@ -334,18 +355,46 @@ function lowerImplMethod(
|
|
|
334
355
|
selfFields.set(fieldName, t)
|
|
335
356
|
}
|
|
336
357
|
ctx.structVars.set('self', { typeName, fields: selfFields })
|
|
337
|
-
// Remaining params (after self)
|
|
358
|
+
// Remaining params (after self) — struct params get one slot per field
|
|
338
359
|
for (let i = 1; i < method.params.length; i++) {
|
|
339
|
-
const
|
|
340
|
-
|
|
341
|
-
|
|
360
|
+
const p = method.params[i]
|
|
361
|
+
const paramTypeName = p.type.kind === 'named' ? p.type.name
|
|
362
|
+
: p.type.kind === 'struct' ? p.type.name : null
|
|
363
|
+
const paramFields = paramTypeName ? ctx.structDefs.get(paramTypeName) : null
|
|
364
|
+
if (paramFields && paramFields.length > 0) {
|
|
365
|
+
// Struct param: one slot per field, register as structVar
|
|
366
|
+
const paramFieldTemps = new Map<string, Temp>()
|
|
367
|
+
for (const fieldName of paramFields) {
|
|
368
|
+
const t = ctx.freshTemp()
|
|
369
|
+
params.push({ name: t, isMacroParam: false })
|
|
370
|
+
paramFieldTemps.set(fieldName, t)
|
|
371
|
+
}
|
|
372
|
+
ctx.structVars.set(p.name, { typeName: paramTypeName!, fields: paramFieldTemps })
|
|
373
|
+
} else {
|
|
374
|
+
const t = ctx.freshTemp()
|
|
375
|
+
params.push({ name: t, isMacroParam: false })
|
|
376
|
+
scope.set(p.name, t)
|
|
377
|
+
}
|
|
342
378
|
}
|
|
343
379
|
} else {
|
|
344
|
-
// Static method — regular params
|
|
380
|
+
// Static method — regular params (struct params get one slot per field)
|
|
345
381
|
for (const p of method.params) {
|
|
346
|
-
const
|
|
347
|
-
|
|
348
|
-
|
|
382
|
+
const paramTypeName = p.type.kind === 'named' ? p.type.name
|
|
383
|
+
: p.type.kind === 'struct' ? p.type.name : null
|
|
384
|
+
const paramFields = paramTypeName ? ctx.structDefs.get(paramTypeName) : null
|
|
385
|
+
if (paramFields && paramFields.length > 0) {
|
|
386
|
+
const paramFieldTemps = new Map<string, Temp>()
|
|
387
|
+
for (const fieldName of paramFields) {
|
|
388
|
+
const t = ctx.freshTemp()
|
|
389
|
+
params.push({ name: t, isMacroParam: false })
|
|
390
|
+
paramFieldTemps.set(fieldName, t)
|
|
391
|
+
}
|
|
392
|
+
ctx.structVars.set(p.name, { typeName: paramTypeName!, fields: paramFieldTemps })
|
|
393
|
+
} else {
|
|
394
|
+
const t = ctx.freshTemp()
|
|
395
|
+
params.push({ name: t, isMacroParam: false })
|
|
396
|
+
scope.set(p.name, t)
|
|
397
|
+
}
|
|
349
398
|
}
|
|
350
399
|
}
|
|
351
400
|
|
|
@@ -466,10 +515,29 @@ function lowerStmt(
|
|
|
466
515
|
const typeName = (stmt.type?.kind === 'struct') ? stmt.type.name : '__anon'
|
|
467
516
|
const fieldTemps = new Map<string, Temp>()
|
|
468
517
|
for (const field of stmt.init.fields) {
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
518
|
+
if (field.value.kind === 'struct_lit') {
|
|
519
|
+
// Nested struct literal: register it as a synthetic var "${parentName}.${fieldName}"
|
|
520
|
+
// so that chained access like r.pos.x can be resolved
|
|
521
|
+
const nestedVarName = `${stmt.name}.${field.name}`
|
|
522
|
+
const nestedTypeName = '__anon'
|
|
523
|
+
const nestedFieldTemps = new Map<string, Temp>()
|
|
524
|
+
for (const nestedField of field.value.fields) {
|
|
525
|
+
const nval = lowerExpr(nestedField.value, ctx, scope)
|
|
526
|
+
const nt = ctx.freshTemp()
|
|
527
|
+
ctx.emit({ kind: 'copy', dst: nt, src: nval })
|
|
528
|
+
nestedFieldTemps.set(nestedField.name, nt)
|
|
529
|
+
}
|
|
530
|
+
ctx.structVars.set(nestedVarName, { typeName: nestedTypeName, fields: nestedFieldTemps })
|
|
531
|
+
// Store a placeholder temp (0) for the field itself in the parent struct
|
|
532
|
+
const t = ctx.freshTemp()
|
|
533
|
+
ctx.emit({ kind: 'const', dst: t, value: 0 })
|
|
534
|
+
fieldTemps.set(field.name, t)
|
|
535
|
+
} else {
|
|
536
|
+
const val = lowerExpr(field.value, ctx, scope)
|
|
537
|
+
const t = ctx.freshTemp()
|
|
538
|
+
ctx.emit({ kind: 'copy', dst: t, src: val })
|
|
539
|
+
fieldTemps.set(field.name, t)
|
|
540
|
+
}
|
|
473
541
|
}
|
|
474
542
|
ctx.structVars.set(stmt.name, { typeName, fields: fieldTemps })
|
|
475
543
|
} else if (stmt.type?.kind === 'option') {
|
|
@@ -506,11 +574,30 @@ function lowerStmt(
|
|
|
506
574
|
ctx.emit({ kind: 'copy', dst: t, src: valOp })
|
|
507
575
|
scope.set(stmt.name, t)
|
|
508
576
|
}
|
|
577
|
+
} else if (stmt.type?.kind === 'named' && stmt.type.name === 'double') {
|
|
578
|
+
// double variable: store in NBT storage rs:d
|
|
579
|
+
const path = ctx.freshDoubleVar(stmt.name)
|
|
580
|
+
const ns = ctx.getNamespace()
|
|
581
|
+
if (stmt.init.kind === 'double_lit') {
|
|
582
|
+
// Store the double literal directly into NBT
|
|
583
|
+
ctx.emit({ kind: 'call', dst: null, fn: `__raw:data modify storage rs:d ${path} set value ${stmt.init.value}d`, args: [] })
|
|
584
|
+
} else {
|
|
585
|
+
// Lower init as fixed (×10000) then convert to double in NBT
|
|
586
|
+
const initOp = lowerExpr(stmt.init, ctx, scope)
|
|
587
|
+
const initTemp = ctx.freshTemp()
|
|
588
|
+
ctx.emit({ kind: 'copy', dst: initTemp, src: initOp })
|
|
589
|
+
// execute store result storage rs:d <path> double 0.0001 run scoreboard players get $<t> __<ns>
|
|
590
|
+
ctx.emit({ kind: 'call', dst: null, fn: `__raw:execute store result storage rs:d ${path} double 0.0001 run scoreboard players get $${initTemp} __${ns}`, args: [] })
|
|
591
|
+
}
|
|
592
|
+
// Store a placeholder temp in scope (value = 0, not used directly for reads)
|
|
593
|
+
const t = ctx.freshTemp()
|
|
594
|
+
ctx.emit({ kind: 'const', dst: t, value: 0 })
|
|
595
|
+
scope.set(stmt.name, t)
|
|
509
596
|
} else if (stmt.init.kind === 'array_lit') {
|
|
510
597
|
// Array literal: write to NBT storage, track the var for index access
|
|
511
598
|
const ns = `${ctx.getNamespace()}:arrays`
|
|
512
599
|
const pathPrefix = stmt.name
|
|
513
|
-
ctx.arrayVars.set(stmt.name, { ns, pathPrefix })
|
|
600
|
+
ctx.arrayVars.set(stmt.name, { ns, pathPrefix, knownLen: stmt.init.elements.length })
|
|
514
601
|
const elems = stmt.init.elements
|
|
515
602
|
// Check if all elements are pure integer literals (no side-effects)
|
|
516
603
|
const allConst = elems.every(e => e.kind === 'int_lit')
|
|
@@ -519,25 +606,49 @@ function lowerStmt(
|
|
|
519
606
|
const vals = elems.map(e => (e as { kind: 'int_lit'; value: number }).value).join(', ')
|
|
520
607
|
ctx.emit({ kind: 'call', dst: null, fn: `__raw:data modify storage ${ns} ${pathPrefix} set value [${vals}]`, args: [] })
|
|
521
608
|
} else {
|
|
522
|
-
// Initialize with
|
|
523
|
-
|
|
524
|
-
|
|
609
|
+
// Initialize with known int_lit values (0 for dynamic slots), then overwrite dynamic elements.
|
|
610
|
+
// Using actual int_lit values avoids a bug where non-zero literals (e.g. 10000) would be
|
|
611
|
+
// left as 0 because the nbt_write for pure int_lits was skipped.
|
|
612
|
+
const initVals = elems.map(e => (e.kind === 'int_lit' ? String(e.value) : '0')).join(', ')
|
|
613
|
+
ctx.emit({ kind: 'call', dst: null, fn: `__raw:data modify storage ${ns} ${pathPrefix} set value [${initVals}]`, args: [] })
|
|
525
614
|
for (let i = 0; i < elems.length; i++) {
|
|
615
|
+
if (elems[i].kind === 'int_lit') continue // already in the init array
|
|
526
616
|
const elemOp = lowerExpr(elems[i], ctx, scope)
|
|
527
|
-
|
|
528
|
-
ctx.emit({ kind: 'nbt_write', ns, path: `${pathPrefix}[${i}]`, type: 'int', scale: 1, src: elemOp })
|
|
529
|
-
}
|
|
617
|
+
ctx.emit({ kind: 'nbt_write', ns, path: `${pathPrefix}[${i}]`, type: 'int', scale: 1, src: elemOp })
|
|
530
618
|
}
|
|
531
619
|
}
|
|
532
620
|
// Store array length as a temp in scope (for .len access)
|
|
533
621
|
const lenTemp = ctx.freshTemp()
|
|
534
622
|
ctx.emit({ kind: 'const', dst: lenTemp, value: elems.length })
|
|
535
623
|
scope.set(stmt.name, lenTemp)
|
|
624
|
+
} else if (stmt.type?.kind === 'array') {
|
|
625
|
+
// int[] variable initialized from a function call (e.g. let h: int[] = heap_new())
|
|
626
|
+
// Register as arrayVar so h[i] / h.push(v) / monomorphization all work correctly.
|
|
627
|
+
// The call returns the array in the caller's own NBT path (same ns:arrays/<name>).
|
|
628
|
+
const ns = `${ctx.getNamespace()}:arrays`
|
|
629
|
+
const pathPrefix = stmt.name
|
|
630
|
+
ctx.arrayVars.set(stmt.name, { ns, pathPrefix })
|
|
631
|
+
// Evaluate the init expression (e.g. heap_new() or some function call)
|
|
632
|
+
lowerExpr(stmt.init, ctx, scope)
|
|
633
|
+
// After the call, copy the NBT array from the return path into our own path.
|
|
634
|
+
// By convention array-returning functions write into ns:arrays/<ret> or a __ret path.
|
|
635
|
+
// Here we use 'data modify ... set from storage ns:arrays __ret_array' pattern,
|
|
636
|
+
// but since we don't have a unified return convention for arrays, we rely on
|
|
637
|
+
// monomorphization: the first time heap_push(h, val) is called with h in arrayVars,
|
|
638
|
+
// it will monomorphize correctly.
|
|
639
|
+
// Store a length temp so .length() works.
|
|
640
|
+
const lenTemp = ctx.freshTemp()
|
|
641
|
+
ctx.emit({ kind: 'const', dst: lenTemp, value: 0 })
|
|
642
|
+
scope.set(stmt.name, lenTemp)
|
|
536
643
|
} else {
|
|
537
644
|
const valOp = lowerExpr(stmt.init, ctx, scope)
|
|
538
645
|
const t = ctx.freshTemp()
|
|
539
646
|
ctx.emit({ kind: 'copy', dst: t, src: valOp })
|
|
540
647
|
scope.set(stmt.name, t)
|
|
648
|
+
// Track fixed-typed temps for mul/div scale correction
|
|
649
|
+
if (stmt.type?.kind === 'named' && (stmt.type.name === 'fixed' || stmt.type.name === 'float')) {
|
|
650
|
+
ctx.floatTemps.add(t)
|
|
651
|
+
}
|
|
541
652
|
}
|
|
542
653
|
break
|
|
543
654
|
}
|
|
@@ -800,67 +911,142 @@ function lowerStmt(
|
|
|
800
911
|
|
|
801
912
|
case 'match': {
|
|
802
913
|
// Lower match as chained if/else
|
|
803
|
-
const matchVal = lowerExpr(stmt.expr, ctx, scope)
|
|
804
914
|
const mergeBlock = ctx.newBlock('match_merge')
|
|
805
915
|
|
|
916
|
+
// Determine if any arm uses Option patterns (PatSome / PatNone).
|
|
917
|
+
// If so, resolve the Option has/val slots from the subject ident.
|
|
918
|
+
const hasOptionPats = stmt.arms.some(a =>
|
|
919
|
+
a.pattern.kind === 'PatSome' || a.pattern.kind === 'PatNone'
|
|
920
|
+
)
|
|
921
|
+
|
|
922
|
+
// For Option match: resolve has/val temps from subject (must be an ident)
|
|
923
|
+
let optHasOp: Operand | undefined
|
|
924
|
+
let optValTemp: string | undefined
|
|
925
|
+
if (hasOptionPats) {
|
|
926
|
+
if (stmt.expr.kind === 'ident') {
|
|
927
|
+
const sv = ctx.structVars.get(stmt.expr.name)
|
|
928
|
+
if (sv && sv.typeName === '__option') {
|
|
929
|
+
optHasOp = { kind: 'temp', name: sv.fields.get('has')! }
|
|
930
|
+
optValTemp = sv.fields.get('val')!
|
|
931
|
+
} else {
|
|
932
|
+
// Fall back: evaluate and use __rf_has/__rf_val convention
|
|
933
|
+
lowerExpr(stmt.expr, ctx, scope)
|
|
934
|
+
const hasT = ctx.freshTemp()
|
|
935
|
+
const valT = ctx.freshTemp()
|
|
936
|
+
ctx.emit({ kind: 'copy', dst: hasT, src: { kind: 'temp', name: '__rf_has' } })
|
|
937
|
+
ctx.emit({ kind: 'copy', dst: valT, src: { kind: 'temp', name: '__rf_val' } })
|
|
938
|
+
optHasOp = { kind: 'temp', name: hasT }
|
|
939
|
+
optValTemp = valT
|
|
940
|
+
}
|
|
941
|
+
} else {
|
|
942
|
+
lowerExpr(stmt.expr, ctx, scope)
|
|
943
|
+
const hasT = ctx.freshTemp()
|
|
944
|
+
const valT = ctx.freshTemp()
|
|
945
|
+
ctx.emit({ kind: 'copy', dst: hasT, src: { kind: 'temp', name: '__rf_has' } })
|
|
946
|
+
ctx.emit({ kind: 'copy', dst: valT, src: { kind: 'temp', name: '__rf_val' } })
|
|
947
|
+
optHasOp = { kind: 'temp', name: hasT }
|
|
948
|
+
optValTemp = valT
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
// For non-option match, evaluate the subject once
|
|
953
|
+
const matchVal: Operand = hasOptionPats
|
|
954
|
+
? optHasOp! // unused for non-option path
|
|
955
|
+
: lowerExpr(stmt.expr, ctx, scope)
|
|
956
|
+
|
|
806
957
|
for (let i = 0; i < stmt.arms.length; i++) {
|
|
807
958
|
const arm = stmt.arms[i]
|
|
808
|
-
|
|
809
|
-
|
|
959
|
+
const pat = arm.pattern
|
|
960
|
+
|
|
961
|
+
if (pat.kind === 'PatWild') {
|
|
962
|
+
// Wildcard/default arm — always matches
|
|
810
963
|
lowerBlock(arm.body, ctx, new Map(scope))
|
|
811
964
|
if (isPlaceholderTerm(ctx.current().term)) {
|
|
812
965
|
ctx.terminate({ kind: 'jump', target: mergeBlock.id })
|
|
813
966
|
}
|
|
814
|
-
} else if (
|
|
815
|
-
//
|
|
816
|
-
const
|
|
967
|
+
} else if (pat.kind === 'PatNone') {
|
|
968
|
+
// None arm: optHasOp == 0
|
|
969
|
+
const cmpTemp = ctx.freshTemp()
|
|
970
|
+
ctx.emit({ kind: 'cmp', dst: cmpTemp, op: 'eq', a: optHasOp!, b: { kind: 'const', value: 0 } })
|
|
817
971
|
const armBody = ctx.newBlock('match_arm')
|
|
818
972
|
const nextArm = ctx.newBlock('match_next')
|
|
819
|
-
|
|
820
|
-
// Chain checks: if min defined, check matchVal >= min; if max defined, check matchVal <= max
|
|
821
|
-
// Each failed check jumps to nextArm
|
|
822
|
-
const checks: Array<{ op: 'ge' | 'le'; bound: number }> = []
|
|
823
|
-
if (range.min !== undefined) checks.push({ op: 'ge', bound: range.min })
|
|
824
|
-
if (range.max !== undefined) checks.push({ op: 'le', bound: range.max })
|
|
825
|
-
|
|
826
|
-
if (checks.length === 0) {
|
|
827
|
-
// Open range — always matches
|
|
828
|
-
ctx.terminate({ kind: 'jump', target: armBody.id })
|
|
829
|
-
} else {
|
|
830
|
-
// Emit checks sequentially; each check passes → continue to next or armBody
|
|
831
|
-
for (let ci = 0; ci < checks.length; ci++) {
|
|
832
|
-
const { op, bound } = checks[ci]
|
|
833
|
-
const cmpTemp = ctx.freshTemp()
|
|
834
|
-
ctx.emit({ kind: 'cmp', dst: cmpTemp, op, a: matchVal, b: { kind: 'const', value: bound } })
|
|
835
|
-
const passBlock = ci === checks.length - 1 ? armBody : ctx.newBlock('match_range_check')
|
|
836
|
-
ctx.terminate({ kind: 'branch', cond: { kind: 'temp', name: cmpTemp }, then: passBlock.id, else: nextArm.id })
|
|
837
|
-
if (ci < checks.length - 1) ctx.switchTo(passBlock)
|
|
838
|
-
}
|
|
839
|
-
}
|
|
840
|
-
|
|
973
|
+
ctx.terminate({ kind: 'branch', cond: { kind: 'temp', name: cmpTemp }, then: armBody.id, else: nextArm.id })
|
|
841
974
|
ctx.switchTo(armBody)
|
|
842
975
|
lowerBlock(arm.body, ctx, new Map(scope))
|
|
843
976
|
if (isPlaceholderTerm(ctx.current().term)) {
|
|
844
977
|
ctx.terminate({ kind: 'jump', target: mergeBlock.id })
|
|
845
978
|
}
|
|
846
|
-
|
|
847
979
|
ctx.switchTo(nextArm)
|
|
848
|
-
} else {
|
|
849
|
-
|
|
980
|
+
} else if (pat.kind === 'PatSome') {
|
|
981
|
+
// Some(x) arm: optHasOp == 1, bind x = optValTemp
|
|
850
982
|
const cmpTemp = ctx.freshTemp()
|
|
851
|
-
ctx.emit({ kind: 'cmp', dst: cmpTemp, op: 'eq', a:
|
|
852
|
-
|
|
983
|
+
ctx.emit({ kind: 'cmp', dst: cmpTemp, op: 'eq', a: optHasOp!, b: { kind: 'const', value: 1 } })
|
|
984
|
+
const armBody = ctx.newBlock('match_arm')
|
|
985
|
+
const nextArm = ctx.newBlock('match_next')
|
|
986
|
+
ctx.terminate({ kind: 'branch', cond: { kind: 'temp', name: cmpTemp }, then: armBody.id, else: nextArm.id })
|
|
987
|
+
ctx.switchTo(armBody)
|
|
988
|
+
const armScope = new Map(scope)
|
|
989
|
+
// Bind the pattern variable to the option value temp
|
|
990
|
+
if (optValTemp) armScope.set(pat.binding, optValTemp)
|
|
991
|
+
lowerBlock(arm.body, ctx, armScope)
|
|
992
|
+
if (isPlaceholderTerm(ctx.current().term)) {
|
|
993
|
+
ctx.terminate({ kind: 'jump', target: mergeBlock.id })
|
|
994
|
+
}
|
|
995
|
+
ctx.switchTo(nextArm)
|
|
996
|
+
} else if (pat.kind === 'PatInt') {
|
|
997
|
+
const cmpTemp = ctx.freshTemp()
|
|
998
|
+
ctx.emit({ kind: 'cmp', dst: cmpTemp, op: 'eq', a: matchVal, b: { kind: 'const', value: pat.value } })
|
|
853
999
|
const armBody = ctx.newBlock('match_arm')
|
|
854
1000
|
const nextArm = ctx.newBlock('match_next')
|
|
855
1001
|
ctx.terminate({ kind: 'branch', cond: { kind: 'temp', name: cmpTemp }, then: armBody.id, else: nextArm.id })
|
|
856
|
-
|
|
857
1002
|
ctx.switchTo(armBody)
|
|
858
1003
|
lowerBlock(arm.body, ctx, new Map(scope))
|
|
859
1004
|
if (isPlaceholderTerm(ctx.current().term)) {
|
|
860
1005
|
ctx.terminate({ kind: 'jump', target: mergeBlock.id })
|
|
861
1006
|
}
|
|
862
|
-
|
|
863
1007
|
ctx.switchTo(nextArm)
|
|
1008
|
+
} else if (pat.kind === 'PatExpr') {
|
|
1009
|
+
// Legacy: range_lit or other expression
|
|
1010
|
+
const expr = pat.expr
|
|
1011
|
+
if (expr.kind === 'range_lit') {
|
|
1012
|
+
const range = expr.range
|
|
1013
|
+
const armBody = ctx.newBlock('match_arm')
|
|
1014
|
+
const nextArm = ctx.newBlock('match_next')
|
|
1015
|
+
const checks: Array<{ op: 'ge' | 'le'; bound: number }> = []
|
|
1016
|
+
if (range.min !== undefined) checks.push({ op: 'ge', bound: range.min })
|
|
1017
|
+
if (range.max !== undefined) checks.push({ op: 'le', bound: range.max })
|
|
1018
|
+
if (checks.length === 0) {
|
|
1019
|
+
ctx.terminate({ kind: 'jump', target: armBody.id })
|
|
1020
|
+
} else {
|
|
1021
|
+
for (let ci = 0; ci < checks.length; ci++) {
|
|
1022
|
+
const { op, bound } = checks[ci]
|
|
1023
|
+
const cmpTemp = ctx.freshTemp()
|
|
1024
|
+
ctx.emit({ kind: 'cmp', dst: cmpTemp, op, a: matchVal, b: { kind: 'const', value: bound } })
|
|
1025
|
+
const passBlock = ci === checks.length - 1 ? armBody : ctx.newBlock('match_range_check')
|
|
1026
|
+
ctx.terminate({ kind: 'branch', cond: { kind: 'temp', name: cmpTemp }, then: passBlock.id, else: nextArm.id })
|
|
1027
|
+
if (ci < checks.length - 1) ctx.switchTo(passBlock)
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
ctx.switchTo(armBody)
|
|
1031
|
+
lowerBlock(arm.body, ctx, new Map(scope))
|
|
1032
|
+
if (isPlaceholderTerm(ctx.current().term)) {
|
|
1033
|
+
ctx.terminate({ kind: 'jump', target: mergeBlock.id })
|
|
1034
|
+
}
|
|
1035
|
+
ctx.switchTo(nextArm)
|
|
1036
|
+
} else {
|
|
1037
|
+
const patOp = lowerExpr(expr, ctx, scope)
|
|
1038
|
+
const cmpTemp = ctx.freshTemp()
|
|
1039
|
+
ctx.emit({ kind: 'cmp', dst: cmpTemp, op: 'eq', a: matchVal, b: patOp })
|
|
1040
|
+
const armBody = ctx.newBlock('match_arm')
|
|
1041
|
+
const nextArm = ctx.newBlock('match_next')
|
|
1042
|
+
ctx.terminate({ kind: 'branch', cond: { kind: 'temp', name: cmpTemp }, then: armBody.id, else: nextArm.id })
|
|
1043
|
+
ctx.switchTo(armBody)
|
|
1044
|
+
lowerBlock(arm.body, ctx, new Map(scope))
|
|
1045
|
+
if (isPlaceholderTerm(ctx.current().term)) {
|
|
1046
|
+
ctx.terminate({ kind: 'jump', target: mergeBlock.id })
|
|
1047
|
+
}
|
|
1048
|
+
ctx.switchTo(nextArm)
|
|
1049
|
+
}
|
|
864
1050
|
}
|
|
865
1051
|
}
|
|
866
1052
|
|
|
@@ -875,8 +1061,13 @@ function lowerStmt(
|
|
|
875
1061
|
|
|
876
1062
|
case 'raw': {
|
|
877
1063
|
// Raw commands are opaque at MIR level — emit as a call to a synthetic raw function
|
|
878
|
-
//
|
|
879
|
-
|
|
1064
|
+
// __NS__ is replaced with the current namespace so stdlib can reference self-functions.
|
|
1065
|
+
// __OBJ__ is replaced with the scoreboard objective (__<namespace>).
|
|
1066
|
+
const ns = ctx.getNamespace()
|
|
1067
|
+
const rawCmd = stmt.cmd
|
|
1068
|
+
.replace(/__NS__/g, ns)
|
|
1069
|
+
.replace(/__OBJ__/g, `__${ns}`)
|
|
1070
|
+
ctx.emit({ kind: 'call', dst: null, fn: `__raw:${rawCmd}`, args: [] })
|
|
880
1071
|
break
|
|
881
1072
|
}
|
|
882
1073
|
|
|
@@ -956,15 +1147,24 @@ function lowerExpr(
|
|
|
956
1147
|
return { kind: 'const', value: expr.value }
|
|
957
1148
|
|
|
958
1149
|
case 'float_lit':
|
|
959
|
-
//
|
|
960
|
-
return { kind: 'const', value: expr.value }
|
|
1150
|
+
// fixed is ×10000 fixed-point in RedScript
|
|
1151
|
+
return { kind: 'const', value: Math.round(expr.value * 10000) }
|
|
961
1152
|
|
|
962
1153
|
case 'byte_lit':
|
|
963
1154
|
case 'short_lit':
|
|
964
1155
|
case 'long_lit':
|
|
965
|
-
case 'double_lit':
|
|
966
1156
|
return { kind: 'const', value: expr.value }
|
|
967
1157
|
|
|
1158
|
+
case 'double_lit': {
|
|
1159
|
+
// Store as NBT double, return as ×10000 fixed score
|
|
1160
|
+
const path = ctx.freshDoubleVar(`dlit`)
|
|
1161
|
+
ctx.emit({ kind: 'call', dst: null, fn: `__raw:data modify storage rs:d ${path} set value ${expr.value}d`, args: [] })
|
|
1162
|
+
const t = ctx.freshTemp()
|
|
1163
|
+
ctx.emit({ kind: 'nbt_read', dst: t, ns: 'rs:d', path, scale: 10000.0 })
|
|
1164
|
+
ctx.floatTemps.add(t)
|
|
1165
|
+
return { kind: 'temp', name: t }
|
|
1166
|
+
}
|
|
1167
|
+
|
|
968
1168
|
case 'bool_lit': {
|
|
969
1169
|
return { kind: 'const', value: expr.value ? 1 : 0 }
|
|
970
1170
|
}
|
|
@@ -1001,6 +1201,16 @@ function lowerExpr(
|
|
|
1001
1201
|
}
|
|
1002
1202
|
|
|
1003
1203
|
case 'ident': {
|
|
1204
|
+
// If this is a double variable, load it as ×10000 fixed into a fresh temp
|
|
1205
|
+
if (ctx.doubleVars.has(expr.name)) {
|
|
1206
|
+
const path = ctx.doubleVars.get(expr.name)!
|
|
1207
|
+
const t = ctx.freshTemp()
|
|
1208
|
+
// Load double NBT as ×10000 fixed-point score via nbt_read (LIR renames dst properly)
|
|
1209
|
+
ctx.emit({ kind: 'nbt_read', dst: t, ns: 'rs:d', path, scale: 10000.0 })
|
|
1210
|
+
// Mark as fixed (×10000) so arithmetic scale correction applies
|
|
1211
|
+
ctx.floatTemps.add(t)
|
|
1212
|
+
return { kind: 'temp', name: t }
|
|
1213
|
+
}
|
|
1004
1214
|
const temp = scope.get(expr.name)
|
|
1005
1215
|
if (temp) return { kind: 'temp', name: temp }
|
|
1006
1216
|
// Unresolved ident — could be a global or external reference
|
|
@@ -1019,6 +1229,31 @@ function lowerExpr(
|
|
|
1019
1229
|
return lowerShortCircuitOr(expr, ctx, scope)
|
|
1020
1230
|
}
|
|
1021
1231
|
|
|
1232
|
+
// Double arithmetic intrinsics: double op double → call math_hp:double_add/sub/mul/div
|
|
1233
|
+
const doubleArithOps: Record<string, string> = {
|
|
1234
|
+
'+': 'math_hp:double_add',
|
|
1235
|
+
'-': 'math_hp:double_sub',
|
|
1236
|
+
'*': 'math_hp:double_mul',
|
|
1237
|
+
'/': 'math_hp:double_div',
|
|
1238
|
+
}
|
|
1239
|
+
if (expr.op in doubleArithOps && isDoubleExpr(expr.left, ctx) && isDoubleExpr(expr.right, ctx)) {
|
|
1240
|
+
const ns = ctx.getNamespace()
|
|
1241
|
+
const leftPath = lowerDoubleExprToPath(expr.left, ctx, scope)
|
|
1242
|
+
const rightPath = lowerDoubleExprToPath(expr.right, ctx, scope)
|
|
1243
|
+
// Copy operands into __dp0 and __dp1 (intrinsic calling convention)
|
|
1244
|
+
ctx.emit({ kind: 'call', dst: null, fn: `__raw:data modify storage rs:d __dp0 set from storage rs:d ${leftPath}`, args: [] })
|
|
1245
|
+
ctx.emit({ kind: 'call', dst: null, fn: `__raw:data modify storage rs:d __dp1 set from storage rs:d ${rightPath}`, args: [] })
|
|
1246
|
+
// Call the intrinsic
|
|
1247
|
+
ctx.emit({ kind: 'call', dst: null, fn: `__raw:function ${doubleArithOps[expr.op]}`, args: [] })
|
|
1248
|
+
// Result is in rs:d __dp0 — register as a new double var and read back as ×10000 fixed
|
|
1249
|
+
const resultPath = ctx.freshDoubleVar('dres')
|
|
1250
|
+
ctx.emit({ kind: 'call', dst: null, fn: `__raw:data modify storage rs:d ${resultPath} set from storage rs:d __dp0`, args: [] })
|
|
1251
|
+
const t = ctx.freshTemp()
|
|
1252
|
+
ctx.emit({ kind: 'nbt_read', dst: t, ns: 'rs:d', path: resultPath, scale: 10000.0 })
|
|
1253
|
+
ctx.floatTemps.add(t)
|
|
1254
|
+
return { kind: 'temp', name: t }
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1022
1257
|
const left = lowerExpr(expr.left, ctx, scope)
|
|
1023
1258
|
const right = lowerExpr(expr.right, ctx, scope)
|
|
1024
1259
|
const t = ctx.freshTemp()
|
|
@@ -1032,7 +1267,31 @@ function lowerExpr(
|
|
|
1032
1267
|
}
|
|
1033
1268
|
|
|
1034
1269
|
if (expr.op in arithmeticOps) {
|
|
1035
|
-
|
|
1270
|
+
const isFloatLeft = left.kind === 'temp' && ctx.floatTemps.has(left.name)
|
|
1271
|
+
const isFloatRight = right.kind === 'temp' && ctx.floatTemps.has(right.name)
|
|
1272
|
+
if (expr.op === '*' && isFloatLeft && isFloatRight) {
|
|
1273
|
+
// fixed * fixed: result is ×100000000, divide by 10000 to restore ×10000 scale
|
|
1274
|
+
ctx.emit({ kind: 'mul', dst: t, a: left, b: right })
|
|
1275
|
+
const scaleTemp = ctx.freshTemp()
|
|
1276
|
+
ctx.emit({ kind: 'const', dst: scaleTemp, value: 10000 })
|
|
1277
|
+
const corrected = ctx.freshTemp()
|
|
1278
|
+
ctx.emit({ kind: 'div', dst: corrected, a: { kind: 'temp', name: t }, b: { kind: 'temp', name: scaleTemp } })
|
|
1279
|
+
ctx.floatTemps.add(corrected)
|
|
1280
|
+
return { kind: 'temp', name: corrected }
|
|
1281
|
+
} else if (expr.op === '/' && isFloatLeft && isFloatRight) {
|
|
1282
|
+
// fixed / fixed: pre-multiply dividend by 10000 to restore ×10000 scale
|
|
1283
|
+
const scaleTemp = ctx.freshTemp()
|
|
1284
|
+
ctx.emit({ kind: 'const', dst: scaleTemp, value: 10000 })
|
|
1285
|
+
const scaled = ctx.freshTemp()
|
|
1286
|
+
ctx.emit({ kind: 'mul', dst: scaled, a: left, b: { kind: 'temp', name: scaleTemp } })
|
|
1287
|
+
ctx.emit({ kind: 'div', dst: t, a: { kind: 'temp', name: scaled }, b: right })
|
|
1288
|
+
ctx.floatTemps.add(t)
|
|
1289
|
+
} else {
|
|
1290
|
+
ctx.emit({ kind: arithmeticOps[expr.op] as any, dst: t, a: left, b: right })
|
|
1291
|
+
if (isFloatLeft || isFloatRight) {
|
|
1292
|
+
ctx.floatTemps.add(t)
|
|
1293
|
+
}
|
|
1294
|
+
}
|
|
1036
1295
|
} else if (expr.op in cmpOps) {
|
|
1037
1296
|
ctx.emit({ kind: 'cmp', dst: t, op: cmpOps[expr.op], a: left, b: right })
|
|
1038
1297
|
} else {
|
|
@@ -1103,6 +1362,15 @@ function lowerExpr(
|
|
|
1103
1362
|
if (fieldTemp) return { kind: 'temp', name: fieldTemp }
|
|
1104
1363
|
}
|
|
1105
1364
|
}
|
|
1365
|
+
// Chained struct field access: v.pos.x → look up synthetic var "v.pos" in structVars
|
|
1366
|
+
if (expr.obj.kind === 'member' && expr.obj.obj.kind === 'ident') {
|
|
1367
|
+
const syntheticName = `${expr.obj.obj.name}.${expr.obj.field}`
|
|
1368
|
+
const nestedSv = ctx.structVars.get(syntheticName)
|
|
1369
|
+
if (nestedSv) {
|
|
1370
|
+
const fieldTemp = nestedSv.fields.get(expr.field)
|
|
1371
|
+
if (fieldTemp) return { kind: 'temp', name: fieldTemp }
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1106
1374
|
// Fallback: opaque
|
|
1107
1375
|
const obj = lowerExpr(expr.obj, ctx, scope)
|
|
1108
1376
|
const t = ctx.freshTemp()
|
|
@@ -1154,9 +1422,37 @@ function lowerExpr(
|
|
|
1154
1422
|
}
|
|
1155
1423
|
|
|
1156
1424
|
case 'call': {
|
|
1425
|
+
// Handle arr.len() — parser desugars obj.len() → call { fn: 'len', args: [obj] }
|
|
1426
|
+
if (expr.fn === 'len' && expr.args.length === 1 && expr.args[0].kind === 'ident') {
|
|
1427
|
+
const arrName = (expr.args[0] as { kind: 'ident'; name: string }).name
|
|
1428
|
+
const arrInfo = ctx.arrayVars.get(arrName)
|
|
1429
|
+
if (arrInfo) {
|
|
1430
|
+
if (arrInfo.knownLen !== undefined) {
|
|
1431
|
+
const t = ctx.freshTemp()
|
|
1432
|
+
ctx.emit({ kind: 'const', dst: t, value: arrInfo.knownLen })
|
|
1433
|
+
return { kind: 'temp', name: t }
|
|
1434
|
+
}
|
|
1435
|
+
// Dynamic array: read length at runtime via data get
|
|
1436
|
+
const t = ctx.freshTemp()
|
|
1437
|
+
ctx.emit({ kind: 'nbt_list_len', dst: t, ns: arrInfo.ns, path: arrInfo.pathPrefix })
|
|
1438
|
+
return { kind: 'temp', name: t }
|
|
1439
|
+
}
|
|
1440
|
+
// Also check scope (literal array length temp)
|
|
1441
|
+
const lenTemp = scope.get(arrName)
|
|
1442
|
+
if (lenTemp !== undefined) {
|
|
1443
|
+
return { kind: 'temp', name: lenTemp }
|
|
1444
|
+
}
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1157
1447
|
// Handle scoreboard_get / score — read from vanilla MC scoreboard
|
|
1158
1448
|
if (expr.fn === 'scoreboard_get' || expr.fn === 'score') {
|
|
1159
|
-
const
|
|
1449
|
+
const playerArg = exprToCommandArg(expr.args[0], ctx.currentMacroParams)
|
|
1450
|
+
// If the arg is a plain ident (Player variable, not a macro param), use @s —
|
|
1451
|
+
// event handlers are always called via `execute as <player> run function ...`
|
|
1452
|
+
// so @s correctly refers to the player in context.
|
|
1453
|
+
const player = (!playerArg.isMacro && expr.args[0].kind === 'ident')
|
|
1454
|
+
? '@s'
|
|
1455
|
+
: (playerArg.str || '@s')
|
|
1160
1456
|
const obj = hirExprToStringLiteral(expr.args[1])
|
|
1161
1457
|
const t = ctx.freshTemp()
|
|
1162
1458
|
ctx.emit({ kind: 'score_read', dst: t, player, obj })
|
|
@@ -1165,7 +1461,10 @@ function lowerExpr(
|
|
|
1165
1461
|
|
|
1166
1462
|
// Handle scoreboard_set — write to vanilla MC scoreboard
|
|
1167
1463
|
if (expr.fn === 'scoreboard_set') {
|
|
1168
|
-
const
|
|
1464
|
+
const playerArg = exprToCommandArg(expr.args[0], ctx.currentMacroParams)
|
|
1465
|
+
const player = (!playerArg.isMacro && expr.args[0].kind === 'ident')
|
|
1466
|
+
? '@s'
|
|
1467
|
+
: (playerArg.str || '@s')
|
|
1169
1468
|
const obj = hirExprToStringLiteral(expr.args[1])
|
|
1170
1469
|
const src = lowerExpr(expr.args[2], ctx, scope)
|
|
1171
1470
|
ctx.emit({ kind: 'score_write', player, obj, src })
|
|
@@ -1174,6 +1473,109 @@ function lowerExpr(
|
|
|
1174
1473
|
return { kind: 'temp', name: t }
|
|
1175
1474
|
}
|
|
1176
1475
|
|
|
1476
|
+
// Handle storage_set_array(storagePath, fieldName, nbtArrayLiteral)
|
|
1477
|
+
// Writes a literal NBT int array to data storage (used in @load for tables).
|
|
1478
|
+
// Emits: data modify storage <storagePath> <fieldName> set value <nbtArray>
|
|
1479
|
+
if (expr.fn === 'storage_set_array' && expr.args.length >= 3) {
|
|
1480
|
+
const storagePath = hirExprToStringLiteral(expr.args[0])
|
|
1481
|
+
const fieldName = hirExprToStringLiteral(expr.args[1])
|
|
1482
|
+
const nbtLiteral = hirExprToStringLiteral(expr.args[2])
|
|
1483
|
+
ctx.emit({ kind: 'call', dst: null, fn: `__raw:data modify storage ${storagePath} ${fieldName} set value ${nbtLiteral}`, args: [] })
|
|
1484
|
+
const t = ctx.freshTemp()
|
|
1485
|
+
ctx.emit({ kind: 'const', dst: t, value: 0 })
|
|
1486
|
+
return { kind: 'temp', name: t }
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
// Handle storage_get_int(storagePath, fieldName, index) → int
|
|
1490
|
+
// Reads one element from an NBT int-array stored in data storage.
|
|
1491
|
+
// Const index: execute store result score $dst run data get storage <ns> <field>[N] 1
|
|
1492
|
+
// Runtime index: nbt_read_dynamic via macro sub-function
|
|
1493
|
+
if (expr.fn === 'storage_get_int' && expr.args.length >= 3) {
|
|
1494
|
+
const storagePath = hirExprToStringLiteral(expr.args[0])
|
|
1495
|
+
const fieldName = hirExprToStringLiteral(expr.args[1])
|
|
1496
|
+
const indexOp = lowerExpr(expr.args[2], ctx, scope)
|
|
1497
|
+
const t = ctx.freshTemp()
|
|
1498
|
+
if (indexOp.kind === 'const') {
|
|
1499
|
+
ctx.emit({ kind: 'nbt_read', dst: t, ns: storagePath, path: `${fieldName}[${indexOp.value}]`, scale: 1 })
|
|
1500
|
+
} else {
|
|
1501
|
+
ctx.emit({ kind: 'nbt_read_dynamic', dst: t, ns: storagePath, pathPrefix: fieldName, indexSrc: indexOp })
|
|
1502
|
+
}
|
|
1503
|
+
return { kind: 'temp', name: t }
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
// Handle __entity_tag / __entity_untag — entity.tag("name") / entity.untag("name") sugar
|
|
1507
|
+
if (expr.fn === '__entity_tag' || expr.fn === '__entity_untag') {
|
|
1508
|
+
const selArg = expr.args[0]
|
|
1509
|
+
const tagArg = expr.args[1]
|
|
1510
|
+
const tagStr = tagArg.kind === 'str_lit' ? tagArg.value : 'unknown'
|
|
1511
|
+
const selStr = selArg.kind === 'selector'
|
|
1512
|
+
? selectorToString((selArg as any).sel ?? selArg)
|
|
1513
|
+
: '@s'
|
|
1514
|
+
const op = expr.fn === '__entity_tag' ? 'add' : 'remove'
|
|
1515
|
+
const t = ctx.freshTemp()
|
|
1516
|
+
ctx.emit({ kind: 'call', dst: null, fn: `__raw:tag ${selStr} ${op} ${tagStr}`, args: [] })
|
|
1517
|
+
ctx.emit({ kind: 'const', dst: t, value: 0 })
|
|
1518
|
+
return { kind: 'temp', name: t }
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
// Handle __entity_has_tag(entity, tag) — entity.has_tag("vip") sugar
|
|
1522
|
+
// Compiles to: execute store success score $ret __ns if entity <sel>[tag=<name>]
|
|
1523
|
+
// We use $ret as the store target so LIR's dst-copy mechanism picks it up.
|
|
1524
|
+
if (expr.fn === '__entity_has_tag') {
|
|
1525
|
+
const tagArg = expr.args[1]
|
|
1526
|
+
const tagStr = tagArg.kind === 'str_lit' ? tagArg.value : 'unknown'
|
|
1527
|
+
const selArg = expr.args[0]
|
|
1528
|
+
const selStr = selArg.kind === 'selector'
|
|
1529
|
+
? selectorToString((selArg as any).sel ?? selArg)
|
|
1530
|
+
: '@s'
|
|
1531
|
+
const t = ctx.freshTemp()
|
|
1532
|
+
const ns = ctx.getNamespace()
|
|
1533
|
+
// Store result in $ret — LIR will copy $ret → $t when dst=t
|
|
1534
|
+
ctx.emit({ kind: 'call', dst: t, fn: `__raw:execute store success score $ret __${ns} if entity ${selStr}[tag=${tagStr}]`, args: [] })
|
|
1535
|
+
return { kind: 'temp', name: t }
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
// Handle __array_push(arr, val) — h.push(val) sugar (parser desugars arr.push → __array_push)
|
|
1539
|
+
// Equivalent to list_push but uses the array's known NBT path directly.
|
|
1540
|
+
if (expr.fn === '__array_push') {
|
|
1541
|
+
if (expr.args[0].kind === 'ident') {
|
|
1542
|
+
const arrInfo = ctx.arrayVars.get((expr.args[0] as { kind: 'ident'; name: string }).name)
|
|
1543
|
+
if (arrInfo) {
|
|
1544
|
+
const valOp = lowerExpr(expr.args[1], ctx, scope)
|
|
1545
|
+
ctx.emit({ kind: 'call', dst: null, fn: `__raw:data modify storage ${arrInfo.ns} ${arrInfo.pathPrefix} append value 0`, args: [] })
|
|
1546
|
+
ctx.emit({ kind: 'nbt_write', ns: arrInfo.ns, path: `${arrInfo.pathPrefix}[-1]`, type: 'int', scale: 1, src: valOp })
|
|
1547
|
+
const t = ctx.freshTemp()
|
|
1548
|
+
ctx.emit({ kind: 'const', dst: t, value: 0 })
|
|
1549
|
+
return { kind: 'temp', name: t }
|
|
1550
|
+
}
|
|
1551
|
+
}
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
// Handle __array_pop(arr) — h.pop() sugar
|
|
1555
|
+
if (expr.fn === '__array_pop') {
|
|
1556
|
+
if (expr.args[0].kind === 'ident') {
|
|
1557
|
+
const arrInfo = ctx.arrayVars.get((expr.args[0] as { kind: 'ident'; name: string }).name)
|
|
1558
|
+
if (arrInfo) {
|
|
1559
|
+
ctx.emit({ kind: 'call', dst: null, fn: `__raw:data remove storage ${arrInfo.ns} ${arrInfo.pathPrefix}[-1]`, args: [] })
|
|
1560
|
+
const t = ctx.freshTemp()
|
|
1561
|
+
ctx.emit({ kind: 'const', dst: t, value: 0 })
|
|
1562
|
+
return { kind: 'temp', name: t }
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
}
|
|
1566
|
+
|
|
1567
|
+
// Handle __array_length(arr) — h.length sugar → get array length via data get
|
|
1568
|
+
if (expr.fn === '__array_length') {
|
|
1569
|
+
if (expr.args[0].kind === 'ident') {
|
|
1570
|
+
const arrInfo = ctx.arrayVars.get((expr.args[0] as { kind: 'ident'; name: string }).name)
|
|
1571
|
+
if (arrInfo) {
|
|
1572
|
+
const t = ctx.freshTemp()
|
|
1573
|
+
ctx.emit({ kind: 'nbt_read', dst: t, ns: arrInfo.ns, path: `${arrInfo.pathPrefix}`, scale: 1 })
|
|
1574
|
+
return { kind: 'temp', name: t }
|
|
1575
|
+
}
|
|
1576
|
+
}
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1177
1579
|
// Handle list_push(arr_name, val) — append an int to an NBT int array
|
|
1178
1580
|
// list_push("rs:lists", "mylist", val) or simpler: uses the array's storage path
|
|
1179
1581
|
if (expr.fn === 'list_push') {
|
|
@@ -1295,7 +1697,7 @@ function lowerExpr(
|
|
|
1295
1697
|
|
|
1296
1698
|
// Handle builtin calls → raw MC commands
|
|
1297
1699
|
if (BUILTIN_SET.has(expr.fn)) {
|
|
1298
|
-
const cmd = formatBuiltinCall(expr.fn, expr.args, ctx.currentMacroParams)
|
|
1700
|
+
const cmd = formatBuiltinCall(expr.fn, expr.args, ctx.currentMacroParams, ctx.getNamespace())
|
|
1299
1701
|
ctx.emit({ kind: 'call', dst: null, fn: `__raw:${cmd}`, args: [] })
|
|
1300
1702
|
const t = ctx.freshTemp()
|
|
1301
1703
|
ctx.emit({ kind: 'const', dst: t, value: 0 })
|
|
@@ -1322,7 +1724,25 @@ function lowerExpr(
|
|
|
1322
1724
|
const temp = sv.fields.get(f)
|
|
1323
1725
|
return temp ? { kind: 'temp' as const, name: temp } : { kind: 'const' as const, value: 0 }
|
|
1324
1726
|
})
|
|
1325
|
-
|
|
1727
|
+
// Flatten struct args field-by-field; primitives as single operand
|
|
1728
|
+
const explicitArgs: Operand[] = []
|
|
1729
|
+
for (const argExpr of expr.args.slice(1)) {
|
|
1730
|
+
if (argExpr.kind === 'ident') {
|
|
1731
|
+
const argSv = ctx.structVars.get(argExpr.name)
|
|
1732
|
+
if (argSv) {
|
|
1733
|
+
// Struct arg: pass each field as a separate operand
|
|
1734
|
+
const argFields = ctx.structDefs.get(argSv.typeName) ?? []
|
|
1735
|
+
for (const fieldName of argFields) {
|
|
1736
|
+
const ft = argSv.fields.get(fieldName)
|
|
1737
|
+
explicitArgs.push(ft
|
|
1738
|
+
? { kind: 'temp' as const, name: ft }
|
|
1739
|
+
: { kind: 'const' as const, value: 0 })
|
|
1740
|
+
}
|
|
1741
|
+
continue
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
explicitArgs.push(lowerExpr(argExpr, ctx, scope))
|
|
1745
|
+
}
|
|
1326
1746
|
const allArgs = [...selfArgs, ...explicitArgs]
|
|
1327
1747
|
const t = ctx.freshTemp()
|
|
1328
1748
|
ctx.emit({ kind: 'call', dst: t, fn: `${sv.typeName}::${expr.fn}`, args: allArgs })
|
|
@@ -1342,11 +1762,12 @@ function lowerExpr(
|
|
|
1342
1762
|
if (targetMacro.macroParams.has(paramName)) {
|
|
1343
1763
|
const paramTypeName = targetMacro.paramTypes.get(paramName) ?? 'int'
|
|
1344
1764
|
const isFloat = paramTypeName === 'float'
|
|
1765
|
+
const isFixed = paramTypeName === 'fixed'
|
|
1345
1766
|
macroArgs.push({
|
|
1346
1767
|
name: paramName,
|
|
1347
1768
|
value: args[i],
|
|
1348
|
-
type: isFloat ? 'double' : 'int',
|
|
1349
|
-
scale: isFloat ? 0.01 : 1,
|
|
1769
|
+
type: (isFloat || isFixed) ? 'double' : 'int',
|
|
1770
|
+
scale: isFloat ? 0.01 : isFixed ? 0.0001 : 1,
|
|
1350
1771
|
})
|
|
1351
1772
|
}
|
|
1352
1773
|
}
|
|
@@ -1417,6 +1838,49 @@ function lowerExpr(
|
|
|
1417
1838
|
}
|
|
1418
1839
|
// --- end array monomorphization ---
|
|
1419
1840
|
|
|
1841
|
+
// Check if any args are double-typed — pass via NBT __dp<i> slots
|
|
1842
|
+
{
|
|
1843
|
+
const targetParams = ctx.fnParamInfo.get(expr.fn)
|
|
1844
|
+
if (targetParams) {
|
|
1845
|
+
const hasDoubleParam = targetParams.some(
|
|
1846
|
+
p => p.type.kind === 'named' && p.type.name === 'double'
|
|
1847
|
+
)
|
|
1848
|
+
if (hasDoubleParam) {
|
|
1849
|
+
const ns = ctx.getNamespace()
|
|
1850
|
+
const nonDoubleArgs: Operand[] = []
|
|
1851
|
+
let doubleSlot = 0
|
|
1852
|
+
for (let i = 0; i < targetParams.length && i < expr.args.length; i++) {
|
|
1853
|
+
const p = targetParams[i]
|
|
1854
|
+
if (p.type.kind === 'named' && p.type.name === 'double') {
|
|
1855
|
+
// Caller has a double arg: copy NBT path directly to __dp<doubleSlot>
|
|
1856
|
+
const arg = expr.args[i]
|
|
1857
|
+
if (arg.kind === 'ident' && ctx.doubleVars.has(arg.name)) {
|
|
1858
|
+
// Arg is already a double var — copy NBT path directly
|
|
1859
|
+
const srcPath = ctx.doubleVars.get(arg.name)!
|
|
1860
|
+
ctx.emit({ kind: 'call', dst: null, fn: `__raw:data modify storage rs:d __dp${doubleSlot} set from storage rs:d ${srcPath}`, args: [] })
|
|
1861
|
+
} else {
|
|
1862
|
+
// Arg is an expression — lower it as fixed (×10000), store as double
|
|
1863
|
+
const argOp = lowerExpr(arg, ctx, scope)
|
|
1864
|
+
const tmp = ctx.freshTemp()
|
|
1865
|
+
ctx.emit({ kind: 'copy', dst: tmp, src: argOp })
|
|
1866
|
+
ctx.emit({ kind: 'call', dst: null, fn: `__raw:execute store result storage rs:d __dp${doubleSlot} double 0.0001 run scoreboard players get $${tmp} __${ns}`, args: [] })
|
|
1867
|
+
}
|
|
1868
|
+
doubleSlot++
|
|
1869
|
+
} else {
|
|
1870
|
+
nonDoubleArgs.push(lowerExpr(expr.args[i], ctx, scope))
|
|
1871
|
+
}
|
|
1872
|
+
}
|
|
1873
|
+
// Any extra args beyond param count
|
|
1874
|
+
for (let i = targetParams.length; i < expr.args.length; i++) {
|
|
1875
|
+
nonDoubleArgs.push(lowerExpr(expr.args[i], ctx, scope))
|
|
1876
|
+
}
|
|
1877
|
+
const t = ctx.freshTemp()
|
|
1878
|
+
ctx.emit({ kind: 'call', dst: t, fn: expr.fn, args: nonDoubleArgs })
|
|
1879
|
+
return { kind: 'temp', name: t }
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1883
|
+
|
|
1420
1884
|
const args = expr.args.map(a => lowerExpr(a, ctx, scope))
|
|
1421
1885
|
const t = ctx.freshTemp()
|
|
1422
1886
|
ctx.emit({ kind: 'call', dst: t, fn: expr.fn, args })
|
|
@@ -1424,6 +1888,28 @@ function lowerExpr(
|
|
|
1424
1888
|
}
|
|
1425
1889
|
|
|
1426
1890
|
case 'invoke': {
|
|
1891
|
+
// Check for array.len() call: arr.len() → compile-time constant or NBT length
|
|
1892
|
+
if (expr.callee.kind === 'member' && expr.callee.field === 'len' && expr.callee.obj.kind === 'ident') {
|
|
1893
|
+
const arrInfo = ctx.arrayVars.get((expr.callee.obj as { kind: 'ident'; name: string }).name)
|
|
1894
|
+
if (arrInfo) {
|
|
1895
|
+
if (arrInfo.knownLen !== undefined) {
|
|
1896
|
+
// Compile-time constant length (literal array)
|
|
1897
|
+
const t = ctx.freshTemp()
|
|
1898
|
+
ctx.emit({ kind: 'const', dst: t, value: arrInfo.knownLen })
|
|
1899
|
+
return { kind: 'temp', name: t }
|
|
1900
|
+
}
|
|
1901
|
+
// Dynamic array (function parameter, heap_new, etc.): read length at runtime
|
|
1902
|
+
// emit: execute store result score $t __ns run data get storage ns:arrays path
|
|
1903
|
+
const t = ctx.freshTemp()
|
|
1904
|
+
ctx.emit({ kind: 'nbt_list_len', dst: t, ns: arrInfo.ns, path: arrInfo.pathPrefix })
|
|
1905
|
+
return { kind: 'temp', name: t }
|
|
1906
|
+
}
|
|
1907
|
+
// Also check scope-tracked length temp for literal arrays
|
|
1908
|
+
const lenTemp = scope.get((expr.callee.obj as { kind: 'ident'; name: string }).name)
|
|
1909
|
+
if (lenTemp !== undefined) {
|
|
1910
|
+
return { kind: 'temp', name: lenTemp }
|
|
1911
|
+
}
|
|
1912
|
+
}
|
|
1427
1913
|
// Check for struct method call: v.method(args)
|
|
1428
1914
|
if (expr.callee.kind === 'member' && expr.callee.obj.kind === 'ident') {
|
|
1429
1915
|
const sv = ctx.structVars.get(expr.callee.obj.name)
|
|
@@ -1516,6 +2002,54 @@ function lowerExpr(
|
|
|
1516
2002
|
return { kind: 'temp', name: t }
|
|
1517
2003
|
}
|
|
1518
2004
|
|
|
2005
|
+
case 'type_cast': {
|
|
2006
|
+
const ns = ctx.getNamespace()
|
|
2007
|
+
const targetName = expr.targetType.kind === 'named' ? expr.targetType.name : null
|
|
2008
|
+
|
|
2009
|
+
if (targetName === 'double') {
|
|
2010
|
+
// expr as double: evaluate inner as fixed (×10000), store as double in NBT
|
|
2011
|
+
const innerOp = lowerExpr(expr.expr, ctx, scope)
|
|
2012
|
+
const innerTemp = ctx.freshTemp()
|
|
2013
|
+
ctx.emit({ kind: 'copy', dst: innerTemp, src: innerOp })
|
|
2014
|
+
const path = ctx.freshDoubleVar(`cast`)
|
|
2015
|
+
// execute store result storage rs:d <path> double 0.0001 run scoreboard players get $<t> __<ns>
|
|
2016
|
+
ctx.emit({ kind: 'call', dst: null, fn: `__raw:execute store result storage rs:d ${path} double 0.0001 run scoreboard players get $${innerTemp} __${ns}`, args: [] })
|
|
2017
|
+
// Return a fresh temp that reads the stored double back as fixed ×10000 via nbt_read
|
|
2018
|
+
const t = ctx.freshTemp()
|
|
2019
|
+
ctx.emit({ kind: 'nbt_read', dst: t, ns: 'rs:d', path, scale: 10000.0 })
|
|
2020
|
+
ctx.floatTemps.add(t)
|
|
2021
|
+
return { kind: 'temp', name: t }
|
|
2022
|
+
}
|
|
2023
|
+
|
|
2024
|
+
if (targetName === 'fixed' || targetName === 'float' || targetName === 'int') {
|
|
2025
|
+
// expr as fixed (or int): check if expr is a double variable
|
|
2026
|
+
if (expr.expr.kind === 'ident' && ctx.doubleVars.has(expr.expr.name)) {
|
|
2027
|
+
// Load double NBT as ×10000 fixed-point score via nbt_read (LIR renames dst properly)
|
|
2028
|
+
const path = ctx.doubleVars.get(expr.expr.name)!
|
|
2029
|
+
const t = ctx.freshTemp()
|
|
2030
|
+
ctx.emit({ kind: 'nbt_read', dst: t, ns: 'rs:d', path, scale: 10000.0 })
|
|
2031
|
+
if (targetName === 'fixed' || targetName === 'float') {
|
|
2032
|
+
ctx.floatTemps.add(t)
|
|
2033
|
+
}
|
|
2034
|
+
return { kind: 'temp', name: t }
|
|
2035
|
+
}
|
|
2036
|
+
// Otherwise just evaluate the inner expression (numeric coercion — no-op at scoreboard level)
|
|
2037
|
+
const innerOp = lowerExpr(expr.expr, ctx, scope)
|
|
2038
|
+
const t = ctx.freshTemp()
|
|
2039
|
+
ctx.emit({ kind: 'copy', dst: t, src: innerOp })
|
|
2040
|
+
if (targetName === 'fixed' || targetName === 'float') {
|
|
2041
|
+
ctx.floatTemps.add(t)
|
|
2042
|
+
}
|
|
2043
|
+
return { kind: 'temp', name: t }
|
|
2044
|
+
}
|
|
2045
|
+
|
|
2046
|
+
// All other casts: pass through
|
|
2047
|
+
const innerOp = lowerExpr(expr.expr, ctx, scope)
|
|
2048
|
+
const t = ctx.freshTemp()
|
|
2049
|
+
ctx.emit({ kind: 'copy', dst: t, src: innerOp })
|
|
2050
|
+
return { kind: 'temp', name: t }
|
|
2051
|
+
}
|
|
2052
|
+
|
|
1519
2053
|
default: {
|
|
1520
2054
|
const _exhaustive: never = expr
|
|
1521
2055
|
throw new Error(`Unknown HIR expression kind: ${(_exhaustive as any).kind}`)
|
|
@@ -1523,6 +2057,42 @@ function lowerExpr(
|
|
|
1523
2057
|
}
|
|
1524
2058
|
}
|
|
1525
2059
|
|
|
2060
|
+
// ---------------------------------------------------------------------------
|
|
2061
|
+
// Double arithmetic helpers
|
|
2062
|
+
// ---------------------------------------------------------------------------
|
|
2063
|
+
|
|
2064
|
+
/** Returns true if expr is a double-typed HIR expression (ident in doubleVars or double_lit). */
|
|
2065
|
+
function isDoubleExpr(expr: HIRExpr, ctx: FnContext): boolean {
|
|
2066
|
+
if (expr.kind === 'ident' && ctx.doubleVars.has(expr.name)) return true
|
|
2067
|
+
if (expr.kind === 'double_lit') return true
|
|
2068
|
+
return false
|
|
2069
|
+
}
|
|
2070
|
+
|
|
2071
|
+
/**
|
|
2072
|
+
* Lower a double HIR expression to its NBT storage path in rs:d.
|
|
2073
|
+
* For double_lit, stores the value and returns the path.
|
|
2074
|
+
* For double idents, returns the existing path directly.
|
|
2075
|
+
* For other expressions, lowers as fixed (×10000) and converts to double.
|
|
2076
|
+
*/
|
|
2077
|
+
function lowerDoubleExprToPath(expr: HIRExpr, ctx: FnContext, scope: Map<string, Temp>): string {
|
|
2078
|
+
if (expr.kind === 'ident' && ctx.doubleVars.has(expr.name)) {
|
|
2079
|
+
return ctx.doubleVars.get(expr.name)!
|
|
2080
|
+
}
|
|
2081
|
+
if (expr.kind === 'double_lit') {
|
|
2082
|
+
const path = ctx.freshDoubleVar('dlit')
|
|
2083
|
+
ctx.emit({ kind: 'call', dst: null, fn: `__raw:data modify storage rs:d ${path} set value ${expr.value}d`, args: [] })
|
|
2084
|
+
return path
|
|
2085
|
+
}
|
|
2086
|
+
// Fallback: lower as fixed (×10000), then convert to double NBT
|
|
2087
|
+
const op = lowerExpr(expr, ctx, scope)
|
|
2088
|
+
const tmp = ctx.freshTemp()
|
|
2089
|
+
ctx.emit({ kind: 'copy', dst: tmp, src: op })
|
|
2090
|
+
const ns = ctx.getNamespace()
|
|
2091
|
+
const path = ctx.freshDoubleVar('dtmp')
|
|
2092
|
+
ctx.emit({ kind: 'call', dst: null, fn: `__raw:execute store result storage rs:d ${path} double 0.0001 run scoreboard players get $${tmp} __${ns}`, args: [] })
|
|
2093
|
+
return path
|
|
2094
|
+
}
|
|
2095
|
+
|
|
1526
2096
|
// ---------------------------------------------------------------------------
|
|
1527
2097
|
// Short-circuit lowering
|
|
1528
2098
|
// ---------------------------------------------------------------------------
|
|
@@ -1762,11 +2332,47 @@ const MACRO_SENTINEL = '\x01'
|
|
|
1762
2332
|
* If any argument uses a macro param, the command is prefixed with \x01
|
|
1763
2333
|
* (converted to $ in LIR emission).
|
|
1764
2334
|
*/
|
|
2335
|
+
/**
|
|
2336
|
+
* Convert an f_string HIRExpr to a Minecraft JSON text component string.
|
|
2337
|
+
* Each interpolated variable becomes a {"score":{"name":"$var","objective":"__ns"}} component.
|
|
2338
|
+
*/
|
|
2339
|
+
function fStringToJsonText(expr: HIRExpr, namespace: string): string {
|
|
2340
|
+
if (expr.kind !== 'f_string') return JSON.stringify(expr.kind === 'str_lit' ? { text: expr.value } : { text: '~' })
|
|
2341
|
+
const objective = `__${namespace}`
|
|
2342
|
+
const extra: unknown[] = []
|
|
2343
|
+
for (const part of expr.parts) {
|
|
2344
|
+
if (part.kind === 'text') {
|
|
2345
|
+
if (part.value) extra.push({ text: part.value })
|
|
2346
|
+
} else {
|
|
2347
|
+
// expr part — must be a scoreboard variable (ident)
|
|
2348
|
+
const inner = part.expr
|
|
2349
|
+
if (inner.kind === 'ident') {
|
|
2350
|
+
extra.push({ score: { name: `$${inner.name}`, objective } })
|
|
2351
|
+
} else if (inner.kind === 'int_lit') {
|
|
2352
|
+
extra.push({ text: String(inner.value) })
|
|
2353
|
+
} else {
|
|
2354
|
+
extra.push({ text: '?' })
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2358
|
+
if (extra.length === 0) return '{"text":""}'
|
|
2359
|
+
if (extra.length === 1) return JSON.stringify(extra[0])
|
|
2360
|
+
return JSON.stringify({ text: '', extra })
|
|
2361
|
+
}
|
|
2362
|
+
|
|
1765
2363
|
function formatBuiltinCall(
|
|
1766
2364
|
fn: string,
|
|
1767
2365
|
args: HIRExpr[],
|
|
1768
2366
|
macroParams: Set<string>,
|
|
2367
|
+
namespace = '',
|
|
1769
2368
|
): string {
|
|
2369
|
+
// For text-display builtins, the message arg may be an f_string — convert to JSON text
|
|
2370
|
+
const TEXT_BUILTINS = new Set(['tell', 'tellraw', 'title', 'subtitle', 'actionbar', 'announce'])
|
|
2371
|
+
const resolveTextArg = (arg: HIRExpr): string => {
|
|
2372
|
+
if (arg.kind === 'f_string') return fStringToJsonText(arg, namespace)
|
|
2373
|
+
return JSON.stringify({ text: exprToCommandArg(arg, macroParams).str })
|
|
2374
|
+
}
|
|
2375
|
+
|
|
1770
2376
|
const fmtArgs = args.map(a => exprToCommandArg(a, macroParams))
|
|
1771
2377
|
const strs = fmtArgs.map(a => a.str)
|
|
1772
2378
|
const hasMacro = fmtArgs.some(a => a.isMacro)
|
|
@@ -1817,12 +2423,32 @@ function formatBuiltinCall(
|
|
|
1817
2423
|
}
|
|
1818
2424
|
case 'say': cmd = `say ${strs[0] ?? ''}`; break
|
|
1819
2425
|
case 'tell':
|
|
1820
|
-
case 'tellraw':
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
2426
|
+
case 'tellraw': {
|
|
2427
|
+
const msgJson = resolveTextArg(args[1])
|
|
2428
|
+
cmd = `tellraw ${strs[0]} ${msgJson}`
|
|
2429
|
+
break
|
|
2430
|
+
}
|
|
2431
|
+
case 'title': {
|
|
2432
|
+
const msgJson = resolveTextArg(args[1])
|
|
2433
|
+
cmd = `title ${strs[0]} title ${msgJson}`
|
|
2434
|
+
break
|
|
2435
|
+
}
|
|
2436
|
+
case 'actionbar': {
|
|
2437
|
+
const msgJson = resolveTextArg(args[1])
|
|
2438
|
+
cmd = `title ${strs[0]} actionbar ${msgJson}`
|
|
2439
|
+
break
|
|
2440
|
+
}
|
|
2441
|
+
case 'subtitle': {
|
|
2442
|
+
const msgJson = resolveTextArg(args[1])
|
|
2443
|
+
cmd = `title ${strs[0]} subtitle ${msgJson}`
|
|
2444
|
+
break
|
|
2445
|
+
}
|
|
1824
2446
|
case 'title_times': cmd = `title ${strs[0]} times ${strs[1]} ${strs[2]} ${strs[3]}`; break
|
|
1825
|
-
case 'announce':
|
|
2447
|
+
case 'announce': {
|
|
2448
|
+
const msgJson = resolveTextArg(args[0])
|
|
2449
|
+
cmd = `tellraw @a ${msgJson}`
|
|
2450
|
+
break
|
|
2451
|
+
}
|
|
1826
2452
|
case 'give': {
|
|
1827
2453
|
const nbt = strs[3] ? strs[3] : ''
|
|
1828
2454
|
cmd = `give ${strs[0]} ${strs[1]}${nbt} ${strs[2] ?? '1'}`
|
|
@@ -1837,8 +2463,11 @@ function formatBuiltinCall(
|
|
|
1837
2463
|
case 'time_set': cmd = `time set ${strs[0]}`; break
|
|
1838
2464
|
case 'time_add': cmd = `time add ${strs[0]}`; break
|
|
1839
2465
|
case 'gamerule': cmd = `gamerule ${strs[0]} ${strs[1]}`; break
|
|
1840
|
-
case 'tag_add':
|
|
1841
|
-
case 'tag_remove':
|
|
2466
|
+
case 'tag_add': cmd = `tag ${strs[0]} add ${strs[1]}`; break
|
|
2467
|
+
case 'tag_remove': cmd = `tag ${strs[0]} remove ${strs[1]}`; break
|
|
2468
|
+
// entity.tag(name) / entity.untag(name) sugar — same as tag_add/tag_remove
|
|
2469
|
+
case '__entity_tag': cmd = `tag ${strs[0]} add ${strs[1]}`; break
|
|
2470
|
+
case '__entity_untag': cmd = `tag ${strs[0]} remove ${strs[1]}`; break
|
|
1842
2471
|
case 'kick': cmd = `kick ${strs[0]} ${strs[1] ?? ''}`.trim(); break
|
|
1843
2472
|
case 'clone': cmd = `clone ${strs.join(' ')}`; break
|
|
1844
2473
|
case 'difficulty': cmd = `difficulty ${strs[0]}`; break
|