zh_cn:tutorial:itemgroup
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
zh_cn:tutorial:itemgroup [2020/11/11 14:56] – [创建简单物品组] 拒绝机翻,从我做起! solidblock | zh_cn:tutorial:itemgroup [2020/11/11 15:00] – [使物品组按特定顺序显示特定项目] solidblock | ||
---|---|---|---|
Line 26: | Line 26: | ||
</ | </ | ||
- | ==== 使物品组按特定顺序显示特定项目 | + | ==== 使物品组按特定顺序显示特定物品 |
- | 调用'' | + | 调用'' |
- | <code java [enable_line_numbers=" | + | <code java [enable_line_numbers=" |
- | public class ExampleMod implements ModInitializer | + | public class ExampleMod implements ModInitializer { |
- | { | + | |
- | // ... | + | |
public static final ItemGroup ITEM_GROUP = FabricItemGroupBuilder.build( | public static final ItemGroup ITEM_GROUP = FabricItemGroupBuilder.build( | ||
new Identifier(" | new Identifier(" | ||
Line 39: | Line 38: | ||
new Identifier(" | new Identifier(" | ||
.icon(() -> new ItemStack(Items.BOWL)) | .icon(() -> new ItemStack(Items.BOWL)) | ||
- | .appendItems(stacks -> | + | .appendItems(stacks -> { |
- | { | + | |
stacks.add(new ItemStack(Blocks.BONE_BLOCK)); | stacks.add(new ItemStack(Blocks.BONE_BLOCK)); | ||
stacks.add(new ItemStack(Items.APPLE)); | stacks.add(new ItemStack(Items.APPLE)); |
zh_cn/tutorial/itemgroup.txt · Last modified: 2023/11/18 08:09 by solidblock