From a7442a9dc333980d2db43a04527c9c706dac2991 Mon Sep 17 00:00:00 2001 From: Nico314159 Date: Fri, 18 Aug 2023 23:02:39 -0700 Subject: [PATCH] Set distance to maximum value if nothing is hit --- data/retina/functions/traverse/setup.mcfunction | 2 +- retina.jmc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/retina/functions/traverse/setup.mcfunction b/data/retina/functions/traverse/setup.mcfunction index 02aab0f..f77aad1 100644 --- a/data/retina/functions/traverse/setup.mcfunction +++ b/data/retina/functions/traverse/setup.mcfunction @@ -9,7 +9,7 @@ scoreboard players operation $test_Z retina.__variable__ /= $overflow_risk retin execute unless score $test_Z retina.__variable__ matches -1..0 run tellraw @a ["",{"text":"[Error] ","color":"dark_red"},{"text":"Raycast Z coordinate of ","color":"red"},{"score":{"name":"$int_Z","objective":"retina.__variable__"},"color":"red"},{"text":" is out of range (-","color":"red"},{"score":{"name":"$overflow_risk","objective":"retina.__variable__"},"color":"red"},{"text":", ","color":"red"},{"score":{"name":"$overflow_risk","objective":"retina.__variable__"},"color":"red"},{"text":")","color":"red"}] execute unless score $test_Z retina.__variable__ matches -1..0 run return 0 data modify storage retina:output Target set value "NONE" -data remove storage retina:output Distance +data modify storage retina:output Distance set from storage retina:input MaxRecursionDepth data remove storage retina:output TargetedBlock data remove storage retina:output TargetedEntity data remove storage retina:output PlacingPosition diff --git a/retina.jmc b/retina.jmc index b3c9a4b..326a756 100644 --- a/retina.jmc +++ b/retina.jmc @@ -27,7 +27,7 @@ class traverse { ); data modify storage retina:output Target set value "NONE"; - data remove storage retina:output Distance; + data modify storage retina:output Distance set from storage retina:input MaxRecursionDepth; data remove storage retina:output TargetedBlock; data remove storage retina:output TargetedEntity; data remove storage retina:output PlacingPosition;