mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-27 00:38:46 +00:00
Refactor makeEdit so it returns the result node
This commit is contained in:
@@ -122,8 +122,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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user