跳到正文

KubeJS Create

作者:Lat

KubeJS 机械动力集成

收藏

介绍

介绍由机器翻译自 CurseForge 原页面,仅供参考。
  1. 机械动力 与 KubeJS 的集成。此模组允许你在 KubeJS 脚本中添加并正确编辑机械动力模组的配方。所有支持的配方类型和示例如下。更多信息请参阅 配方页面 。

 

支持的配方类型:

 
– createCrushing
– createCutting
– createMilling
– createBasin
– createMixing(支持 .heated() 和 .superheated())
– createCompacting(支持 .heated() 和 .superheated())
– createPressing
– createSandpaperPolishing
– createSplashing(批量洗涤)
– createDeploying
– createFilling
– createEmptying

注意:批量烟熏 = 原版烟熏,批量高炉冶炼 = 原版高炉冶炼配方类型。

event.recipes.createCrushing(output[], input[])
输出不必是数组。可以是物品或流体
输入不必是数组。可以是原料或 Fluid.of(‘minecraft:water’, 1000) 或 {fluidTag: ‘some:fluid_tag’, amount: 1000}

– createMechanicalCrafting

event.recipes.createMechanicalCrafting(output, pattern[], {patternKey: input})
此配方类型与普通工作台有序配方相同

– createSequencedAssembly

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([ // 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)

 

如果你想在 sequenced_assembly 配方中使用自定义的过渡物品,必须在 startup 事件中注册它:

 

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’)

})

 

然后使用 …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’))

 

评论

登录后评论和评分

Lat 的其他作品

查看全部 →