Example
In this example, I want to get the length of a list.
from bolt_expressions import Scoreboard, Data
function ./main:
score = Scoreboard.objective("some_objective")
data = Data.storage("some_storage")
data.some_list = [1, 2, 3, 4, 5]
score["list_length"] = data.some_list
Generated code:
data modify storage some_storage some_list set value [1, 2, 3, 4, 5]
execute store result score list_length some_objective run data get storage some_storage some_list 1 # <-- This 1 is problematic!
Expected outcome
I expect the score list_length some_objective to be 5.
Actual outcome
The list_length some_objective is 0.
Proposed fix
This bug occurs because the data has a default scale of 1. But the list length is only stored in the score if there is NO scale.
I propose being able to use None as a scale. I realize this is not a trivial fix because if storing a score into data, the scale is required. So we need to make None equal to something (probably 1) if it is used there.
Example
In this example, I want to get the length of a list.
Generated code:
Expected outcome
I expect the score
list_length some_objectiveto be 5.Actual outcome
The
list_length some_objectiveis 0.Proposed fix
This bug occurs because the data has a default scale of 1. But the list length is only stored in the score if there is NO scale.
I propose being able to use
Noneas a scale. I realize this is not a trivial fix because if storing a score into data, the scale is required. So we need to makeNoneequal to something (probably 1) if it is used there.