跳到正文

KubeJS Industrial Foregoing (Neoforge)

作者:NadienDev

Industrial Foregoing 的 KubeJS 附属模组

收藏

介绍

介绍由机器翻译自 CurseForge 原页面,仅供参考。

KubeJS 工业先锋 NeoForge

一个 KubeJS 附属模组,可让你为 Industrial Foregoing编写配方,并创建自己的机器升级。

要求

  • KubeJS
  • Industrial Foregoing
  • Minecraft 1.21.1
  • NeoForge 21.1.240

配方

将以下内容放入 kubejs/server_scripts/:

ServerEvents.recipes(event => {

    // Crusher (the pickaxe action in the Stonework Factory)
    event.recipes.industrialforegoing.crusher(
        'minecraft:gravel',      // output  <- note: output comes first
        'minecraft:cobblestone'  // input
    )

    // Dissolution Chamber
    event.recipes.industrialforegoing.dissolution_chamber(
        ['minecraft:dirt', 'minecraft:sand'], // input items, may be empty
        Fluid.of('minecraft:water', 500),     // input fluid
        Item.of('minecraft:diamond', 2),      // output item
        200                                   // time in ticks
    ).outputFluid(Fluid.of('minecraft:lava', 100)) // optional

    // Fluid Extractor
    event.recipes.industrialforegoing.fluid_extractor(
        'minecraft:oak_log',           // block being tapped
        'minecraft:stripped_oak_log',  // block left behind
        0.05,                          // break chance, 0.0 - 1.0
        Fluid.of('industrialforegoing:latex', 8)
    )

    // Stonework Factory - generate
    event.recipes.industrialforegoing.stonework_generate(
        'minecraft:obsidian',
        1000, 1000,  // water / lava needed
        0, 1000      // water / lava consumed
    )

    // Laser Drill - ore
    event.recipes.industrialforegoing.laser_drill_ore(
        { item: 'minecraft:diamond', count: 1 }, // output
        'industrialforegoing:red_laser_lens',    // catalyst lens
        [{
            biome_filter:     { whitelist: [], blacklist: [] },
            dimension_filter: { whitelist: [], blacklist: ['minecraft:the_end'] },
            depth_min: 0,
            depth_max: 255,
            weight: 5  // higher = more common
        }]
    )

    // Laser Drill - fluid
    event.recipes.industrialforegoing.laser_drill_fluid(
        Fluid.of('industrialforegoing:ether_gas', 10), // output
        'industrialforegoing:purple_laser_lens',       // catalyst lens
        [{
            biome_filter:     { whitelist: [], blacklist: [] },
            dimension_filter: { whitelist: [], blacklist: [] },
            depth_min: -64,
            depth_max: 256,
            weight: 8
        }],
        { entity: { type: 'minecraft:wither' }, data: {}, display: '' } // optional
    )
})

Rarity 是一个列表,因此同一种矿石在不同深度可以有不同权重。五个字段都必须填写——Industrial Foregoing 的编解码器没有默认值。

移除使用模组相同的键:

event.remove({ type: 'industrialforegoing:laser_drill_ore', output: 'minecraft:diamond' })

机器升级

注册全新的效率、速度、处理和范围升级。这是一种启动物品类型,因此要放入 kubejs/startup_scripts/:

StartupEvents.registry('item', event => {
    event.create('netherite_speed_addon', 'industrialforegoing:addon')
        .speedTier(4)                          // matches IF's tier formulas
        .displayName('Netherite Speed Addon')

    event.create('hybrid_addon', 'industrialforegoing:addon')
        .speed(3)         // or set raw augment values
        .efficiency(0.5)  // lower is better
        .processing(2)
        .rarity('epic')
})
原始值 阶级预设 升级组件
speed(v) speedTier(n) → 1 + n 速度
efficiency(v) efficiencyTier(n) → 1 - n * 0.1 效率
processing(v) processingTier(n) → 1 + n 加工
range(v) rangeTier(n) → n 范围
augment(type, v) — 任何类型,包括其他模组的类型

其效果与内置升级组件完全一致:

  • 工具提示使用 Industrial Foregoing 自身的翻译键生成,因此与原版升级组件保持一致,并遵循游戏语言设置
  • 右键点击机器即可直接装入升级组件
  • 默认带有纹理使用 Industrial Foregoing 的升级组件纹理——在调用 .texture(...)
  • 之前无需资源包。数量可叠加至 16,其他所有 KubeJS 物品构建器方法(displayName、maxStackSize、rarity、tooltip、glow 等)也都照常可用

像其他物品一样为它添加配方:

ServerEvents.recipes(event => {
    event.recipes.industrialforegoing.dissolution_chamber(
        ['minecraft:redstone', 'minecraft:glass_pane', '#c:gears/diamond', 'minecraft:sugar'],
        Fluid.of('industrialforegoing:latex', 1000),
        'kubejs:netherite_speed_addon',
        200
    )
})

致谢

特别感谢:

  • LatvianModder — 感谢创建了 KubeJS,这个整合包中整个升级组件所基于的脚本模组
  • Buuz135 — 感谢创建了 Industrial Foregoing,这些配方和升级组件所接入的模组

这个升级组件只是连接这两个项目的桥梁。请支持他们。


完整文档、参数表及其余详情请见仓库中的 WIKI。

常见问题

KubeJS Industrial Foregoing (Neoforge) 支持哪些 Minecraft 版本?

KubeJS Industrial Foregoing (Neoforge) 支持 Minecraft Java 版 1.21–1.21.1,共 2 个版本,可用的加载器:NeoForge。下载时注意选择和你游戏版本一致的文件。

KubeJS Industrial Foregoing (Neoforge) 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。

评论

登录后评论和评分

NadienDev 的其他作品

查看全部 →