自定义酿造配方

自定义酿造配方

一个让开发者能够轻松添加支持NBT数据的非药水酿造配方的Fabric模组!

CustomBrewRecipes

一个 Fabric 模组,允许开发者创建新的酿造配方,并且还支持自定义的非药水物品以及组件(Components)或 NBT 数据。

详细说明可以在 javadoc 中找到,但你只需要调用

CustomBrewRecipeRegister.registerCustomRecipe()

并提供配方所需的物品即可。

或者,如果你需要自定义组件,请使用

CustomBrewRecipeRegister.registerCustomRecipeWithComponents()

并使用已经带有自定义组件的物品堆(itemstack),或者将 NBT 提供给该方法。

还有一个 NBT 版本的方法,它会将内容保存到 CustomData 组件中。

你也可以检测组件类型(或 nbt 字段)是否存在,而不是检测它们的值!

CustomBrewRecipeRegister.registerCustomRecipeWithComponentPrescence()

注意:输出物品仍然需要拥有完整的 ComponentMap/NBT,因为它才是将要被创建的那个物品!

你也可以同时检测字段/组件是否存在以及特定值!你需要使用

CustomBrewRecipeRegister.registerCustomRecipeWithComponentType();

注意:输出物品仍然需要拥有完整的 ComponentMap/NBT,因为它才是将要被创建的那个物品!

nodecraft

设置

你可以通过在 build.gradle 中添加以下内容将其添加到你的项目中:

repositories {
    maven {
        name = "Modrinth"
        url = "https://api.modrinth.com/maven"
        content {
            includeGroup "maven.modrinth"
        }
    }
}

dependencies {
    modImplementation "maven.modrinth:custombrewrecipes:<version>"
}

许可证

本模组在 CC0 许可证下可用。