Skip to content

Commit 21b723b

Browse files
committed
fix: Properly generate bubble bench registry stats
1 parent 0ce4816 commit 21b723b

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

templates/bake_registry/call.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from pathlib import Path
44
import sys
55
import json
6+
import math
67

78
if len(sys.argv) != 2:
89
sys.exit(1)
@@ -62,6 +63,11 @@ def sort(x: dict):
6263

6364
output_registry.sort(key=sort)
6465
data = json.dumps(output_registry, indent="\t")
66+
lines = [
67+
f"data modify storage minecraft:bubblellaneous registry.{category} set value {data.replace('\n', '\\\n')}",
68+
f"scoreboard players set registry.{category}.size bbln.var {len(output_registry)}",
69+
f"scoreboard players set registry.{category}.pages bbln.var {math.ceil(len(output_registry) / 18)}",
70+
]
6571
path.write_text(
66-
f"data modify storage minecraft:bubblellaneous registry.{category} set value {data.replace('\n', '\\\n')}"
72+
"\n".join(lines),
6773
)

0 commit comments

Comments
 (0)