Skip to content

Commit

Permalink
New translations blockstates.md (Chinese Simplified)
Browse files Browse the repository at this point in the history
  • Loading branch information
FabricMCBot committed Jan 17, 2025
1 parent a45213c commit d127478
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions translated/zh_cn/develop/blocks/blockstates.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Minecraft 已经有些自定义的类,允许你快速创建特定类型的方

`condensed_oak_log_horizontal.json` 文件的示例:

@[code](@/reference/latest/src/main/resources/assets/fabric-docs-reference/models/block/condensed_oak_log_horizontal.json)
@[code](@/reference/latest/src/main/generated/assets/fabric-docs-reference/models/block/condensed_oak_log_horizontal.json)

---

Expand All @@ -56,7 +56,7 @@ Remember, blockstate files can be found in the `assets/<mod id here>/blockstates
- `axis=y` - 方块沿 Y 轴旋转时,使用正常的垂直模型。
- `axis=z` - 方块沿Z 轴放置时,旋转模型以朝向正 X 方向。

@[code](@/reference/latest/src/main/resources/assets/fabric-docs-reference/blockstates/condensed_oak_log.json)
@[code](@/reference/latest/src/main/generated/assets/fabric-docs-reference/blockstates/condensed_oak_log.json)

同样,需要为你的方块创建翻译,以及继承了这两个模型中的任意一个的物品模型。

Expand All @@ -82,10 +82,6 @@ Remember, blockstate files can be found in the `assets/<mod id here>/blockstates

@[code transcludeWith=:::3](@/reference/latest/src/main/java/com/example/docs/block/custom/PrismarineLampBlock.java)

:::warning
别忘了注册方块时使用自定义的类而不是 `Block`
:::

### 使用属性{#using-the-property}

这个例子会在玩家与方块交互时,翻转 `activated` 属性的布尔值。 我们可以为此覆盖 `onUse` 方法:
Expand All @@ -108,6 +104,10 @@ Remember, blockstate files can be found in the `assets/<mod id here>/blockstates

@[code](@/reference/latest/src/main/resources/assets/fabric-docs-reference/blockstates/prismarine_lamp.json)

:::tip
不要忘记为方块添加[物品模型描述](../items/first-item#creating-the-item-model-description),以便它在物品栏中显示!
:::

---

因为这个示例方块是灯,所以还需要让它在 `activated` 属性为 true 时发光。 可以通过在注册方块时传入构造器的 block settings 来完成。
Expand Down

0 comments on commit d127478

Please sign in to comment.