Add helper functions
All checks were successful
Deploy datapack to dev / Build (push) Successful in 7s

This commit is contained in:
themodernhakr 2025-03-23 02:01:49 -05:00
parent 651ab1286c
commit 8a4bd9e9b9

View File

@ -83,15 +83,16 @@ class database.benchmark {
::database.test.arrayTest2.array.del(); ::database.test.arrayTest2.array.del();
::database.test.arrayTest2.index.del(); ::database.test.arrayTest2.index.del();
} }
function arrayTest2._searchIndex() {
$::temp.index = ::database.test.arrayTest2.index.$(keyword);
tellraw @a {"nbt":"temp.index","storage":"ferdinland:ferdinland"};
}
function arrayTest2._searchArray() {
$tellraw @a {"nbt":"database.test.arrayTest2.array.$(index)", "storage":"ferdinland:ferdinland"};
}
function arrayTest2.run() { function arrayTest2.run() {
::temp.keyword = "entry500"; this.arrayTest2._searchIndex({keyword: "entry500"});
execute run { this.arrayTest2._searchArray() with ::temp.index;
$say "$(keyword)";
$tellraw @a {"nbt":"database.test.arrayTest2.index.$(keyword)","storage":"ferdinland:ferdinland"};
$::temp.index = ::database.test.arrayTest2.index.$(keyword);
tellraw @a {"nbt":"temp.index","storage":"ferdinland:ferdinland"};
} with ::temp.keyword;
::temp.keyword.del();
::temp.index.del(); ::temp.index.del();
} }
} }