Create 的 KubeJS 集成。此模组允许你在 KubeJS 脚本中添加并正确编辑 Create 模组的配方。所有支持的配方类型及示例如下。更多信息请参阅 Recipes 页面。
支持的配方类型:
createCrushing
createCutting
createMilling
createBasin
createMixing(支持 .heated() 和 .superheated())
createCompacting(支持 .heated() 和 .superheated())
createPressing
createSandpaperPolishing
createSplashing(批量清洗)
createDeploying
createFilling
createEmptying
注意:批量烟熏 (Bulk Smoking) = 原版烟熏配方,批量熔炼 (Bulk Blasting) = 原版熔炼配方。
event.recipes.createCrushing(output[], input[])
输出不必是数组。它可以是物品或流体。
输入不必是数组。它可以是原料或 Fluid.of('minecraft:water', 1000) 或 {fluidTag: 'some:fluid_tag', amount: 1000}
createMechanicalCrafting
event.recipes.createMechanicalCrafting(output, pattern[], {patternKey: input})
此配方类型与常规工作台形状配方相同
event.recipes.createSequencedAssembly(output[], input, sequence[])
// output[] 是你的输出物品
// input 是你的输入物品
// sequence[] 是一个序列数组。这些序列是受支持的“常规”配方。
示例
event.recipes.createCrushing([
'2x minecraft:cobblestone',
'minecraft:redstone',
Item.of('minecraft:redstone').withChance(0.5)
], 'minecraft:redstone_ore')
event.recipes.createMixing('create:chromatic_compound', [
'#forge:dusts/glowstone',
'#forge:dusts/glowstone',
'#forge:dusts/glowstone',
'create:powdered_obsidian',
'create:powdered_obsidian',
'create:powdered_obsidian',
'create:polished_rose_quartz'
]).superheated()
event.recipes.createFilling('create:blaze_cake', [
'create:blaze_cake_base',
Fluid.of('minecraft:lava', 250)
])
event.recipes.createEmptying([
'minecraft:glass_bottle',
Fluid.of('create:honey', 250)
], 'minecraft:honey_bottle')
event.recipes.createMechanicalCrafting('minecraft:piston', [
'CCCCC',
'CPIPC',
'CPRPC'
], {
C: '#forge:cobblestone',
P: '#minecraft:planks',
R: '#forge:dusts/redstone',
I: '#forge:ingots/iron'
})
event.recipes.createSequencedAssembly([ // 开始配方
Item.of('6x create:large_cogwheel').withChance(32.0), // 使该物品以一定几率成为输出
Item.of('create:brass_ingot').withChance(2.0), // 使该物品以一定几率成为输出
'minecraft:andesite', // 使该物品成为必定输出
'create:cogwheel', // 使该物品成为必定输出
'minecraft:stick', // 使该物品成为必定输出
'minecraft:iron_nugget' // 使该物品成为必定输出
], 'create:brass_ingot', [ // 'create:brass_ingot' 是输入。
// 由 "transitionalItem('create:incomplete_large_cogwheel')" 设置的过渡物品将是用于在配方中作为输入向输出转换的物品。
event.recipes.createDeploying('create:incomplete_large_cogwheel', ['create:incomplete_large_cogwheel', '#minecraft:planks']), // 像常规配方函数一样,在此数组中用作序列步骤。输入和输出都包含过渡物品
event.recipes.createDeploying('create:incomplete_large_cogwheel', ['create:incomplete_large_cogwheel', '#minecraft:wooden_buttons']), // 像常规配方函数一样,在此数组中用作序列步骤。输入和输出都包含过渡物品
event.recipes.createCutting('create:incomplete_large_cogwheel', 'create:incomplete_large_cogwheel').processingTime(50) // 像常规配方函数一样,在此数组中用作序列步骤。输入和输出都包含过渡物品
]).transitionalItem('create:incomplete_large_cogwheel').loops(6) // 设置过渡物品和循环次数(重复次数)
如果你想在 sequenced_assembly 配方中使用自己的过渡物品,则必须在 startup 事件中注册它:
onEvent('item.registry', event => {
// 此物品的纹理位于 kubejs/assets/kubejs/textures/item/my_part.png
event.create('my_part', 'create:sequenced_assembly').displayName('My Part')
})
然后你可以使用 ...transitionalItem('kubejs:my_part')...
注意!神秘转化 (Mysterious Conversion) 配方仅适用于客户端,因此目前添加它们的唯一方法是在客户端脚本(任何事件之外)中使用反射配合以下代码:
let MysteriousItemConversionCategory = java('com.simibubi.create.compat.jei.category.MysteriousItemConversionCategory')
let ConversionRecipe = java('com.simibubi.create.compat.jei.ConversionRecipe')
MysteriousItemConversionCategory.RECIPES.add(ConversionRecipe.create('minecraft:apple', 'minecraft:carrot'))
MysteriousItemConversionCategory.RECIPES.add(ConversionRecipe.create('minecraft:golden_apple', 'minecraft:golden_carrot'))


Create integration for KubeJS. This mod allows you to add and properly edit recipes of Create mod in KubeJS scripts. All supported recipe types and examples are below. See Recipes page for more info.
Supported recipe types:
createCrushing
createCutting
createMilling
createBasin
createMixing (supports .heated() and .superheated())
createCompacting (supports .heated() and .superheated())
createPressing
createSandpaperPolishing
createSplashing (Bulk Washing)
createDeploying
createFilling
createEmptying
Note: Bulk Smoking = vanilla smoking and Bulk Blasting = vanilla blasting recipe types.
event.recipes.createCrushing(output[], input[])
Output doesn't have to be an array. It can be either items or fluids
Input doesn't have to be an array. It can be either ingredients or Fluid.of('minecraft:water', 1000) or {fluidTag: 'some:fluid_tag', amount: 1000}
createMechanicalCrafting
event.recipes.createMechanicalCrafting(output, pattern[], {patternKey: input})
This recipe type is the same as regular crafting table shaped recipe
event.recipes.createSequencedAssembly(output[], input, sequence[])
// output[] are your output items
// input is your input item
// sequence[] is an array of sequences. These sequences are "regular" recipes that are supported.
Examples
event.recipes.createCrushing([
'2x minecraft:cobblestone',
'minecraft:redstone',
Item.of('minecraft:redstone').withChance(0.5)
], 'minecraft:redstone_ore')
event.recipes.createMixing('create:chromatic_compound', [
'#forge:dusts/glowstone',
'#forge:dusts/glowstone',
'#forge:dusts/glowstone',
'create:powdered_obsidian',
'create:powdered_obsidian',
'create:powdered_obsidian',
'create:polished_rose_quartz'
]).superheated()
event.recipes.createFilling('create:blaze_cake', [
'create:blaze_cake_base',
Fluid.of('minecraft:lava', 250)
])
event.recipes.createEmptying([
'minecraft:glass_bottle',
Fluid.of('create:honey', 250)
], 'minecraft:honey_bottle')
event.recipes.createMechanicalCrafting('minecraft:piston', [
'CCCCC',
'CPIPC',
'CPRPC'
], {
C: '#forge:cobblestone',
P: '#minecraft:planks',
R: '#forge:dusts/redstone',
I: '#forge:ingots/iron'
})
event.recipes.createSequencedAssembly([ // start the recipe
Item.of('6x create:large_cogwheel').withChance(32.0), // have this item be an output with a certain chance
Item.of('create:brass_ingot').withChance(2.0), // have this item be an output with a certain chance
'minecraft:andesite', // have this item be a guaranteed output
'create:cogwheel', // have this item be a guaranteed output
'minecraft:stick', // have this item be a guaranteed output
'minecraft:iron_nugget' // have this item be a guaranteed output
], 'create:brass_ingot', [ // 'create:brass_ingot' is the input.
// the transitional item set by "transitionalItem('create:incomplete_large_cogwheel')" is the item that will be used during the recipe as the item that the input is using to transition to the output.
event.recipes.createDeploying('create:incomplete_large_cogwheel', ['create:incomplete_large_cogwheel', '#minecraft:planks']), // like a normal recipe function, is used as a sequence step in this array. Input and output have the transitional item
event.recipes.createDeploying('create:incomplete_large_cogwheel', ['create:incomplete_large_cogwheel', '#minecraft:wooden_buttons']), // like a normal recipe function, is used as a sequence step in this array. Input and output have the transitional item
event.recipes.createCutting('create:incomplete_large_cogwheel', 'create:incomplete_large_cogwheel').processingTime(50) // like a normal recipe function, is used as a sequence step in this array. Input and output have the transitional item
]).transitionalItem('create:incomplete_large_cogwheel').loops(6) // set the transitional item and the loops (amount of repetitions)
If you want to use your own transitional item in sequenced_assembly recipes, you must register it in startup event:
onEvent('item.registry', event => {
// Texture for this item goes in kubejs/assets/kubejs/textures/item/my_part.png
event.create('my_part', 'create:sequenced_assembly').displayName('My Part')
})
Then you would use ...transitionalItem('kubejs:my_part')...
Note! Mysterious Conversion recipes are client side only, so the only way to add them currently is using reflection with this code in client scripts (outside any event):
let MysteriousItemConversionCategory = java('com.simibubi.create.compat.jei.category.MysteriousItemConversionCategory')
let ConversionRecipe = java('com.simibubi.create.compat.jei.ConversionRecipe')
MysteriousItemConversionCategory.RECIPES.add(ConversionRecipe.create('minecraft:apple', 'minecraft:carrot'))
MysteriousItemConversionCategory.RECIPES.add(ConversionRecipe.create('minecraft:golden_apple', 'minecraft:golden_carrot'))


评论 0
登录后参与评分
还没有评论,来抢沙发吧