skapa-season-3/kubejs/server_scripts/create_chipped_compat.js
Steve McMaster fdce87ac75
All checks were successful
continuous-integration/drone/push Build is passing
Import KubeJS and Almost Unified
2024-07-12 00:30:16 +00:00

29 lines
1.1 KiB
JavaScript

if (Platform.isLoaded("chipped")) {
ServerEvents.recipes(event => {
event.forEachRecipe({ "mod": "chipped" }, (recipe) => {
if (recipe.getType().getNamespace() == 'chipped') {
let tags = recipe.get('tags')
tags.forEach((tag) => {
let tag_name = tag.split(':')[1]
Ingredient.of('#' + tag).itemIds.forEach((item) => {
let item_name = item.split(':')[1]
event.custom({
"type": "create:cutting",
"ingredients": [
{ "tag": tag }
],
"results": [
{
"item": item,
"count": 1
}
],
"processingTime": 50
}).id('create:compat/cutting/chipped/' + item_name + '_from_' + tag_name)
})
})
}
})
})
}