zh_cn:tutorial:datagen_model
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
zh_cn:tutorial:datagen_model [2023/02/17 15:20] – created hanatomizu | zh_cn:tutorial:datagen_model [2023/02/20 05:17] – [添加物品模型] Please do not use machine translation solidblock | ||
---|---|---|---|
Line 34: | Line 34: | ||
=====添加方块模型===== | =====添加方块模型===== | ||
- | '' | + | '' |
<code java> | <code java> | ||
- | public static Block SIMPLE_BLOCK = Registry.register(Registry.BLOCK, new Identifier(" | + | public static Block SIMPLE_BLOCK = Registry.register(Registries.BLOCK, new Identifier(" |
- | public static BlockItem SIMPLE_BLOCK_ITEM = Registry.register(Registry.ITEM, ..., new BlockItem(SIMPLE_BLOCK, | + | public static BlockItem SIMPLE_BLOCK_ITEM = Registry.register(Registries.ITEM, ..., new BlockItem(SIMPLE_BLOCK, |
// ... | // ... | ||
Line 47: | Line 47: | ||
</ | </ | ||
- | 因为 '' | + | 因为 '' |
====严格验证===== | ====严格验证===== | ||
- | 默认情况下,如果运行没有为所有属于已处理 | + | 默认情况下,如果运行过程中,没有为所有属于被处理的模组的方块生成方块状态,数据生成将报错。Fabric API 允许禁用该功能,为此,请编辑你的 '' |
=====添加物品模型===== | =====添加物品模型===== | ||
'' | '' | ||
- | 在这个例子中,我们重写上一个例子中的 '' | + | 在这个例子中,我们重写上一个例子中的 '' |
<code java> | <code java> | ||
- | public static Block SIMPLE_BLOCK = Registry.register(Registry.BLOCK, new Identifier(" | + | public static Block SIMPLE_BLOCK = Registry.register(Registries.BLOCK, new Identifier(" |
- | public static BlockItem SIMPLE_BLOCK_ITEM = Registry.register(Registry.ITEM, ..., new BlockItem(SIMPLE_BLOCK, | + | public static BlockItem SIMPLE_BLOCK_ITEM = Registry.register(Registries.ITEM, ..., new BlockItem(SIMPLE_BLOCK, |
// ... | // ... | ||
zh_cn/tutorial/datagen_model.txt · Last modified: 2023/02/24 10:41 by hanatomizu