zh_cn:tutorial:crops
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| zh_cn:tutorial:crops [2025/04/01 11:45] – solidblock | zh_cn:tutorial:crops [2025/04/01 12:05] (current) – fix typo solidblock | ||
|---|---|---|---|
| Line 70: | Line 70: | ||
| | | ||
| // 对于 1.21.2 及之后的版本: | // 对于 1.21.2 及之后的版本: | ||
| - | public static final Item CUSTOM_SEEDS = register(" | + | public static final Item CUSTOM_SEEDS = register(" |
| + | </ | ||
| + | |||
| + | > 在[[blocks|添加方块]]教程中,我们写的 '' | ||
| + | > <code java TutorialBlocks.java> | ||
| + | // ... | ||
| + | public static final Block CUSTOM_CROP = registerBlockOnly(" | ||
| + | |||
| + | // ... | ||
| + | |||
| + | private static Block registerBlockOnly(String path, Function< | ||
| + | final Identifier identifier = Identifier.of(" | ||
| + | final RegistryKey< | ||
| + | |||
| + | return Blocks.register(registryKey, | ||
| + | } | ||
| </ | </ | ||
| Line 100: | Line 115: | ||
| </ | </ | ||
| - | 最后,您还需要为您的作物创建方块状态,以给作物的每个生长阶段都注册单独的模型。 | + | 最后,您还需要为您的作物创建方块状态映射,以给作物的每个生长阶段都分配单独的模型。 |
| <code JavaScript src/ | <code JavaScript src/ | ||
| Line 132: | Line 147: | ||
| } | } | ||
| </ | </ | ||
| + | |||
| + | > 种子物品也需要对应的物品模型和物品模型映射(对于 1.21.4 及之后的版本),具体做法参见 [[items]],这里不作详细描述。 | ||
| ===== 战利品表 ===== | ===== 战利品表 ===== | ||
zh_cn/tutorial/crops.1743507925.txt.gz · Last modified: 2025/04/01 11:45 by solidblock