diff --git a/TheSkyBlessing/data/lib/functions/array/math/max.mcfunction b/TheSkyBlessing/data/lib/functions/array/math/max.mcfunction index b95978cae0..5215d82e2d 100644 --- a/TheSkyBlessing/data/lib/functions/array/math/max.mcfunction +++ b/TheSkyBlessing/data/lib/functions/array/math/max.mcfunction @@ -23,9 +23,9 @@ execute store success score $isNumeric Temporary run data get storage lib: Array[-1] 1 # 最大値を計算する function lib:array/core/math/max -# 総和をSumResultに突っ込む - execute if score $isNumeric Temporary matches 0 store result storage lib: SumResult int 1.00 run scoreboard players get $Max Temporary - execute if score $isNumeric Temporary matches 1 store result storage lib: SumResult double 0.01 run scoreboard players get $Max Temporary +# 総和をMaxResultに突っ込む + execute if score $isNumeric Temporary matches 0 store result storage lib: MaxResult int 1.00 run scoreboard players get $Max Temporary + execute if score $isNumeric Temporary matches 1 store result storage lib: MaxResult double 0.01 run scoreboard players get $Max Temporary # リセット scoreboard players reset $Max Temporary scoreboard players reset $Temp Temporary diff --git a/TheSkyBlessing/data/lib/functions/array/math/min.mcfunction b/TheSkyBlessing/data/lib/functions/array/math/min.mcfunction index 1a4dcae246..a2a95536c2 100644 --- a/TheSkyBlessing/data/lib/functions/array/math/min.mcfunction +++ b/TheSkyBlessing/data/lib/functions/array/math/min.mcfunction @@ -10,7 +10,7 @@ # storage lib: Array: [T] # 配列データ # @output -# storage lib: MaxResult: T extends Numeric ? double : int +# storage lib: MinResult: T extends Numeric ? double : int # 最小値 # @api @@ -23,9 +23,9 @@ execute store success score $isNumeric Temporary run data get storage lib: Array[-1] 1 # 最小値を計算する function lib:array/core/math/min -# 総和をSumResultに突っ込む - execute if score $isNumeric Temporary matches 0 store result storage lib: SumResult int 1.00 run scoreboard players get $Min Temporary - execute if score $isNumeric Temporary matches 1 store result storage lib: SumResult double 0.01 run scoreboard players get $Min Temporary +# 総和をMinResultに突っ込む + execute if score $isNumeric Temporary matches 0 store result storage lib: MinResult int 1.00 run scoreboard players get $Min Temporary + execute if score $isNumeric Temporary matches 1 store result storage lib: MinResult double 0.01 run scoreboard players get $Min Temporary # リセット scoreboard players reset $Min Temporary scoreboard players reset $Temp Temporary