Skip to content

Grindstone (Astral Sorcery)

Description

Converts an item into an itemstack with a chance of getting twice the amount after right clicking the grindstone based on weight.

Identifier

Refer to this via any of the following:

groovy
mods.astralsorcery.grindstone/* Used as page default */
mods.astralsorcery.Grindstone
mods.astral.grindstone
mods.astral.Grindstone

Adding Recipes

  • Adds a recipe in the format of input, output, weight, with the secondaryChance being 0:

    groovy
    mods.astralsorcery.grindstone.add(ItemHandle, ItemStack, int)
  • Adds a recipe in the format of input, output, weight, secondaryChance:

    groovy
    mods.astralsorcery.grindstone.add(ItemHandle, ItemStack, int, float)

Recipe Builder

Just like other recipe types, the Grindstone also uses a recipe builder.

Don't know what a builder is? Check the builder info page out.

mods.astralsorcery.grindstone.recipeBuilder()
  • IngredientList<IIngredient>. Sets the item inputs of the recipe. Requires exactly 1.

    groovy
    input(IIngredient)
    input(IIngredient...)
    input(Collection<IIngredient>)
  • ItemStackList. Sets the item outputs of the recipe. Requires exactly 1.

    groovy
    output(ItemStack)
    output(ItemStack...)
    output(Collection<ItemStack>)
  • int. Sets how many interactions it takes to process the recipe. Requires greater than or equal to 0. (Default 0).

    groovy
    weight(int)
  • float. Sets the chance of an additional output. Requires greater than or equal to 0 and less than or equal to 1. (Default 0.0f).

    groovy
    secondaryChance(float)
  • First validates the builder, returning null and outputting errors to the log file if the validation failed, then registers the builder and returns the registered object. (returns null or hellfirepvp.astralsorcery.common.crafting.grindstone.GrindstoneRecipe).

    groovy
    register()
Example
groovy
mods.astralsorcery.grindstone.recipeBuilder()
    .input(ore('blockDiamond'))
    .output(item('minecraft:clay'))
    .weight(1)
    .secondaryChance(1.0F)
    .register()

mods.astralsorcery.grindstone.recipeBuilder()
    .input(item('minecraft:stone'))
    .output(item('minecraft:cobblestone'))
    .weight(5)
    .register()

Removing Recipes

  • Removes all recipes that match the given input:

    groovy
    mods.astralsorcery.grindstone.removeByInput(ItemStack)
  • Removes all recipes that match the given output:

    groovy
    mods.astralsorcery.grindstone.removeByOutput(ItemStack)
  • Removes all recipes that match the given output:

    groovy
    mods.astralsorcery.grindstone.removeByOutput(OreDictIngredient)
  • Removes all registered recipes:

    groovy
    mods.astralsorcery.grindstone.removeAll()
Example
groovy
mods.astralsorcery.grindstone.removeByInput(item('minecraft:redstone_ore'))
mods.astralsorcery.grindstone.removeByOutput(ore('dustIron'))
mods.astralsorcery.grindstone.removeAll()

Getting the value of recipes

  • Iterates through every entry in the registry, with the ability to call remove on any element to remove it:

    groovy
    mods.astralsorcery.grindstone.streamRecipes()

贡献者

© 2024 CleanroomMC. All Rights Reserved.

布局切换

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

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

页面最大宽度

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

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

内容最大宽度

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

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

聚光灯

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

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

聚光灯样式

调整聚光灯的样式。

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