Skip to content

Commit 84028a0

Browse files
committed
Add basic support for crafting_dye and crafting_imbue
1 parent ef17f8a commit 84028a0

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/app/components/previews/Recipe.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,35 @@ export function placeItems(version: VersionId, recipe: any, animation: number, i
4949
const choice = materials[animation % materials.length]
5050
items.set('crafting.1', choice)
5151
}
52+
} else if (type === 'crafting_dye') {
53+
const target = allIngredientChoices(version, recipe.target, itemTags)
54+
if (target.length > 0) {
55+
const choice = target[animation % target.length]
56+
items.set('crafting.0', choice)
57+
}
58+
const dye = allIngredientChoices(version, recipe.dye, itemTags)
59+
if (dye.length > 0) {
60+
const choice = dye[animation % dye.length]
61+
items.set('crafting.1', choice)
62+
}
63+
} else if (type === 'crafting_imbue') {
64+
const source = allIngredientChoices(version, recipe.source, itemTags)
65+
if (source.length > 0) {
66+
const choice = source[animation % source.length]
67+
items.set('crafting.4', choice)
68+
}
69+
const material = allIngredientChoices(version, recipe.material, itemTags)
70+
if (material.length > 0) {
71+
const choice = material[animation % material.length]
72+
items.set('crafting.0', choice)
73+
items.set('crafting.1', choice)
74+
items.set('crafting.2', choice)
75+
items.set('crafting.3', choice)
76+
items.set('crafting.5', choice)
77+
items.set('crafting.6', choice)
78+
items.set('crafting.7', choice)
79+
items.set('crafting.8', choice)
80+
}
5281
} else if (type === 'smelting' || type === 'smoking' || type === 'blasting' || type === 'campfire_cooking') {
5382
const choices = allIngredientChoices(version, recipe.ingredient, itemTags)
5483
if (choices.length > 0) {

0 commit comments

Comments
 (0)