Skip to content

Recipes

GTCEu has a great recipe structure. Adding and removing is pretty much the same for each machine. Recipes for a machine are stored in a RecipeMap. You can get a recipe map like this:

groovy
def recipeMap = mods.gregtech.recipe_map_name
// this works also:
def recipeMap2 = recipemap('recipe_map_name')

You can find a list of all machines here.
Let's use alloy_smelter as an example here. With the recipe map you can create a recipe builder.

groovy
mods.gregtech.alloy_smelter.recipeBuilder()

You don't know what a builder is? Check this out.

Builder functions

GregTechs recipe builder has tons of helper functions. We'll only focus on the important ones.

Adding inputs

Works for fluid and items

groovy
inputs(IIngredient ingredient)
inputs(IIngredient... ingredients)
inputs(Collection<IIngredient> ingredients)
notConsumable(IIngredient ingredient) // this will not be consumed

Adding outputs

groovy
outputs(ItemStack)
outputs(ItemStack...)
outputs(Collection<ItemStack>)
chancedOutput(ItemStack, int chance, int tierChanceBoost) // this will not be consumed

fluidOutputs(FluidStack)
fluidOutputs(FluidStack...)
fluidOutputs(Collection<FluidStack>)

Other

groovy
duration(int duration) // base recipe duration int ticks (20 ticks = 1 sec)
EUt(int EUt)
hidden() // hides recipe in jei

cleanroom(CleanroomType) // makes the recipe require cleanroom

Register recipe

groovy
buildAndRegister()

Example

groovy
import gregtech.api.metatileentity.multiblock.CleanroomType // needed when you want to use cleanroom

mods.gregtech.alloy_smelter.recipeBuilder()
    .inputs(item('minecraft:dirt'), ore('stone'))
    .outputs(item('minecraft:nether_star') * 2)
    .cleanroom(CleanroomType.CLEANROOM) // CLEANROOM and STERILE_CLEANROOM are valid
    .duration(200) // 10 seconds
    .EUt(512) // HV recipe
    .buildAndRegister()

贡献者

© 2024 CleanroomMC. All Rights Reserved.

布局切换

调整 VitePress 的布局样式,以适配不同的阅读习惯和屏幕环境。

全部展开
使侧边栏和内容区域占据整个屏幕的全部宽度。
全部展开,但侧边栏宽度可调
侧边栏宽度可调,但内容区域宽度不变,调整后的侧边栏将可以占据整个屏幕的最大宽度。
全部展开,且侧边栏和内容区域宽度均可调
侧边栏宽度可调,但内容区域宽度不变,调整后的侧边栏将可以占据整个屏幕的最大宽度。
原始宽度
原始的 VitePress 默认布局宽度

页面最大宽度

调整 VitePress 布局中页面的宽度,以适配不同的阅读习惯和屏幕环境。

调整页面最大宽度
一个可调整的滑块,用于选择和自定义页面最大宽度。

内容最大宽度

调整 VitePress 布局中内容区域的宽度,以适配不同的阅读习惯和屏幕环境。

调整内容最大宽度
一个可调整的滑块,用于选择和自定义内容最大宽度。

聚光灯

支持在正文中高亮当前鼠标悬停的行和元素,以优化阅读和专注困难的用户的阅读体验。

ON开启
开启聚光灯。
OFF关闭
关闭聚光灯。

聚光灯样式

调整聚光灯的样式。

置于底部
在当前鼠标悬停的元素下方添加一个纯色背景以突出显示当前鼠标悬停的位置。
置于侧边
在当前鼠标悬停的元素旁边添加一条固定的纯色线以突出显示当前鼠标悬停的位置。