diff --git a/datapacks/omega-flowey/data/utils/functions/math/vector/dot_macro.mcfunction b/datapacks/omega-flowey/data/utils/functions/math/vector/dot_macro.mcfunction index cbc3a14ee..474cd1b4e 100644 --- a/datapacks/omega-flowey/data/utils/functions/math/vector/dot_macro.mcfunction +++ b/datapacks/omega-flowey/data/utils/functions/math/vector/dot_macro.mcfunction @@ -1,15 +1,15 @@ -scoreboard players set @s math.0 0 +scoreboard players set #utils:math.vector.dot math.0 0 $execute store result storage utils:math.vector.dot out float 1 run data get storage utils:math.vector.dot u.x $(x) -execute store result score @s math.1 run data get storage utils:math.vector.dot out 100 -scoreboard players operation @s math.0 += @s math.1 +execute store result score #utils:math.vector.dot math.1 run data get storage utils:math.vector.dot out 100 +scoreboard players operation #utils:math.vector.dot math.0 += #utils:math.vector.dot math.1 $execute store result storage utils:math.vector.dot out float 1 run data get storage utils:math.vector.dot u.y $(y) -execute store result score @s math.1 run data get storage utils:math.vector.dot out 100 -scoreboard players operation @s math.0 += @s math.1 +execute store result score #utils:math.vector.dot math.1 run data get storage utils:math.vector.dot out 100 +scoreboard players operation #utils:math.vector.dot math.0 += #utils:math.vector.dot math.1 $execute store result storage utils:math.vector.dot out float 1 run data get storage utils:math.vector.dot u.z $(z) -execute store result score @s math.1 run data get storage utils:math.vector.dot out 100 -scoreboard players operation @s math.0 += @s math.1 +execute store result score #utils:math.vector.dot math.1 run data get storage utils:math.vector.dot out 100 +scoreboard players operation #utils:math.vector.dot math.0 += #utils:math.vector.dot math.1 -execute store result storage utils:math.vector.dot out int 1 run scoreboard players get @s math.0 +execute store result storage utils:math.vector.dot out int 1 run scoreboard players get #utils:math.vector.dot math.0 diff --git a/datapacks/omega-flowey/data/utils/tests/math/vector/dot.mcfunction b/datapacks/omega-flowey/data/utils/tests/math/vector/dot.mcfunction new file mode 100644 index 000000000..88a42b345 --- /dev/null +++ b/datapacks/omega-flowey/data/utils/tests/math/vector/dot.mcfunction @@ -0,0 +1,39 @@ +# @batch utils:math + +# setup +data remove storage utils:math.vector.dot u +data remove storage utils:math.vector.dot v +data remove storage utils:math.vector.dot out +scoreboard players reset * +function omega-flowey:setup + +# cases +data merge storage utils:math.vector.dot { u: { x: 0, y: 0, z: 0 }, v: { x: 0, y: 0, z: 0 } } +function utils:math/vector/dot +execute store result score #utils:math.vector.dot math.0 run data get storage utils:math.vector.dot out +assert score #utils:math.vector.dot math.0 matches 0 + +data merge storage utils:math.vector.dot { u: { x: 1, y: 0, z: 0 }, v: { x: 0, y: 1, z: 0 } } +function utils:math/vector/dot +execute store result score #utils:math.vector.dot math.0 run data get storage utils:math.vector.dot out +assert score #utils:math.vector.dot math.0 matches 0 + +data merge storage utils:math.vector.dot { u: { x: 1, y: 0, z: 0 }, v: { x: 1, y: 0, z: 0 } } +function utils:math/vector/dot +execute store result score #utils:math.vector.dot math.0 run data get storage utils:math.vector.dot out +assert score #utils:math.vector.dot math.0 matches 100 + +data merge storage utils:math.vector.dot { u: { x: -1, y: 0, z: 0 }, v: { x: 1, y: 0, z: 0 } } +function utils:math/vector/dot +execute store result score #utils:math.vector.dot math.0 run data get storage utils:math.vector.dot out +assert score #utils:math.vector.dot math.0 matches -100 + +data merge storage utils:math.vector.dot { u: { x: 2, y: 0, z: 5 }, v: { x: 1, y: 0, z: -1 } } +function utils:math/vector/dot +execute store result score #utils:math.vector.dot math.0 run data get storage utils:math.vector.dot out +assert score #utils:math.vector.dot math.0 matches -300 + +data merge storage utils:math.vector.dot { u: { x: 1, y: 2, z: 3 }, v: { x: 4, y: 5, z: 6 } } +function utils:math/vector/dot +execute store result score #utils:math.vector.dot math.0 run data get storage utils:math.vector.dot out +assert score #utils:math.vector.dot math.0 matches 3200