Refactor makeEdit so it returns the result node

This commit is contained in:
Misode
2024-10-23 21:41:12 +02:00
parent 6151fbcea4
commit 6e68de01aa
5 changed files with 136 additions and 103 deletions

View File

@@ -117,8 +117,11 @@ function shuffle<T>(array: T[], ctx: LootContext) {
}
function generateTable(table: any, consumer: ItemConsumer, ctx: LootContext) {
if (!Array.isArray(table.pools)) {
return
}
const tableConsumer = decorateFunctions(table.functions ?? [], consumer, ctx)
for (const pool of table.pools ?? []) {
for (const pool of table.pools) {
generatePool(pool, tableConsumer, ctx)
}
}