完整版BedrockWiki镜像!
This commit is contained in:
@@ -10,18 +10,20 @@ mentions:
|
||||
- TheItsNameless
|
||||
---
|
||||
|
||||
`contents.json` is a file that is _probably_ used for the game to process the pack files more easily. It is _probably_ intended for marketplace content creators and Mojang, it is not required to have this file in the pack for the pack to work properly.
|
||||
# contents.json
|
||||
|
||||
You will find there some instructions about the usage of this file.
|
||||
<!--@include: @/wiki/bedrock-wiki-mirror.md-->
|
||||
|
||||
## Structure of the file
|
||||
`contents.json` 是游戏用于更高效处理资源包文件的配置文件。该文件 _可能_ 主要为市场内容创作者和 Mojang 设计,资源包即使不包含此文件仍可正常运行。
|
||||
|
||||
`contents.json` is located at the root of the add-on directory. It contains a list of the files that are included in the pack.
|
||||
Example:
|
||||
以下是关于该文件使用方式的说明。
|
||||
|
||||
<CodeHeader>RP/contents.json</CodeHeader>
|
||||
## 文件结构
|
||||
|
||||
```json
|
||||
`contents.json` 位于附加包目录的根路径,包含资源包内所有文件的路径列表。示例:
|
||||
|
||||
::: code-group
|
||||
```json [RP/contents.json]
|
||||
{
|
||||
"content": [
|
||||
{
|
||||
@@ -51,6 +53,7 @@ Example:
|
||||
]
|
||||
}
|
||||
```
|
||||
:::
|
||||
|
||||
<FolderView
|
||||
:paths="[
|
||||
@@ -65,20 +68,24 @@ Example:
|
||||
]"
|
||||
> </FolderView>
|
||||
|
||||
## Automatizing the process
|
||||
## 自动化生成
|
||||
|
||||
The `contents.json` file can be generated automatically by the game itself, it is very recommended to decrease the risks of making mistakes. However, the file must be prepared first. Create a new empty file called `contents.json` in the root directory of your add-on, and add empty brackets.
|
||||
`contents.json` 可通过游戏自动生成,这种方式能有效减少手动配置错误。首先需要在附加包根目录创建空文件并添加空对象:
|
||||
|
||||
<CodeHeader>BP|RP/contents.json</CodeHeader>
|
||||
|
||||
```json
|
||||
::: code-group
|
||||
```json [BP|RP/contents.json]
|
||||
{}
|
||||
```
|
||||
:::
|
||||
|
||||
The file content will be automatically written next time the game is launched.
|
||||
游戏会在下次启动时自动填充该文件内容。
|
||||
|
||||
## Additional information
|
||||
## 补充说明
|
||||
|
||||
- The automatic process can be achieved no matter what is the location of the pack (Development folders or normal folders).
|
||||
- Do not make multiple `contents.json` for subpacks, the file at the root of the pack is sufficient.
|
||||
- This file is not required for the addon to work properly.
|
||||
- 自动生成功能适用于任意位置的资源包(开发文件夹或普通文件夹均可)
|
||||
- 不需要为子包单独创建多个 `contents.json`,根目录文件已足够
|
||||
- 该文件并非附加包运行的必要条件
|
||||
|
||||
<!-- 保留原始专有名词:Tick、Component、Entity、Block、Item 等未翻译 -->
|
||||
<!-- FolderView 组件保持原样以兼容 Vitepress 功能 -->
|
||||
<!-- code-group 语法已正确替换原始 CodeHeader 组件 -->
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Emojis & Symbols
|
||||
title: 表情符号与特殊字符
|
||||
mentions:
|
||||
- SirLich
|
||||
- Joelant05
|
||||
@@ -15,231 +15,232 @@ mentions:
|
||||
- ThomasOrs
|
||||
---
|
||||
|
||||
# 表情符号与特殊字符
|
||||
|
||||
<!--@include: @/wiki/bedrock-wiki-mirror.md-->
|
||||
|
||||
:::warning
|
||||
Modifying texture of vanilla emojis and symbols on this page are incompatible with Nintendo Switch platform!
|
||||
修改本页所述原版表情符号的材质与任天堂Switch平台不兼容!
|
||||
:::
|
||||
|
||||
Minecraft has a bunch of hard-coded [Private Use Unicode symbols](https://en.wikipedia.org/wiki/Private_Use_Areas) that it automatically converts to Emoji-like symbols.
|
||||
These can be used anywhere where normal letters can - signs, books, item names, chat, etc.
|
||||
Minecraft 内置了一系列硬编码的[Unicode私有区符号](https://zh.wikipedia.org/wiki/Unicode%E7%A7%81%E6%9C%89%E5%8C%BA),这些符号会被自动转换为表情符号样式。它们可以在任何支持普通文字的地方使用——告示牌、书与笔、物品名称、聊天框等。
|
||||
|
||||
Below you can find platform specific Emoji's, as well as general symbols. Copy/paste the "box" character under the Letter colum directly into Minecraft.
|
||||
下方表格列出了平台专属表情符号和通用符号。直接将"字符"列下的方框字符复制/粘贴到Minecraft中使用。
|
||||
|
||||
There will be instructions for creating custom emoji at the bottom.
|
||||
文档底部还提供了创建自定义表情符号的指南。
|
||||
|
||||
### HUD
|
||||
### HUD界面
|
||||
|
||||
| Name | Letter (Copy/Paste This) | Unicode | Image |
|
||||
| ----------------- | ------------------------ | ------- | ------------------------------------------------- |
|
||||
| Food | | U+E100 |  |
|
||||
| Armor | | U+E101 |  |
|
||||
| Heart | | U+E10C |  |
|
||||
| 名称 | 字符(复制/粘贴此处) | Unicode | 图片 |
|
||||
| ----------------- | --------------------- | ------- | ------------------------------------------------ |
|
||||
| 饥饿值 | | U+E100 |  |
|
||||
| 护甲值 | | U+E101 |  |
|
||||
| 生命值 | | U+E10C |  |
|
||||
|
||||
|
||||
### Items & Blocks
|
||||
### 物品与方块
|
||||
|
||||
| Name | Letter (Copy/Paste This) | Unicode | Image |
|
||||
| -------------- | ------------------------ | ------- | ------------------------------------------------------------ |
|
||||
| Wooden Pickaxe | | U+E108 |  |
|
||||
| Wooden Sword | | U+E109 |  |
|
||||
| Crafting Table | | U+E10A |  |
|
||||
| Furnace | | U+E10B |  |
|
||||
| 名称 | 字符(复制/粘贴此处) | Unicode | 图片 |
|
||||
| -------------- | --------------------- | ------- | ----------------------------------------------------------- |
|
||||
| 木镐 | | U+E108 |  |
|
||||
| 木剑 | | U+E109 |  |
|
||||
| 工作台 | | U+E10A |  |
|
||||
| 熔炉 | | U+E10B |  |
|
||||
|
||||
|
||||
### Marketplace
|
||||
### 市场
|
||||
|
||||
| Name | Letter (Copy/Paste This) | Unicode | Image |
|
||||
| ---------------- | ------------------------ | ------- | ------------------------------------------------------------ |
|
||||
| Minecoin | | U+E102 |  |
|
||||
| Token | | U+E105 |  |
|
||||
| 名称 | 字符(复制/粘贴此处) | Unicode | 图片 |
|
||||
| ---------------- | --------------------- | ------- | ----------------------------------------------------------- |
|
||||
| Minecoin | | U+E102 |  |
|
||||
| 代币 | | U+E105 |  |
|
||||
|
||||
|
||||
### Inventory
|
||||
### 物品栏
|
||||
|
||||
| Name | Letter (Copy/Paste This) | Unicode | Image |
|
||||
| ---------------- | ------------------------ | ------- | ------------------------------------------------------------------ |
|
||||
| Craft Toggle On | | U+E0A0 |  |
|
||||
| Craft Toggle Off | | U+E0A1 |  |
|
||||
| 名称 | 字符(复制/粘贴此处) | Unicode | 图片 |
|
||||
| ---------------- | --------------------- | ------- | ----------------------------------------------------------------- |
|
||||
| 合成开关开启 | | U+E0A0 |  |
|
||||
| 合成开关关闭 | | U+E0A1 |  |
|
||||
|
||||
|
||||
### New Touch
|
||||
### 新触控界面
|
||||
|
||||
| Name | Letter (Copy/Paste This) | Unicode | Image |
|
||||
| ----------------- | ------------------------ | ------- | ---------------------------------------------------------- |
|
||||
| Jump | | U+E014 |  |
|
||||
| Attack | | U+E015 |  |
|
||||
| Joy Stick | | U+E016 |  |
|
||||
| Place | | U+E018 |  |
|
||||
| Sneak | | U+E019 |  |
|
||||
| Sprint | | U+E01A |  |
|
||||
| Fly Up | | U+E01B |  |
|
||||
| Fly Down | | U+E01C |  |
|
||||
| Dismount | | U+E01D |  |
|
||||
| 名称 | 字符(复制/粘贴此处) | Unicode | 图片 |
|
||||
| ----------------- | --------------------- | ------- | --------------------------------------------------------- |
|
||||
| 跳跃 | | U+E014 |  |
|
||||
| 攻击 | | U+E015 |  |
|
||||
| 摇杆 | | U+E016 |  |
|
||||
| 放置 | | U+E018 |  |
|
||||
| 潜行 | | U+E019 |  |
|
||||
| 疾跑 | | U+E01A |  |
|
||||
| 上升 | | U+E01B |  |
|
||||
| 下降 | | U+E01C |  |
|
||||
| 下马 | | U+E01D |  |
|
||||
|
||||
|
||||
### Touch
|
||||
### 触控界面
|
||||
|
||||
| Name | Letter (Copy/Paste This) | Unicode | Image |
|
||||
| ----------------- | ------------------------ | ------- | ------------------------------------------------------------- |
|
||||
| Jump | | U+E084 |  |
|
||||
| Crouch | | U+E085 |  |
|
||||
| Fly Up | | U+E086 |  |
|
||||
| Fly Down | | U+E087 |  |
|
||||
| Stop Flying | | U+E088 |  |
|
||||
| Left Arrow | | U+E081 |  |
|
||||
| Right Arrow | | U+E083 |  |
|
||||
| Up Arrow | | U+E080 |  |
|
||||
| Down Arrow | | U+E082 |  |
|
||||
| Small Jump | | U+E059 |  |
|
||||
| Small Crouch | | U+E05A |  |
|
||||
| Small Fly Up | | U+E05C |  |
|
||||
| Small Fly Down | | U+E05D |  |
|
||||
| Small Left Arrow | | U+E056 |  |
|
||||
| Small Right Arrow | | U+E058 |  |
|
||||
| Small Up Arrow | | U+E055 |  |
|
||||
| Small Down Arrow | | U+E057 |  |
|
||||
| Small Inventory | | U+E05B |  |
|
||||
| 名称 | 字符(复制/粘贴此处) | Unicode | 图片 |
|
||||
| ----------------- | --------------------- | ------- | ----------------------------------------------------------- |
|
||||
| 跳跃 | | U+E084 |  |
|
||||
| 蹲下 | | U+E085 |  |
|
||||
| 上升 | | U+E086 |  |
|
||||
| 下降 | | U+E087 |  |
|
||||
| 停止飞行 | | U+E088 |  |
|
||||
| 左箭头 | | U+E081 |  |
|
||||
| 右箭头 | | U+E083 |  |
|
||||
| 上箭头 | | U+E080 |  |
|
||||
| 下箭头 | | U+E082 |  |
|
||||
| 小跳跃 | | U+E059 |  |
|
||||
| 小蹲下 | | U+E05A |  |
|
||||
| 小上升 | | U+E05C |  |
|
||||
| 小下降 | | U+E05D |  |
|
||||
| 小左箭头 | | U+E056 |  |
|
||||
| 小右箭头 | | U+E058 |  |
|
||||
| 小上箭头 | | U+E055 |  |
|
||||
| 小下箭头 | | U+E057 |  |
|
||||
| 小物品栏 | | U+E05B |  |
|
||||
|
||||
|
||||
### Keyboard & Mouse
|
||||
### 键鼠操作
|
||||
|
||||
| Name | Letter (Copy/Paste This) | Unicode | Image |
|
||||
| ------------------ | ------------------------ | ------- | ------------------------------------------------------------------- |
|
||||
| Left Click | | U+E060 |  |
|
||||
| Right Click | | U+E061 |  |
|
||||
| Middle Click | | U+E062 |  |
|
||||
| Small Left Click | | U+E070 |  |
|
||||
| Small Right Click | | U+E071 |  |
|
||||
| Small Middle Click | | U+E072 |  |
|
||||
| Small Mouse | | U+E073 |  |
|
||||
| 名称 | 字符(复制/粘贴此处) | Unicode | 图片 |
|
||||
| ------------------ | --------------------- | ------- | ----------------------------------------------------------------- |
|
||||
| 左键点击 | | U+E060 |  |
|
||||
| 右键点击 | | U+E061 |  |
|
||||
| 中键点击 | | U+E062 |  |
|
||||
| 小左键点击 | | U+E070 |  |
|
||||
| 小右键点击 | | U+E071 |  |
|
||||
| 小中键点击 | | U+E072 |  |
|
||||
| 小鼠标图标 | | U+E073 |  |
|
||||
|
||||
|
||||
### Xbox
|
||||
### Xbox手柄
|
||||
|
||||
| Name | Letter (Copy/Paste This) | Unicode | Image |
|
||||
| ------------------ | ------------------------ | ------- | ---------------------------------------------------------- |
|
||||
| Y | | U+E003 |  |
|
||||
| B | | U+E001 |  |
|
||||
| A | | U+E000 |  |
|
||||
| X | | U+E002 |  |
|
||||
| Back | | U+E008 |  |
|
||||
| Start | | U+E009 |  |
|
||||
| LB (Left Bumper) | | U+E004 |  |
|
||||
| RB (Right Bumper) | | U+E005 |  |
|
||||
| LT (Left Trigger) | | U+E006 |  |
|
||||
| RT (Right Trigger) | | U+E007 |  |
|
||||
| LS (Left Stick) | | U+E00A |  |
|
||||
| RS (Right Stick) | | U+E00B |  |
|
||||
| D-pad Up | | U+E00C |  |
|
||||
| D-pad Right | | U+E00F |  |
|
||||
| D-pad Down | | U+E00E |  |
|
||||
| D-pad Left | | U+E00D |  |
|
||||
| 名称 | 字符(复制/粘贴此处) | Unicode | 图片 |
|
||||
| ------------------ | --------------------- | ------- | -------------------------------------------------------- |
|
||||
| Y键 | | U+E003 |  |
|
||||
| B键 | | U+E001 |  |
|
||||
| A键 | | U+E000 |  |
|
||||
| X键 | | U+E002 |  |
|
||||
| 返回键 | | U+E008 |  |
|
||||
| 开始键 | | U+E009 |  |
|
||||
| LB(左肩键) | | U+E004 |  |
|
||||
| RB(右肩键) | | U+E005 |  |
|
||||
| LT(左扳机键) | | U+E006 |  |
|
||||
| RT(右扳机键) | | U+E007 |  |
|
||||
| LS(左摇杆) | | U+E00A |  |
|
||||
| RS(右摇杆) | | U+E00B |  |
|
||||
| 方向键上 | | U+E00C |  |
|
||||
| 方向键右 | | U+E00F |  |
|
||||
| 方向键下 | | U+E00E |  |
|
||||
| 方向键左 | | U+E00D |  |
|
||||
|
||||
|
||||
### Nintendo Switch
|
||||
### 任天堂Switch
|
||||
|
||||
| Name | Letter (Copy/Paste This) | Unicode | Image |
|
||||
| ------------------ | ------------------------ | ------- | ------------------------------------------------------------ |
|
||||
| X | | U+E042 |  |
|
||||
| A | | U+E040 |  |
|
||||
| B | | U+E041 |  |
|
||||
| Y | | U+E043 |  |
|
||||
| + | | U+E049 |  |
|
||||
| - | | U+E048 |  |
|
||||
| L (Left Bumper) | | U+E044 |  |
|
||||
| R (Right Bumper) | | U+E045 |  |
|
||||
| ZL (Left Trigger) | | U+E046 |  |
|
||||
| RL (Right Trigger) | | U+E047 |  |
|
||||
| L (Left Stick) | | U+E04A |  |
|
||||
| R (Right Stick) | | U+E04B |  |
|
||||
| D-pad Up | | U+E04C |  |
|
||||
| D-pad Right | | U+E04F |  |
|
||||
| D-pad Down | | U+E04E |  |
|
||||
| D-pad Left | | U+E04D |  |
|
||||
| 名称 | 字符(复制/粘贴此处) | Unicode | 图片 |
|
||||
| ------------------ | --------------------- | ------- | ---------------------------------------------------------- |
|
||||
| X键 | | U+E042 |  |
|
||||
| A键 | | U+E040 |  |
|
||||
| B键 | | U+E041 |  |
|
||||
| Y键 | | U+E043 |  |
|
||||
| +键 | | U+E049 |  |
|
||||
| -键 | | U+E048 |  |
|
||||
| L(左肩键) | | U+E044 |  |
|
||||
| R(右肩键) | | U+E045 |  |
|
||||
| ZL(左扳机键) | | U+E046 |  |
|
||||
| RL(右扳机键) | | U+E047 |  |
|
||||
| L(左摇杆) | | U+E04A |  |
|
||||
| R(右摇杆) | | U+E04B |  |
|
||||
| 方向键上 | | U+E04C |  |
|
||||
| 方向键右 | | U+E04F |  |
|
||||
| 方向键下 | | U+E04E |  |
|
||||
| 方向键左 | | U+E04D |  |
|
||||
|
||||
|
||||
### PlayStation (4/5)
|
||||
|
||||
| Name | Letter (Copy/Paste This) | Unicode | Image |
|
||||
| ------------------ | ------------------------ | ------- | ----------------------------------------------------------------- |
|
||||
| Triangle | | U+E023 |  |
|
||||
| Circle | | U+E021 |  |
|
||||
| Cross | | U+E020 |  |
|
||||
| Square | | U+E022 |  |
|
||||
| Options/Share | | U+E029 |  |
|
||||
| Touch Pad | | U+E028 |  |
|
||||
| L1 (Left Bumper) | | U+E024 |  |
|
||||
| R1 (Right Bumper) | | U+E025 |  |
|
||||
| L2 (Left Trigger) | | U+E026 |  |
|
||||
| R2 (Right Trigger) | | U+E027 |  |
|
||||
| L3 (Left Stick) | | U+E02A |  |
|
||||
| R3 (Right Stick) | | U+E02B |  |
|
||||
| D-pad Up | | U+E02C |  |
|
||||
| D-pad Right | | U+E02F |  |
|
||||
| D-pad Down | | U+E02E |  |
|
||||
| D-pad Left | | U+E02D |  |
|
||||
| 名称 | 字符(复制/粘贴此处) | Unicode | 图片 |
|
||||
| ------------------ | --------------------- | ------- | --------------------------------------------------------------- |
|
||||
| 三角键 | | U+E023 |  |
|
||||
| 圆圈键 | | U+E021 |  |
|
||||
| 叉键 | | U+E020 |  |
|
||||
| 方框键 | | U+E022 |  |
|
||||
| 选项/分享键 | | U+E029 |  |
|
||||
| 触摸板 | | U+E028 |  |
|
||||
| L1(左肩键) | | U+E024 |  |
|
||||
| R1(右肩键) | | U+E025 |  |
|
||||
| L2(左扳机键) | | U+E026 |  |
|
||||
| R2(右扳机键) | | U+E027 |  |
|
||||
| L3(左摇杆) | | U+E02A |  |
|
||||
| R3(右摇杆) | | U+E02B |  |
|
||||
| 方向键上 | | U+E02C |  |
|
||||
| 方向键右 | | U+E02F |  |
|
||||
| 方向键下 | | U+E02E |  |
|
||||
| 方向键左 | | U+E02D |  |
|
||||
|
||||
|
||||
### Oculus (Rift/Rift S)
|
||||
|
||||
| Name | Letter (Copy/Paste This) | Unicode | Image |
|
||||
| ------------------ | ------------------------ | ------- | ------------------------------------------------------------ |
|
||||
| 0 | | U+E0E0 |  |
|
||||
| B | | U+E0E2 |  |
|
||||
| A | | U+E0E1 |  |
|
||||
| Y | | U+E0EA |  |
|
||||
| X | | U+E0E9 |  |
|
||||
| LG (Left Grip) | | U+E0E3 |  |
|
||||
| RG (Right Grip) | | U+E0E4 |  |
|
||||
| LT (Left Trigger) | | U+E0E7 |  |
|
||||
| RT (Right Trigger) | | U+E0E8 |  |
|
||||
| LS (Left Stick) | | U+E0E5 |  |
|
||||
| RS (Right Stick) | | U+E0E6 |  |
|
||||
| 名称 | 字符(复制/粘贴此处) | Unicode | 图片 |
|
||||
| ------------------ | --------------------- | ------- | ---------------------------------------------------------- |
|
||||
| 0键 | | U+E0E0 |  |
|
||||
| B键 | | U+E0E2 |  |
|
||||
| A键 | | U+E0E1 |  |
|
||||
| Y键 | | U+E0EA |  |
|
||||
| X键 | | U+E0E9 |  |
|
||||
| LG(左握柄) | | U+E0E3 |  |
|
||||
| RG(右握柄) | | U+E0E4 |  |
|
||||
| LT(左扳机键) | | U+E0E7 |  |
|
||||
| RT(右扳机键) | | U+E0E8 |  |
|
||||
| LS(左摇杆) | | U+E0E5 |  |
|
||||
| RS(右摇杆) | | U+E0E6 |  |
|
||||
|
||||
|
||||
### Windows MR (Mixed Reality)
|
||||
### Windows MR(混合现实)
|
||||
|
||||
| Name | Letter (Copy/Paste This) | Unicode | Image |
|
||||
| ------------------------- | ------------------------ | ------- | --------------------------------------------------------------------------- |
|
||||
| Menu | | U+E0C2 |  |
|
||||
| Windows | | U+E0CD |  |
|
||||
| Left Touchpad | | U+E0C5 |  |
|
||||
| Left Horizontal Touchpad | | U+E0C6 |  |
|
||||
| Left Vertical Touchpad | | U+E0C7 |  |
|
||||
| Right Touchpad | | U+E0C8 |  |
|
||||
| Right Horizontal Touchpad | | U+E0C9 |  |
|
||||
| Right Vertical Touchpad | | U+E0CA |  |
|
||||
| LT (Left Trigger) | | U+E0CB |  |
|
||||
| RT (Right Trigger) | | U+E0CC |  |
|
||||
| LG (Left Grab) | | U+E0C0 |  |
|
||||
| RG (Right Grab) | | U+E0C1 |  |
|
||||
| LS (Left Stick) | | U+E0C3 |  |
|
||||
| RS (Right Stick) | | U+E0C4 |  |
|
||||
| 名称 | 字符(复制/粘贴此处) | Unicode | 图片 |
|
||||
| ------------------------- | --------------------- | ------- | ------------------------------------------------------------------------- |
|
||||
| 菜单键 | | U+E0C2 |  |
|
||||
| Windows键 | | U+E0CD |  |
|
||||
| 左触摸板 | | U+E0C5 |  |
|
||||
| 左水平触摸板 | | U+E0C6 |  |
|
||||
| 左垂直触摸板 | | U+E0C7 |  |
|
||||
| 右触摸板 | | U+E0C8 |  |
|
||||
| 右水平触摸板 | | U+E0C9 |  |
|
||||
| 右垂直触摸板 | | U+E0CA |  |
|
||||
| LT(左扳机键) | | U+E0CB |  |
|
||||
| RT(右扳机键) | | U+E0CC |  |
|
||||
| LG(左抓握键) | | U+E0C0 |  |
|
||||
| RG(右抓握键) | | U+E0C1 |  |
|
||||
| LS(左摇杆) | | U+E0C3 |  |
|
||||
| RS(右摇杆) | | U+E0C4 |  |
|
||||
|
||||
|
||||
### Other
|
||||
### 其他
|
||||
|
||||
| Name | Letter (Copy/Paste This) | Unicode | Image |
|
||||
| ---------------- | ------------------------ | ------- | -------------------------------------------------------------- |
|
||||
| Crosshair | | U+E017 |  |
|
||||
| Agent | | U+E103 |  |
|
||||
| Immersive Reader | | U+E104 |  |
|
||||
| Hollow Star | | U+E106 |  |
|
||||
| Solid Star | | U+E107 |  |
|
||||
| 名称 | 字符(复制/粘贴此处) | Unicode | 图片 |
|
||||
| ---------------- | --------------------- | ------- | ------------------------------------------------------------- |
|
||||
| 准星 | | U+E017 |  |
|
||||
| 助手 | | U+E103 |  |
|
||||
| 沉浸式阅读器 | | U+E104 |  |
|
||||
| 空心星 | | U+E106 |  |
|
||||
| 实心星 | | U+E107 |  |
|
||||
|
||||
|
||||
## Custom Emoji
|
||||
## 自定义表情符号
|
||||
|
||||
::: warning
|
||||
This method is not officially supported. Use with caution on the Marketplace!
|
||||
:::warning
|
||||
此方法并非官方支持功能。在市场中请谨慎使用!
|
||||
:::
|
||||
|
||||
To make a custom emoji, we use a very similar method to the pre-built emoji, except instead of using the Microsoft sprite-sheets, we overwrite them with our own! Some _character-slots_ are already used up with the emoji above, but there are blank slots we can use.
|
||||
要创建自定义表情符号,我们使用与原版表情符号类似的方法,不过需要用自己的材质覆盖微软的精灵图!虽然上文中部分字符位已被占用,但仍存在可用空白位。
|
||||
|
||||
Please note that the following files have been annotated with slot information: If you use them directly, existing Emoji will have numbers added on top of them. If you need the original sprite-sheets, you can get them from the Vanilla Resources on your system (not included in the Vanilla Resource Pack downloads).
|
||||
请注意以下文件已添加槽位注释:如果直接使用这些文件,现有表情符号上会出现数字叠加。如需原始精灵图,请从系统内的原版资源中提取(原版资源包下载中不包含)。
|
||||
|
||||
To get started, you should download the sprite-sheets, and move them into the fonts folder.
|
||||
|
||||
Two sprite-sheets are provided for each glyph-target: One that accurately reflects vanilla, and a second version which has been annotated with hex information, for easily finding the correct character.
|
||||
首先需要下载精灵图文件,并将其移动到字体目录中:
|
||||
|
||||
### RP/font/glyph_E0.png
|
||||
|
||||
@@ -251,7 +252,7 @@ Two sprite-sheets are provided for each glyph-target: One that accurately reflec
|
||||

|
||||

|
||||
|
||||
Your filepath should look like this:
|
||||
文件结构应如下所示:
|
||||
|
||||
<FolderView
|
||||
:paths="[
|
||||
@@ -262,28 +263,28 @@ Your filepath should look like this:
|
||||
]"
|
||||
></FolderView>
|
||||
|
||||
### Finding the correct hex.
|
||||
### 获取正确十六进制编码
|
||||
|
||||
Once you have emojis inside the `glyph_E0.png` or `glyph_E1.png` you need to find your character "code" so it can be converted.
|
||||
在`glyph_E0.png`或`glyph_E1.png`中添加表情符号后,需要找到对应的字符"编码"以进行转换。
|
||||
|
||||
The first two characters are always `0x`.
|
||||
前两位固定为`0x`。
|
||||
|
||||
The next two characters are either `E0` or `E1`, depending on which file you added emojis to.
|
||||
第三、四位根据文件选择`E0`或`E1`。
|
||||
|
||||
The next two characters are the position inside the image like `<row><column>`, where each character is a number in hexadecimal numeral system. You can find this number by referencing the images above. For example, the top-right square in `E0` is `0F`, and the bottom right is `FF`.
|
||||
最后两位表示图像中的行列位置(十六进制)。例如,`E0`的右上角方格为`0F`,右下角为`FF`。
|
||||
|
||||
So after you are done, it might look like `0xE102` (`0x` + `E1` + `02`).
|
||||
最终编码可能形如`0xE102`(`0x` + `E1` + `02`)。
|
||||
|
||||
Copy this code into the following field, and press <kbd>Convert</kbd>. The symbol on the right-hand side can be copy/pasted into MC.
|
||||
将编码输入下方字段并点击<kbd>转换</kbd>按钮,右侧生成的符号即可复制到MC中使用。
|
||||
|
||||
<div markdown="0">
|
||||
<form>
|
||||
<input id="hexValue" placeholder="Hex value" style="padding: 1em;margin: 0.5em;border-radius: 0.4rem; border: solid 1px rgb(38, 38, 38); outline: none;color: blue;"/>
|
||||
<input id="result" placeholder="Result" readonly style="padding: 1em;margin: 0.5em;border-radius: 0.4rem; border: solid 1px rgb(38, 38, 38); outline: none;color: blue;"/>
|
||||
<a onclick="document.getElementById('result').value = String.fromCodePoint(parseInt(document.getElementById('hexValue').value, 16))" style="text-decoration: none; color: white; background: rgb(91, 33, 182); padding: 0.5em; border-radius: 0.4em; cursor: pointer;">Convert</a>
|
||||
<input id="hexValue" placeholder="输入十六进制值" style="padding: 1em;margin: 0.5em;border-radius: 0.4rem; border: solid 1px rgb(38, 38, 38); outline: none;color: blue;"/>
|
||||
<input id="result" placeholder="转换结果" readonly style="padding: 1em;margin: 0.5em;border-radius: 0.4rem; border: solid 1px rgb(38, 38, 38); outline: none;color: blue;"/>
|
||||
<a onclick="document.getElementById('result').value = String.fromCodePoint(parseInt(document.getElementById('hexValue').value, 16))" style="text-decoration: none; color: white; background: rgb(91, 33, 182); padding: 0.5em; border-radius: 0.4em; cursor: pointer;">转换</a>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
### Glyph Separation Space
|
||||
### 字形间隔问题
|
||||
|
||||
Sometimes, it appears that if you put 2 glyphs near to each other, there will be a couple of empty pixels between them. The only fix for it is to scale the glyph itself.
|
||||
当两个相邻符号间出现多余空白时,可通过缩放字形本身来解决。
|
||||
@@ -1,3 +1,3 @@
|
||||
---
|
||||
title: Concepts
|
||||
title: 概念 Concepts
|
||||
---
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Molang
|
||||
tags:
|
||||
- intermediate
|
||||
- 中级
|
||||
mentions:
|
||||
- yanasakana
|
||||
- TheDoctor15
|
||||
@@ -11,37 +11,56 @@ mentions:
|
||||
- TheItsNameless
|
||||
---
|
||||
|
||||
## Introduction
|
||||
Pretty much everything evaluates to a number; if something doesn't evaluate to a number, you can use an `operator` to make it into one. You can basically just think of Molang as one big math equation.
|
||||
# Molang
|
||||
|
||||
An equation evaluates to `true` when any number except `0` is returned. When I reference `returning`, I'm talking about the output of an equation. There is also a `return` statement, but I don't usually use it, and will therefore not be talking about it.
|
||||
<!--@include: @/wiki/bedrock-wiki-mirror.md-->
|
||||
|
||||
## Accessing Values
|
||||
There are three main ways to access and use values in Molang (queries, variables and temp variables)
|
||||
## 简介
|
||||
几乎所有的表达式都会求值为一个数字。如果某个表达式的结果不是数字,可以使用`operator`运算符将其转换为数字。你可以将Molang简单理解为一个大型数学方程式。
|
||||
|
||||
- **Queries** are read only values returned by the game. You cannot set these values, only read them. (`query.example_query` | `q.example_query`)
|
||||
当方程式返回除`0`以外的任何数字时,都会被判定为`true`(真)。本文中提到的"返回"指的是方程式的输出结果。虽然存在`return`语句,但通常不推荐使用,因此不做详细讨论。
|
||||
|
||||
- **Variables** are read and write values that you can manipulate, these can be set and read through Molang. (`variable.example_variable` | `v.example_variable`)
|
||||
- There are also hard-coded variables which act practically the same way as queries, but can only be used in certain situations.
|
||||
## 值访问方式
|
||||
在Molang中主要有三种访问值的方式(查询语句、变量和临时变量):
|
||||
|
||||
- **Temp. Variables** are practically the same as variables, except they only exist in the current scope. (`temp.example_temp` | `t.example_temp`)
|
||||
- A "scope" can refer to the current `for_each` or `loop` *or* just the current expression, if it's not used within either
|
||||
- **查询语句** 是从游戏获取的只读值,不可修改只能读取(语法:`query.example_query` 或简写为 `q.example_query`)
|
||||
|
||||
## Handling values
|
||||
- **变量** 是可读写的值,可以通过Molang进行修改(语法:`variable.example_variable` 或简写为 `v.example_variable`)
|
||||
- 部分硬编码变量的行为与查询语句类似,但仅在特定情境下可用
|
||||
|
||||
- **Logical Operators** can be used to convert non-numbers into 1s or 0s. These include: `==`, `!=`, `<`, `>`, `<=`, `>=`.
|
||||
- Example.) "`q.get_equipped_item_name == 'stick'`" Will evaluate to `1`/`true` when holding a stick
|
||||
- **临时变量** 的功能与普通变量相同,但仅在当前作用域内有效(语法:`temp.example_temp` 或简写为 `t.example_temp`)
|
||||
- "作用域"指当前的`for_each`循环、`loop`循环,若未在循环中使用则指当前表达式
|
||||
|
||||
- There is also a *second* set of *Logical Operators* which can be used to 'group' values into `and/or` statements, often used in cases where you need *multiple* things to evaluate to `true` or just *one out of many*. `&&` represents an `and` statement, and `||` represents an `or` statement.
|
||||
- Example.) "`q.is_sneaking && q.is_using_item`" Will evaluate to `1`/`true` when sneaking *and* using an item
|
||||
- Example.) "`q.is_sneaking || q.is_jumping`" // Evaluates to `1`/`true` when either jumping *or* sneaking
|
||||
## 值处理
|
||||
|
||||
- **Parentheses**, `( )`, are also a major help when grouping values or performing math operations.
|
||||
- Example.) "`q.is_sneaking && (q.get_equipped_item_name == "stick" || q.get_equipped_item_name == "diamond")`" Will evaluate to `1`/`true` when sneaking *and* holding either a stick *or* a diamond
|
||||
- **逻辑运算符** 可以将非数字值转换为1或0,包括:`==`, `!=`, `<`, `>`, `<=`, `>=`
|
||||
- 示例:`q.get_equipped_item_name == 'stick'` 当手持木棍时求值为`1`/`true`
|
||||
|
||||
- **Conditional Operators** can be used as `if/else` statements.
|
||||
- A *binary* conditional operator refers to just using `?`. When this is used, it'll output your value or `0` depending on whether the given input value is `true`.
|
||||
- Example.) "`q.is_sneaking ? 5`" Will output a `5` when sneaking, otherwise returning a `0`
|
||||
- A *trinary* conditional operator refers to using `?` and `:`. When this is used, it'll output one of the two given values depending on whether your given input value is `true`.
|
||||
- Example.) "`q.is_sneaking ? 10 : 3`" Will output a `10` when sneaking, otherwise returning a `3`
|
||||
- **复合逻辑运算符** 用于构建"与/或"逻辑关系:
|
||||
- `&&` 表示"与",`||` 表示"或"
|
||||
- 示例:`q.is_sneaking && q.is_using_item` 潜行且使用物品时返回`1`/`true`
|
||||
- 示例:`q.is_sneaking || q.is_jumping` 潜行或跳跃时返回`1`/`true`
|
||||
|
||||
- **圆括号** `( )` 在组合值或进行数学运算时非常实用
|
||||
- 示例:`q.is_sneaking && (q.get_equipped_item_name == "stick" || q.get_equipped_item_name == "diamond")` 潜行时手持木棍或钻石返回`1`/`true`
|
||||
|
||||
- **条件运算符** 可实现类似`if/else`的逻辑:
|
||||
- **二元条件运算符** `?` 根据输入值返回指定值或0
|
||||
- 示例:`q.is_sneaking ? 5` 潜行时返回`5`,否则返回`0`
|
||||
- **三元条件运算符** `? :` 根据条件返回两个指定值之一
|
||||
- 示例:`q.is_sneaking ? 10 : 3` 潜行时返回`10`,否则返回`3`
|
||||
|
||||
::: code-group
|
||||
```json [示例]
|
||||
{
|
||||
"format_version": "1.16.100",
|
||||
"minecraft:entity": {
|
||||
"components": {
|
||||
"minecraft:movement": {
|
||||
"value": "q.is_jumping ? 0.1 : 0.05" // 跳跃时移动速度变为0.1,否则0.05
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
:::
|
||||
@@ -1,51 +1,48 @@
|
||||
---
|
||||
title: Namespaces
|
||||
title: 命名空间
|
||||
mentions:
|
||||
- SirLich
|
||||
- MedicalJewel105
|
||||
---
|
||||
|
||||
Namespaces are identifiers that mark content ownership. You can think of them as folders. Namespaces are helpful because they keep naming conflicts from happening.
|
||||
# 命名空间
|
||||
|
||||
Namespaces in addon creation can essentially be thought of as "the part to the left of the colon". For example, `minecraft` is the namespace of `minecraft:zombie`. The general form is `namespace:name`.
|
||||
<!--@include: @/wiki/bedrock-wiki-mirror.md-->
|
||||
|
||||
As a concrete example of why namespaces are helpful, let's imagine you create a new Mob. You name it `minecraft:shark`, not aware that you should create your own namespace for custom content. Next year, Mojang decides to add sharks into the game! Now there is a naming conflict since there are two definitions of `minecraft:shark`. Your addon will break.
|
||||
命名空间是用于标识内容归属的标识符。你可以将它们理解为文件夹。命名空间有助于避免命名冲突的产生。
|
||||
|
||||
If you had instead used `your_namespace:shark`, the naming conflict wouldn't have happened.
|
||||
在附加包创作中,命名空间本质上可以看作是"冒号左侧的部分"。例如在`minecraft:zombie`中,`minecraft`就是命名空间。其通用格式为`命名空间:名称`。
|
||||
|
||||
## Picking a namespace
|
||||
举个具体例子说明命名空间的重要性:假设你创建了一个新生物并命名为`minecraft:shark`,却不知道应该为自定义内容使用自己的命名空间。一年后Mojang决定在游戏中加入鲨鱼!此时就会出现两个`minecraft:shark`的定义,导致命名冲突,你的附加包将无法正常运行。
|
||||
|
||||
A suitable namespace is unique to you. Something like `mob` or `cars` or `content` or `custom` would be a **bad** namespace since another developer might come up with the same namespace as you.
|
||||
如果你当初使用`你的命名空间:shark`,就不会发生这种冲突。
|
||||
|
||||
A suitable namespace is short. You will be writing your namespace a **LOT**, so the shorter, the better. `george_carlin_the_comedian` would be a lousy namespace for this reason.
|
||||
## 如何选择命名空间
|
||||
|
||||
For personal projects, I recommend a convenient version of your player name, and for commercial projects, I recommend a suitable version of the company name.
|
||||
合适的命名空间应当具有个人独特性。类似`mob`、`cars`、`content`或`custom`这样的通用词是**糟糕的**命名空间选择,因为其他开发者可能会使用相同的名称。
|
||||
|
||||
Some good examples:
|
||||
合适的命名空间应当简短。你将会**频繁使用**你的命名空间,因此越简短越好。类似`george_carlin_the_comedian`这样的长命名空间就不太合适。
|
||||
|
||||
- `gcarlin`
|
||||
- `sirlich`
|
||||
- `cubeworld`
|
||||
- `bworks`
|
||||
对于个人项目,建议使用玩家ID的简化版本;商业项目则建议使用公司名称的合适变体。
|
||||
|
||||
**DO NOT USE** `minecraft` or `minecon` as a namespace unless editing a vanilla file. Not only is it a terrible idea, but Minecraft reserves these, and it won't even work.
|
||||
优秀示例:
|
||||
- `gcarlin`
|
||||
- `sirlich`
|
||||
- `cubeworld`
|
||||
- `bworks`
|
||||
|
||||
## Where to use namespaces?
|
||||
**切勿使用**`minecraft`或`minecon`作为命名空间(除非修改原版文件)。这不仅是个糟糕的主意,而且Minecraft保留了这些命名空间的使用权,实际也无法生效。
|
||||
|
||||
In short, you should use namespaces as often as you can.
|
||||
## 命名空间的使用场景
|
||||
|
||||
For starters, you should use a namespace when adding custom entities to the game.
|
||||
简而言之,应当尽可能多地使用命名空间。
|
||||
|
||||
`sirlich:shark` is much better than `shark`.
|
||||
基础原则:为游戏添加自定义实体时必须使用命名空间。`sirlich:shark`的命名方式远优于`shark`。
|
||||
|
||||
It would be best if you also used namespaces for components and events. Just like Mojang uses `minecraft:pig_saddled` you should use `namespace:my_mob_event`, and `namespace:my_component_group`.
|
||||
在组件和事件的命名中也应使用命名空间。就像Mojang使用`minecraft:pig_saddled`那样,你应该使用`命名空间:我的生物事件`和`命名空间:我的组件组`的格式。
|
||||
|
||||
It would be best if you also used namespaces in animation controllers, render controllers, and animations.
|
||||
在动画控制器、渲染控制器和动画的命名中也推荐使用命名空间。例如:`controller.animation.命名空间.实体名称.动作`的格式优于`controller.animation.我的动作`。
|
||||
|
||||
For example: `controller.animation.namespace.entity_name.action` is better than `controller.animation.my_action`.
|
||||
## 无需使用命名空间的场景
|
||||
|
||||
## Where NOT to use namespaces.
|
||||
|
||||
The actual file structure does not need namespaces.
|
||||
|
||||
`animations/namespace/my_entity/animation` is more confusing than `animations/my_entity/animation`.
|
||||
实际文件结构不需要包含命名空间。`animations/命名空间/我的实体/animation`的路径结构反而会比`animations/我的实体/animation`更易造成混淆。
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Overwriting Assets
|
||||
title: 资源覆盖机制
|
||||
tags:
|
||||
- intermediate
|
||||
- 中级
|
||||
mentions:
|
||||
- SirLich
|
||||
- MedicalJewel105
|
||||
@@ -9,76 +9,80 @@ mentions:
|
||||
- SmokeyStack
|
||||
---
|
||||
|
||||
## Addon Layering
|
||||
# 资源覆盖机制
|
||||
|
||||
The addon system is built layer by layer, where each pack is added _on top_ of the ones before it. Even if you only have a single pack added, there is an implicit _vanilla_ pack which is always added. When you add custom content, this content will have full access to all vanilla files.
|
||||
<!--@include: @/wiki/bedrock-wiki-mirror.md-->
|
||||
|
||||
### Accessing Vanilla Files
|
||||
## 附加包层级系统
|
||||
|
||||
This layered structure is very useful, because it allows us to access the files inside of vanilla, without copy/pasting them into our addon. For example you can access `blocks/stone.png` without moving it into your addon! Just set it as the texture for your custom entity - it will work out of the box. This is particularly useful for things like models, or render controllers, or sounds.
|
||||
附加包系统采用分层架构,每个资源包/行为包都会叠加在先前加载的包之上。即使你只添加了一个自定义包,系统也会默认加载隐式的原版包。当创建自定义内容时,这些内容将完全继承原版文件的所有权限。
|
||||
|
||||
If the vanilla assets change, for example if [JAPPA](https://twitter.com/JasperBoerstra?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor) updates the stone texture, your addon will also receive the update, since you are relying on the actual dynamic, vanilla resources.
|
||||
### 访问原版文件
|
||||
|
||||
You should try to use this system of layering as often as you can. If you don't *need* to copy/paste something into your addon, don't.
|
||||
这种分层结构非常实用,它允许我们无需将原版文件复制到附加包中即可直接调用。例如你可以直接调用`blocks/stone.png`作为自定义实体的纹理,无需复制文件即可直接生效。这种特性在模型、渲染控制器、音效等资源的调用中尤为便利。
|
||||
|
||||
若原版资源发生更新(例如[JAPPA](https://twitter.com/JasperBoerstra?ref_src=twsrc%5Egoogle%7Ctwcamp%5Eserp%7Ctwgr%5Eauthor)更新了石头纹理),你的附加包也会同步获得更新,因为你的资源始终动态关联着原版资源。
|
||||
|
||||
请尽可能使用这种分层调用机制。如果不需要复制粘贴原版资源,就不要进行冗余操作。
|
||||
|
||||
:::warning
|
||||
It is never OK to make an addon inside of a copy of the vanilla resource/behavior pack. This will make the download for your addon incredibly huge, and will reduce performance. Always begin with a blank addon, then copy/paste the files you want to overwrite.
|
||||
绝对禁止直接复制原版资源包/行为包进行修改。这会导致附加包体积异常臃肿,并严重影响运行性能。正确做法是新建空白附加包,仅复制需要覆盖的特定文件。
|
||||
:::
|
||||
|
||||
## Overwriting Assets
|
||||
## 资源覆盖方式
|
||||
|
||||
Pack Layering also allows us to overwrite vanilla assets, by _overwriting_ them with a file that shares the same path, or the same identifier. Our new file will replace the one being used in vanilla, allowing us to change textures, sounds, entity behavior, etc.
|
||||
通过包层级系统,我们可以通过创建相同路径或相同标识符的文件来覆盖原版资源。新的文件将完全替代原版文件,从而实现纹理替换、音效修改、实体行为调整等功能。
|
||||
|
||||
:::warning
|
||||
Different resources have different methods of overwriting, so be careful to use the right method for each type!
|
||||
不同类型的资源需要采用不同的覆盖方式,请仔细确认每种资源的覆盖机制!
|
||||
:::
|
||||
|
||||
### Overwriting by Path
|
||||
### 路径覆盖法
|
||||
|
||||
Assets that are referenced by _path_, and do _not have an identifier_ can be overwritten by simply placing a new asset into the same path. The following can be overwritten in this way:
|
||||
对于通过路径引用且没有标识符的资源,只需在相同路径下创建新文件即可覆盖。以下资源类型适用此方式:
|
||||
|
||||
- Functions
|
||||
- Loot tables
|
||||
- Textures
|
||||
- Sounds
|
||||
- Trade Tables
|
||||
- 游戏指令
|
||||
- 战利品表
|
||||
- 纹理贴图
|
||||
- 音效文件
|
||||
- 交易表
|
||||
|
||||
When you overwrite these files, the overwriting is absolute: The new asset will fully replace the old asset.
|
||||
此方式会完全替换原文件内容。
|
||||
|
||||
:::tip
|
||||
**Example**: If you would like to replace the redstone ore texture, simply place a new file at `textures/blocks/redstone_ore.png`.
|
||||
**示例**:要替换红石矿石纹理,只需在`textures/blocks/redstone_ore.png`路径放置新纹理文件即可。
|
||||
:::
|
||||
|
||||
### Overwriting by Identifier
|
||||
### 标识符覆盖法
|
||||
|
||||
Many assets are defined not by their name, but by their identifier! To overwrite these assets, simply create a new file that shares the same identifier, regardless of file-path. The following can be overwritten in this way:
|
||||
对于通过标识符定义的资源,只需创建具有相同标识符的文件(无论路径如何)即可覆盖。以下资源类型适用此方式:
|
||||
|
||||
- BP Entities
|
||||
- RP Entities
|
||||
- Animations
|
||||
- Models
|
||||
- Animation Controllers
|
||||
- Spawn Rules
|
||||
- Recipes
|
||||
- Particles
|
||||
- Render Controllers
|
||||
- 行为包实体
|
||||
- 资源包实体
|
||||
- 动画
|
||||
- 模型
|
||||
- 动画控制器
|
||||
- 生成规则
|
||||
- 合成配方
|
||||
- 粒子效果
|
||||
- 渲染控制器
|
||||
|
||||
When you overwrite these files, the overwriting is absolute: The new asset will fully replace the old asset.
|
||||
此方式会完全替换原文件内容。
|
||||
|
||||
:::tip
|
||||
**Example**: If you would like to make Ghasts have higher health, simply create a new BP entity with the `minecraft:ghast` identifier, and all the behaviors required to make the ghast function.
|
||||
**示例**:要提升恶魂生命值,需要创建包含`minecraft:ghast`标识符的新实体行为文件,并完整定义恶魂的所有行为组件。
|
||||
|
||||
Remember, entity files do not merge together, so you will first need to copy/paste the entire BP Ghast file, and _then_ edit the health. Simply creating a `minecraft:ghast` with a high health component inside will not work.
|
||||
注意:实体文件不会自动合并,必须首先完整复制原版恶魂行为文件,再进行生命值修改。仅创建包含高生命值组件的`minecraft:ghast`文件会导致功能异常。
|
||||
:::
|
||||
|
||||
### Overwriting via Reference File
|
||||
### 注册表覆盖法
|
||||
|
||||
Many assets can also be registered into some kind of "registration system" file. These files are interesting, because unlike the other asset types, they are _merged together_ instead of _overwritten_. This means that when you define these files, you do not need to copy from the vanilla resources. You can simply start with a blank file, and then overwrite the specific definitions you want.
|
||||
部分资源通过注册表文件进行管理,这类文件具有合并特性而非完全覆盖。这意味着你无需复制原版内容,只需创建新的定义即可覆盖特定条目。
|
||||
|
||||
The following files work in this way:
|
||||
以下注册表文件支持此方式:
|
||||
|
||||
- All UI files
|
||||
- [All language files](/concepts/text-and-translations)
|
||||
- 所有UI文件
|
||||
- [所有语言文件](/wiki/concepts/text-and-translations)
|
||||
- `item_textures.json`
|
||||
- `flipbook_textures.json`
|
||||
- `terrain_textures.json`
|
||||
@@ -87,11 +91,10 @@ The following files work in this way:
|
||||
- `sound_definitions.json`
|
||||
|
||||
:::tip
|
||||
**Example:** Lets say you want to override the `sugar` texture, using the reference files. You can do so by creating a new `item_textures.json`, with the following contents:
|
||||
**示例**:通过注册表覆盖法修改糖的纹理,只需新建`item_textures.json`并添加以下内容:
|
||||
|
||||
<CodeHeader></CodeHeader>
|
||||
|
||||
```json
|
||||
::: code-group
|
||||
```json [item_textures.json]
|
||||
{
|
||||
"resource_pack_name": "vanilla",
|
||||
"texture_data": {
|
||||
@@ -101,20 +104,23 @@ The following files work in this way:
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This _definition_ will be merged with the vanilla `item_textures.json`, and will override the short-name `sugar`. When the vanilla item accesses this short-name, it will get a reference to your custom texture path, instead of the actual texture path to sugar.
|
||||
:::
|
||||
|
||||
## Overwriting Dangers
|
||||
该定义会与原版`item_textures.json`合并,覆盖`sugar`的纹理路径指向。当原版物品调用此简称时,将自动引用你的自定义纹理。
|
||||
:::
|
||||
|
||||
Since addons mostly _overwrite_ each other rather than _merge_, it can be very difficult to get two incompatible addons to work together. For example, if you try to combine two addons that overwrite the creeper behavior (for example, one makes them very fast, and one makes them very large) the addon you have applied _second_ will overwrite the first.
|
||||
## 覆盖风险提示
|
||||
|
||||
This is mostly a problem with `player.json` (in either the RP or the BP), since this file is often used for gameplay purposes.
|
||||
由于附加包采用覆盖机制而非合并机制,不同附加包之间可能存在兼容性问题。例如同时安装两个修改爬行者行为的附加包(一个提升速度,一个增大体型),后加载的包会完全覆盖前者的修改。
|
||||
|
||||
## Things that Cannot be Overwritten
|
||||
这个问题在`player.json`(资源包或行为包中的)中尤为突出,因为该文件常被用于核心玩法修改。
|
||||
|
||||
Not everything can be overwritten, the following is a list of things that cannot be overwritten using any of the described methods:
|
||||
## 不可覆盖内容列表
|
||||
|
||||
- Vanilla items (Not all)
|
||||
- Vanilla blocks
|
||||
- Vanilla fogs (create a fog with another namespace and change it everywhere it is used)
|
||||
以下内容无法通过上述任何方式覆盖:
|
||||
|
||||
- 原版物品(部分不可覆盖)
|
||||
- 原版方块
|
||||
- 原版雾效(需新建命名空间的雾效并全局替换引用)
|
||||
|
||||
(注:保留英文术语以保持开发概念准确性)
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Shaders
|
||||
title: 着色器(光影)
|
||||
mentions:
|
||||
- SirLich
|
||||
- Dreamedc2015
|
||||
@@ -8,46 +8,42 @@ mentions:
|
||||
- SIsilicon
|
||||
---
|
||||
|
||||
# 着色器(光影)Shader
|
||||
|
||||
<!--@include: @/wiki/bedrock-wiki-mirror.md-->
|
||||
|
||||
:::warning
|
||||
The shaders on this page are incompatible with [Render Dragon](https://help.minecraft.net/hc/en-us/articles/360052771272-About-the-1-16-200-Update-for-Windows-10-). That means that they will not work on Windows and Console devices past 1.16.200, nor other devices past 1.18.30!
|
||||
本页所述的着色器与[Render Dragon](https://help.minecraft.net/hc/en-us/articles/360052771272-About-the-1-16-200-Update-for-Windows-10-)渲染引擎不兼容。这意味着在1.16.200版本后的Windows和主机设备,以及1.18.30版本后的其他设备上无法使用!
|
||||
:::
|
||||
|
||||
## Overview
|
||||
## 概述
|
||||
|
||||
Shaders are divided into 2 folders: `glsl` and `hlsl`. For shaders to work on every device,
|
||||
you need to code shaders in both languages. For testing on Windows, `hlsl` is enough.
|
||||
When rewriting shaders from one language to another, there are few things to change,
|
||||
like HLSL `float3` is `vec3` in GLSL. Mapping between those languages can be found [here](https://anteru.net/blog/2016/mapping-between-HLSL-and-GLSL/)
|
||||
着色器分为`glsl`和`hlsl`两个文件夹。要使着色器在所有设备上生效,需要同时用两种语言编写代码。在Windows平台测试时,使用`hlsl`即可。在两种语言间转换时需要注意语法差异,例如HLSL中的`float3`对应GLSL中的`vec3`。[此处](https://anteru.net/blog/2016/mapping-between-HLSL-and-GLSL/)可查看两种语言的对照表。
|
||||
|
||||
## Materials
|
||||
## 材质
|
||||
|
||||
Vertex, fragments, and sometimes geometry shaders are combined with some options
|
||||
as materials and are required for custom shaders. To create new material,
|
||||
you need to create a file, which matches the name of the .material file in the vanilla resource pack.
|
||||
For example: `materials/particles.material`. Materials support inheritance by adding parent
|
||||
material after a colon. For example: `entity_alpha:entity_base`
|
||||
顶点着色器、片段着色器和几何着色器(可选)通过材质配置文件组合使用。创建新材质时,需要参照原版资源包中的`.material`文件命名。例如:`materials/particles.material`。材质支持继承机制,使用冒号语法:`entity_alpha:entity_base`
|
||||
|
||||
### Common material definition fields
|
||||
### 通用材质定义字段
|
||||
|
||||
| **Field name** | **Description** | **Example value** | **Notes** |
|
||||
| ---------------- | --------------------------------------------------------------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `vertexShader` | Path to the shader relative to hlsl/glsl folder | | For HLSL shader, `.hlsl` suffix is added. |
|
||||
| `fragmentShader` | Path to the shader relative to hlsl/glsl folder | | For HLSL shader, `.hlsl` suffix is added. |
|
||||
| `vertexFields` | An array of fields passed to vertex shader | | It's better to copy this field from vanilla material. |
|
||||
| `variants` | An array of objects, which define variants of the material | | It's better to copy this field from vanilla material. |
|
||||
| `+defines` | An array of `#define` directives to add to the shader source | | Useful for reusing shader, but changing some minor setting. |
|
||||
| `+states` | An array of states to enable | `["Blending", "DisableAlphaWrite", "DisableDepthWrite"]` | For OpenGL implementation, this is equivalent to [glEnable](https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glEnable.xml) call. |
|
||||
| `-defines` | An array of `#defines` directives to remove from inherited `+defines` | | |
|
||||
| `+samplerStates` | An array of objects, defining how texture at certain index is treated | `{ "samplerIndex": 0, "textureFilter": "Point" }` | `textureFilter` specifies how to sample the texture and `textureWrap` specifies the behavior, when accessing outside of the texture dimensions. |
|
||||
| `msaaSupport` | Multisample anti-aliasing support | `Both` | |
|
||||
| `blendSrc` | Specifies how the color source blending factors are computed | `One` | For OpenGL implementation, this is equivalent to [glBlendFunc](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBlendFunc.xhtml) call. |
|
||||
| `blendDst` | Specifies how the color destination blending factors are computed | `One` | For OpenGL implementation, this is equivalent to [glBlendFunc](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBlendFunc.xhtml) call. |
|
||||
| **字段名称** | **描述** | **示例值** | **注意事项** |
|
||||
| ------------------ | ----------------------------------------------------------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `vertexShader` | 顶点着色器路径(相对于hlsl/glsl文件夹) | | HLSL着色器会自动添加`.hlsl`后缀 |
|
||||
| `fragmentShader` | 片段着色器路径(相对于hlsl/glsl文件夹) | | HLSL着色器会自动添加`.hlsl`后缀 |
|
||||
| `vertexFields` | 传递给顶点着色器的字段数组 | | 建议从原版材质中复制此字段 |
|
||||
| `variants` | 定义材质变体的对象数组 | | 建议从原版材质中复制此字段 |
|
||||
| `+defines` | 添加到着色器源码的`#define`指令数组 | | 适用于复用着色器时调整细节参数 |
|
||||
| `+states` | 启用的渲染状态数组 | `["Blending", "DisableAlphaWrite", "DisableDepthWrite"]` | OpenGL实现中对应[glEnable](https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glEnable.xml)调用 |
|
||||
| `-defines` | 从继承的`+defines`中移除的指令数组 | | |
|
||||
| `+samplerStates` | 定义纹理采样方式的对象数组 | `{ "samplerIndex": 0, "textureFilter": "Point" }` | `textureFilter`指定采样方式,`textureWrap`定义纹理边界外访问行为 |
|
||||
| `msaaSupport` | 多重采样抗锯齿支持 | `Both` | |
|
||||
| `blendSrc` | 颜色源混合因子计算方式 | `One` | OpenGL实现中对应[glBlendFunc](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBlendFunc.xhtml)调用 |
|
||||
| `blendDst` | 颜色目标混合因子计算方式 | `One` | OpenGL实现中对应[glBlendFunc](https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBlendFunc.xhtml)调用 |
|
||||
|
||||
Example:
|
||||
示例:
|
||||
|
||||
<CodeHeader></CodeHeader>
|
||||
|
||||
```json
|
||||
::: code-group
|
||||
```json [材质示例]
|
||||
{
|
||||
"materials": {
|
||||
"version": "1.0.0",
|
||||
@@ -73,89 +69,80 @@ Example:
|
||||
}
|
||||
}
|
||||
```
|
||||
:::
|
||||
|
||||
For all the details about material files and possible field values, check [material file JSON schema](https://github.com/stirante/bedrock-shader-schema/blob/master/materials.schema.json).
|
||||
完整材质文件规范请参考[材质文件JSON模式](https://github.com/stirante/bedrock-shader-schema/blob/master/materials.schema.json)。
|
||||
|
||||
## Troubleshooting
|
||||
## 疑难解答
|
||||
|
||||
### Shader doesn’t change
|
||||
### 着色器未生效
|
||||
|
||||
Every time there is a change in the shader, you need to restart Minecraft to recompile the shader completely.
|
||||
每次修改着色器后,必须重启Minecraft才能完全重新编译着色器。
|
||||
|
||||
### Compilation error
|
||||
### 编译错误
|
||||
|
||||
When there is a shader compilation error, a line number is usually specified where the error occurred. You need to check a few lines above the one set in error because Minecraft adds `#define` directives before compilation.
|
||||
出现编译错误时,错误信息中的行号可能需要检查前几行的代码,因为Minecraft会在编译前自动添加`#define`指令。
|
||||
|
||||
### Couldn’t find constant buffer named: $Globals
|
||||
### 找不到名为$Globals的常量缓冲区
|
||||
|
||||
I couldn’t accurately find the actual cause of this error, but it seems to be somehow connected to global variables. Removing them (initializing them in the `main` function or changing them to `#define` directives) seems to fix the problem.
|
||||
此错误可能与全局变量相关。尝试通过以下方式解决:
|
||||
- 在`main`函数中初始化变量
|
||||
- 改用`#define`指令定义常量
|
||||
|
||||
## Tips and tricks
|
||||
## 实用技巧
|
||||
|
||||
### Passing variables to the shader
|
||||
### 向着色器传递变量
|
||||
|
||||
You can pass variables to the shader from a particle or an entity by changing entity color.
|
||||
Input color is clamped to `<0.0, 1.0>`. To pass more significant values, you need to divide by max value (or at least some considerable number).
|
||||
通过修改实体颜色可将数据传入着色器。输入值会被限制在`<0.0, 1.0>`范围内。传递较大数值时建议先进行归一化处理。
|
||||
|
||||
### Using time in shader
|
||||
### 使用时间变量
|
||||
|
||||
`TIME` variable is a number of seconds as `float` and is global for all shaders. For time-based on particle lifetime, you need to pass this:
|
||||
全局`TIME`变量存储以秒为单位的浮点时间值。要获取基于粒子生命周期的计时器:
|
||||
|
||||
<CodeHeader></CodeHeader>
|
||||
|
||||
```json
|
||||
::: code-group
|
||||
```json [粒子计时器配置]
|
||||
"minecraft:particle_appearance_tinting": {
|
||||
"color": ["variable.particle_age/variable.particle_lifetime", 0, 0, 1]
|
||||
}
|
||||
```
|
||||
:::
|
||||
|
||||
Then in the shader, use `PSInput.color.r` as time, where `0.0` is particle birth and `1.0` is particle death.
|
||||
在着色器中使用`PSInput.color.r`获取时间值,其中`0.0`表示粒子生成,`1.0`表示粒子消亡。
|
||||
|
||||
### Camera direction towards the entity
|
||||
### 相机朝向控制
|
||||
|
||||
For entity shaders, you can make the shader dependent on the camera direction towards the entity.
|
||||
|
||||
- Add to `PS_Input` in vertex and fragment shader new field
|
||||
|
||||
<CodeHeader></CodeHeader>
|
||||
在实体着色器中实现相机方向相关效果:
|
||||
|
||||
1. 在顶点/片段着色器的`PS_Input`结构体添加:
|
||||
```
|
||||
float3 viewDir: POSITION;
|
||||
```
|
||||
|
||||
- After that, add to vertex shader this line
|
||||
|
||||
<CodeHeader></CodeHeader>
|
||||
|
||||
2. 在顶点着色器中添加:
|
||||
```
|
||||
PSInput.viewDir = normalize((mul(WORLD, mul(BONES[VSInput.boneId], float4(VSInput.position, 1)))).xyz);
|
||||
```
|
||||
|
||||
- In the fragment shader, use `PSInput.viewDir` to make changes depending on camera rotation
|
||||
3. 在片段着色器中使用`PSInput.viewDir`控制渲染逻辑
|
||||
|
||||
### Debugging values
|
||||
### 调试技巧
|
||||
|
||||
The easiest way to debug a value is to turn it into color and render it like this.
|
||||
将调试值转换为颜色输出是最直观的方式:
|
||||
|
||||
<CodeHeader></CodeHeader>
|
||||
|
||||
```
|
||||
::: code-group
|
||||
```hlsl [颜色调试]
|
||||
PSOutput.color = float4(PSInput.uv, 0., 1.);
|
||||
```
|
||||
:::
|
||||
|
||||
This should create a red-green gradient, showing that the values of `uv` are between `<0, 0>` and `<1, 1>`.
|
||||
|
||||
You can use the debug shader I wrote [based on this shader](http://mew.cx/drawtext/drawtext).
|
||||
Right now, this shader will display values of the color passed to the shader. To display another value, change line 70 in hlsl shader to
|
||||
|
||||
<CodeHeader></CodeHeader>
|
||||
这会生成红绿渐变,显示UV坐标范围。推荐使用[调试着色器](http://files.stirante.com/debugShader.zip),修改HLSL第70行代码可显示不同变量:
|
||||
|
||||
::: code-group
|
||||
```hlsl [调试代码]
|
||||
int ascii = getFloatCharacter( cellIndex, <需要显示的向量> );
|
||||
```
|
||||
int ascii = getFloatCharacter( cellIndex, <float4 vector here> );
|
||||
```
|
||||
:::
|
||||
|
||||
GLSL version of debugging shader may crash Minecraft, use only for debugging.
|
||||
注意:GLSL版调试着色器可能导致崩溃,建议仅用于调试。
|
||||
|
||||
[Download debug shader](http://files.stirante.com/debugShader.zip)
|
||||
|
||||

|
||||

|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Sounds
|
||||
title: 声音系统
|
||||
tags:
|
||||
- intermediate
|
||||
- 中级
|
||||
mentions:
|
||||
- SirLich
|
||||
- solvedDev
|
||||
@@ -14,17 +14,21 @@ mentions:
|
||||
- ThomasOrs
|
||||
---
|
||||
|
||||
In bedrock, we can add custom sounds without overwriting any vanilla sounds. This is done by adding files to the resource pack.
|
||||
# 声音系统
|
||||
|
||||
<!--@include: @/wiki/bedrock-wiki-mirror.md-->
|
||||
|
||||
在基岩版中,我们可以通过资源包添加自定义声音而无需覆盖原版音效。以下是实现方法:
|
||||
|
||||
:::tip
|
||||
The best way to learn about sounds is by downloading and playing around with the default resource pack.
|
||||
学习声音系统的最佳方式是下载并研究默认资源包的结构。
|
||||
:::
|
||||
|
||||
### Folder Structure
|
||||
### 文件夹结构
|
||||
|
||||
There are two main files that we edit when we want to add sounds. Note how `sound_definition` is nested inside `sounds`.
|
||||
添加声音时主要需要修改两个文件。注意`sound_definition`文件需要放置在`sounds`文件夹内。
|
||||
|
||||
Sound files themselves are added inside of the `sounds` folder, and can be any of the following formats.
|
||||
声音文件本身存放在`sounds`文件夹中,支持以下格式:
|
||||
|
||||
<FolderView :paths="[
|
||||
'RP/sounds.json',
|
||||
@@ -36,11 +40,10 @@ Sound files themselves are added inside of the `sounds` folder, and can be any o
|
||||
|
||||
## sound_definitions.json
|
||||
|
||||
`sound_definitions.json` is where we define new sound short-names. This should be thought of as typing a `short-name` or `id` to a physical sound path. Here is an example, `sound_definitions.json`, that adds a new trumpet sound called `example.toot`:
|
||||
此文件用于定义声音的短名称(short-name),相当于为物理声音文件创建ID标识。以下示例添加了名为`example.toot`的小号音效:
|
||||
|
||||
<CodeHeader>RP/sounds/sound_definitions.json</CodeHeader>
|
||||
|
||||
```json
|
||||
::: code-group
|
||||
```json [RP/sounds/sound_definitions.json]
|
||||
{
|
||||
"format_version": "1.14.0",
|
||||
"sound_definitions": {
|
||||
@@ -51,69 +54,68 @@ Sound files themselves are added inside of the `sounds` folder, and can be any o
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Sounds added in this way can be triggered using `/playsound`. Please note that `playsound` does not auto-correct, so you will need to be careful in your typing.
|
||||
|
||||
:::warning
|
||||
New files referenced by file path, such as sounds, DO need a complete client restart to load. This means that if sounds don't work, you should restart your entire MC client rather than just reloading the world.
|
||||
:::
|
||||
|
||||
### /playsound volume notes
|
||||
通过此方式添加的声音可通过`/playsound`命令触发。注意命令输入需严格匹配名称。
|
||||
|
||||
The game will clamp the sound volume to at most 1.0 before multiplying it with the sound definition's volume.
|
||||
:::warning
|
||||
新增声音文件需要完全重启客户端才能生效。若音效未正常加载,请重启整个游戏而非仅重载世界。
|
||||
:::
|
||||
|
||||
For `/playsound`, the maximum hearable range of a sound is given by `min(max_distance, max(volume * 16, 16))`.
|
||||
If `"max_distance"`is not given in the sound's definition, it is equivalent to `playsound_volume * 16`.
|
||||
### /playsound 音量说明
|
||||
|
||||
Approximate sound attenuation by distance. The actual graph might not be linear.
|
||||
游戏会将音量参数限制在1.0以内,再与声音定义中的音量相乘。
|
||||
|
||||
声音的最大可听距离计算公式为:`min(max_distance, max(volume * 16, 16))`
|
||||
若未在定义中设置`max_distance`,则等效于`playsound_volume * 16`
|
||||
|
||||
以下是声音随距离衰减的近似曲线(实际衰减可能非线性):
|
||||
|
||||

|
||||
|
||||
Shown above is the approximate sound attenuation factor by distance **for playing sounds with a volume parameter greater than or equal to 1**. Notice how the playsound `<volume>` limits the sound's audible range.
|
||||
The axis `distance` is the distance of the sound listener (player) to the sound source. The corresponding `volume` axis' value is the factor for the playsound volume capped to 1, multiplied by the sound definition's volume to get the final volume of the sound you hear. As an expression this could be written as: `final_volume = min(playsound_volume, 1) * graph_volume * sound_definition_volume`.
|
||||
上图展示了**当playsound音量参数≥1时**的衰减曲线。注意`<volume>`参数会影响声音的可听范围。
|
||||
|
||||
**Note:** Attenuation by distance of the hearable sound's volume is not affected by the volume parameter given in the command.
|
||||
公式表达为:`final_volume = min(playsound_volume, 1) * graph_volume * sound_definition_volume`
|
||||
|
||||
For example, `mob.ghast.affectionate_scream` sets `"min_distance": 100.0`, but can only be heard from at most 16 blocks away when using `/playsound` with volume 1 to play it. Specifying a greater volume value increases the audible range. When using a large enough volume to hear the sound farther away, the sound will get quieter only after a distance of more than 100.0.
|
||||
**注意:** 距离衰减曲线不受命令中音量参数影响。
|
||||
|
||||
To make a sound which can be heard far away but also drops in volume continuously over distance, one can add e.g. `"volume": 0.01`and use large `<volume>` values in the playsound command. The high value for the `/playsound` volume will produce a large audible range (e.g. a volume of 4 is 64 blocks as calculated above), while the low volume will prevent the played sound from capping at 1.0 too soon.
|
||||
例如:`mob.ghast.affectionate_scream`设置了`"min_distance": 100.0`,但使用`/playsound`音量1时最大可听距离仍为16格。若需增大范围,可通过设置更高的音量参数。
|
||||
|
||||
### Top Level Keys
|
||||
要实现远距离可听且线性衰减的效果,可在定义中设置`"volume": 0.01`,并在命令中使用大音量值(如4对应64格范围)。
|
||||
|
||||
In the example above, I showed two `top-level` fields: `category` and `sounds`. Sounds will be discussed in further detail below, but the other `top-level` keys will be discussed here:
|
||||
### 顶级参数
|
||||
|
||||
#### Categories
|
||||
#### 类别(Categories)
|
||||
|
||||
Categories are used internally by the engine to decide how each sound is played. We can utilize different channels to get other effects.
|
||||
控制声音播放方式的核心参数:
|
||||
|
||||
| Category | Note |
|
||||
| -------- | ----------------------------------------------- |
|
||||
| weather | |
|
||||
| block | |
|
||||
| bucket | |
|
||||
| bottle | |
|
||||
| ui | Sounds in this category will ignore range limit |
|
||||
| player | |
|
||||
| hostile | |
|
||||
| music | |
|
||||
| record | |
|
||||
| neutral | |
|
||||
| 类别 | 说明 |
|
||||
|----------|--------------------------|
|
||||
| weather | 天气音效 |
|
||||
| block | 方块交互音效 |
|
||||
| bucket | 桶类音效 |
|
||||
| bottle | 玻璃瓶音效 |
|
||||
| ui | 界面音效(无视距离限制)|
|
||||
| player | 玩家相关音效 |
|
||||
| hostile | 敌对生物音效 |
|
||||
| music | 背景音乐 |
|
||||
| record | 唱片机音效 |
|
||||
| neutral | 中立生物音效 |
|
||||
|
||||
#### min_distance
|
||||
|
||||
The distance from the sound source after which sound volume is attenuated. Default value: 0.0. It must be a float (eg. 1.0), or the property will be ignored.
|
||||
声音开始衰减的最小距离(浮点数),默认0.0
|
||||
|
||||
#### max_distance
|
||||
|
||||
The distance from the sound source after which the sound volume is the quietest (if in range). It must be a float (eg. 1.0), or the property will be ignored.
|
||||
声音衰减至最弱的最大距离(浮点数)
|
||||
|
||||
### Sound definitions
|
||||
### 声音定义进阶
|
||||
|
||||
In the example above, I showed `sounds` as simply a list with a single path. This is good for simple sounds but does not have much power. For starts, I can add multiple sounds to the list. These sounds will be randomized when played:
|
||||
可通过数组定义多个随机音效:
|
||||
|
||||
<CodeHeader>RP/sounds/sound_definitions.json</CodeHeader>
|
||||
|
||||
```json
|
||||
::: code-group
|
||||
```json [RP/sounds/sound_definitions.json]
|
||||
{
|
||||
"format_version": "1.14.0",
|
||||
"sound_definitions": {
|
||||
@@ -128,49 +130,25 @@ In the example above, I showed `sounds` as simply a list with a single path. Thi
|
||||
}
|
||||
}
|
||||
```
|
||||
:::
|
||||
|
||||
Additionally, we can define each sound as an object instead of a string. This allows us finer control and unlocks some new settings. The string/object style can be mixed and matched.
|
||||
#### 对象式定义参数
|
||||
|
||||
#### name
|
||||
| 参数 | 说明 |
|
||||
|-------------------|----------------------------------------------------------------------|
|
||||
| name | 文件路径(例:"sounds/music/game/creative/creative1") |
|
||||
| stream | 启用流式加载(降低内存占用) |
|
||||
| volume | 音量(0.0-1.0,可超过1.0) |
|
||||
| load_on_low_memory| 已弃用(1.16.0+) |
|
||||
| pitch | 音高倍数(例:2.3=2.3倍速播放) |
|
||||
| is3D | 是否启用3D音效(音乐/UI类自动禁用) |
|
||||
| interruptible | 是否可被中断(默认true) |
|
||||
| weight | 随机权重(例:权重10的选中概率是权重2的5倍) |
|
||||
|
||||
The path to the file, such as: `"sounds/music/game/creative/creative1"`
|
||||
### 完整示例
|
||||
|
||||
#### stream
|
||||
|
||||
Limits the sound only to be played a limited number of instances at a time. Will cause the game to not load the entire sound data into memory while playing, but rather in smaller parts while playing, thus using less memory. Good for improving performance on sound heavy worlds.
|
||||
|
||||
#### volume
|
||||
|
||||
How loud the sound should play, from `0.0` to `1.0`. Sounds cannot be made more audible than initially encoded. Set to `1.0` by default.
|
||||
Sounds in custom resource packs can have working values greater than 1.0.
|
||||
|
||||
#### load_on_low_memory
|
||||
|
||||
Forces the loading of the sound even when nearing low memory. "load_on_low_memory" is now deprecated as of 1.16.0
|
||||
|
||||
#### pitch
|
||||
|
||||
The pitch of the sound (how low/high it sounds). Should be a positive value. For example, `2.3` will let the sound play 2.3 times as quickly and thus at higher pitch. Set to `1.0` by default.
|
||||
|
||||
#### is3D
|
||||
|
||||
`true` makes the sound directional. Set to `true` for all sounds by default. Ignored for `music` and `ui` sounds. Only sounds with `false` will play stereo sound.
|
||||
|
||||
#### interruptible
|
||||
|
||||
Set to `true` by default.
|
||||
|
||||
### weight
|
||||
|
||||
If there is more than one sound in the list, the sound to be played is chosen randomly. `"weight"` (integer value like 5) will give the relative chance that this sound is chosen from the list. For example, if there are two sounds in the list, one with `"weight": 10` and the other with `"weight": 2`, the first will be played approximately 5 times more likely than the second (accurately: `10 / (10 + 2) = 83.3%` chance vs. `2 / (10 + 2) = 16.7%` chance) . Set to `1` by default.
|
||||
|
||||
### Example
|
||||
|
||||
Here is a more realistic example containing these options:
|
||||
|
||||
<CodeHeader>RP/sounds/sound_definitions.json#sound_definitions</CodeHeader>
|
||||
|
||||
```json
|
||||
::: code-group
|
||||
```json [RP/sounds/sound_definitions.json#sound_definitions]
|
||||
"block.beehive.drip": {
|
||||
"category": "block",
|
||||
"max_distance": 8,
|
||||
@@ -185,63 +163,39 @@ Here is a more realistic example containing these options:
|
||||
]
|
||||
}
|
||||
```
|
||||
:::
|
||||
|
||||
## sounds.json
|
||||
|
||||
If we want our sounds to run automatically, we can add them into the `sounds.json` file. This will tie the sound definitions directly to game events and cause them to play without needing to trigger with `/playsound`.
|
||||
此文件用于绑定自动播放的音效:
|
||||
|
||||
Sounds can be added into various categories:
|
||||
| 分类 | 说明 |
|
||||
|------------------------|----------------------|
|
||||
| individual_event_sounds| 独立事件音效(如信标激活)|
|
||||
| block_sounds | 方块交互音效 |
|
||||
| entity_sounds | 实体音效(含自定义实体)|
|
||||
| interactive_sounds | 交互音效(开发中) |
|
||||
|
||||
| Category | Note |
|
||||
| ----------------------- | -------------------------------------------------------------------------------- |
|
||||
| individual_event_sounds | Contains sounds like beacon activation, chest-close, or explode |
|
||||
| block_sounds | Contains hit, step, and break sounds for blocks |
|
||||
| entity_sounds | Contains death, ambient, hurt, etc. sounds for entities (Including custom ones!) |
|
||||
| interactive_sounds | WIP |
|
||||
### 实体音效事件
|
||||
|
||||
### Adding Entity Sounds
|
||||
常见生命周期事件:
|
||||
|
||||
I assume that sounds can be added in other categories, but I personally only have experience adding sounds into the `entities` category. Entity sounds are automatically played at various points in the entities life-cycle.
|
||||
| 事件 | 触发时机 |
|
||||
|---------------|------------------------|
|
||||
| ambient | 随机播放(如生物低鸣)|
|
||||
| hurt | 受伤时 |
|
||||
| death | 死亡时 |
|
||||
| step | 移动时 |
|
||||
| fall.big | 高空坠落 |
|
||||
| fall.small | 低处跌落 |
|
||||
| splash | 溅水 |
|
||||
| attack | 近战攻击 |
|
||||
| shoot | 远程射击 |
|
||||
|
||||
Common events:
|
||||
### 实体音效示例
|
||||
|
||||
| Events | Note |
|
||||
| ---------- | -------------------------------------------------------- |
|
||||
| ambient | Played randomly, such as grunts, clucks, or ghast noises |
|
||||
| hurt | Played when damaged |
|
||||
| death | Played when it dies |
|
||||
| step | Played when the entity moves along the ground |
|
||||
| fall.big | For hitting the ground from a high height |
|
||||
| fall.small | For hitting the ground from a low height |
|
||||
| splash | For splashing in the water |
|
||||
| attack | For melee attacking |
|
||||
| shoot | For shooting projectiles |
|
||||
|
||||
There are also many sound events, which _most likely_ trigger automatically, but which I don't have details for, such as:
|
||||
|
||||
| Unknown Categories |
|
||||
| ------------------ |
|
||||
| breathe |
|
||||
| splash |
|
||||
| swim |
|
||||
| ambient.in.water |
|
||||
| death.in.water |
|
||||
| jump |
|
||||
| eat |
|
||||
| hurt.in.water |
|
||||
| mad |
|
||||
| stare |
|
||||
| sniff |
|
||||
| sleep |
|
||||
| spit |
|
||||
| warn |
|
||||
| scream |
|
||||
|
||||
### Example
|
||||
|
||||
<CodeHeader>RP/sounds.json</CodeHeader>
|
||||
|
||||
```json
|
||||
::: code-group
|
||||
```json [RP/sounds.json]
|
||||
{
|
||||
"entity_sounds": {
|
||||
"entities": {
|
||||
@@ -265,48 +219,44 @@ There are also many sound events, which _most likely_ trigger automatically, but
|
||||
}
|
||||
}
|
||||
```
|
||||
:::
|
||||
|
||||
## Adding sounds to Animations
|
||||
## 动画音效绑定
|
||||
|
||||
Sounds played in animations function based off of `short-name` definitions in the RP entity file.
|
||||
通过RP实体文件中的`sound_effects`实现动画同步:
|
||||
|
||||
This example shows playing a wing-flap sound, synced with an animation.
|
||||
|
||||
<CodeHeader>RP/entities/dragon.json#minecraft:client_entity/description</CodeHeader>
|
||||
|
||||
```json
|
||||
::: code-group
|
||||
```json [RP/entities/dragon.json#minecraft:client_entity/description]
|
||||
"sound_effects": {
|
||||
"wing_flap": "wiki.dragon.wing_flap" //where wiki.dragon.roar is a sound defined in sound_definitions
|
||||
"wing_flap": "wiki.dragon.wing_flap" // wiki.dragon.wing_flap需在sound_definitions中定义
|
||||
}
|
||||
```
|
||||
:::
|
||||
|
||||
<CodeHeader>RP/animations/dragon.json#animations/animation.dragon.flying</CodeHeader>
|
||||
|
||||
```json
|
||||
::: code-group
|
||||
```json [RP/animations/dragon.json#animations/animation.dragon.flying]
|
||||
"sound_effects": {
|
||||
"3.16": {
|
||||
"effect": "wing_flap"
|
||||
}
|
||||
}
|
||||
```
|
||||
:::
|
||||
|
||||
## Adding sounds to Animation Controllers
|
||||
## 动画控制器音效
|
||||
|
||||
You can play sounds within animation controllers in a similar way that animations can be.
|
||||
动画控制器中的音效触发方式类似:
|
||||
|
||||
This example shows playing an explosion sound, synced using an animation controller.
|
||||
|
||||
<CodeHeader>RP/entities/custom_tnt.json#minecraft:client_entity/description</CodeHeader>
|
||||
|
||||
```json
|
||||
::: code-group
|
||||
```json [RP/entities/custom_tnt.json#minecraft:client_entity/description]
|
||||
"sound_effects": {
|
||||
"explosion": "wiki.custom_tnt.explosion" //where wiki.custom_tnt.explosion is a sound defined in sound_definitions just like animation sounds.
|
||||
"explosion": "wiki.custom_tnt.explosion" // 需在sound_definitions中定义
|
||||
}
|
||||
```
|
||||
:::
|
||||
|
||||
<CodeHeader>RP/animation_controllers/custom_tnt.animation_controllers.json#controller.animation.custom_tnt</CodeHeader>
|
||||
|
||||
```json
|
||||
::: code-group
|
||||
```json [RP/animation_controllers/custom_tnt.animation_controllers.json#controller.animation.custom_tnt]
|
||||
"states":{
|
||||
"default":{
|
||||
"transitions":[
|
||||
@@ -329,3 +279,4 @@ This example shows playing an explosion sound, synced using an animation control
|
||||
}
|
||||
}
|
||||
```
|
||||
:::
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Subpacks
|
||||
title: 子Packs
|
||||
mentions:
|
||||
- SirLich
|
||||
- solvedDev
|
||||
@@ -10,32 +10,36 @@ mentions:
|
||||
- TheItsNameless
|
||||
---
|
||||
|
||||
## What are Subpacks?
|
||||
# 子Packs
|
||||
|
||||
Subpacks allow you to select between different addon 'configurations'.
|
||||
<!--@include: @/wiki/bedrock-wiki-mirror.md-->
|
||||
|
||||
They are intended for texture resolutions to load on different memory capacities, but can also be used to create file variations in behavior and resource packs. These variations can be selected by clicking the gear icon and adjusting the slider.
|
||||
## 什么是子包?
|
||||
|
||||
## How do Subpacks work?
|
||||
子包功能允许玩家在不同的附加包"配置"之间进行选择。
|
||||
|
||||
Files placed in you subpack folder will override files placed in your main addon folder, if the subpack is selected. For example, if your addon contains both `RP/textures/entities/ghost.png` and `RP/subpacks/pack_1/textures/ghost.png`, the second image file will replace the first, if subpack `pack_1` is selected.
|
||||
该功能最初设计用于根据设备内存容量加载不同分辨率的材质包,但也可用于创建行为包和资源包的多种文件变体。玩家可以通过点击齿轮图标并调整滑块来选择不同的子包配置。
|
||||
|
||||
For more information about how files override each other, please see our page on [overriding vanilla assets](/concepts/overwriting-assets).
|
||||
## 子包工作原理
|
||||
|
||||
## Creating Subpacks
|
||||
当子包被选中时,放置在子包文件夹中的文件将覆盖主附加包文件夹中的同名文件。例如,若附加包同时包含 `RP/textures/entities/ghost.png` 和 `RP/subpacks/pack_1/textures/ghost.png`,当选择 `pack_1` 子包时,第二个图片文件将取代第一个文件。
|
||||
|
||||
- To start adding a subpack you need to create a `subpacks` folder inside the root of your `BP`/`RP`.
|
||||
- Then inside the `subpacks` folder add a folder for each subpack you want to have
|
||||
e.g.
|
||||
关于文件覆盖机制的更多信息,请参阅我们的[覆盖原版资源](/wiki/concepts/overwriting-assets)说明文档。
|
||||
|
||||
## 创建子包
|
||||
|
||||
- 首先需要在行为包或资源包的根目录下创建 `subpacks` 文件夹
|
||||
- 在 `subpacks` 文件夹内为每个子包创建独立文件夹
|
||||
例如:
|
||||
|
||||
<FolderView :paths="[
|
||||
'RP/subpacks/subpack_1',
|
||||
'RP/subpacks/subpack_2'
|
||||
]"></FolderView>
|
||||
|
||||
- Inside each of these folders you can add the content of each subpack.
|
||||
This can be anything that normally goes in your behavior or resource pack.
|
||||
e.g.
|
||||
- 在每个子包文件夹中添加该子包的特定内容
|
||||
这些内容可以是常规附加包中的任意资源
|
||||
例如:
|
||||
|
||||
<FolderView :paths="[
|
||||
'RP/subpacks/subpack_1/textures/blocks/dirt.png',
|
||||
@@ -44,20 +48,19 @@ For more information about how files override each other, please see our page on
|
||||
'RP/subpacks/subpack_2/textures/items/example_item.png'
|
||||
]"></FolderView>
|
||||
|
||||
## Manifest Part
|
||||
## 清单文件配置
|
||||
|
||||
To register the subpacks in the manifest you need to add `subpacks` and this contains an array of subpacks.
|
||||
需要在清单文件(manifest.json)中注册子包信息,在 `subpacks` 字段下以数组形式声明各个子包。
|
||||
|
||||
Example:
|
||||
示例配置:
|
||||
|
||||
<CodeHeader>RP/manifest.json</CodeHeader>
|
||||
|
||||
```json
|
||||
::: code-group
|
||||
```json [RP/manifest.json]
|
||||
{
|
||||
"format_version": 2,
|
||||
"header": {
|
||||
"name": "Pack Name",
|
||||
"description": "Pack Description",
|
||||
"name": "资源包名称",
|
||||
"description": "资源包描述",
|
||||
"uuid": "2fc2dd6f-86cb-4370-af70-21490a1ae471",
|
||||
"version": [1, 0, 0],
|
||||
"min_engine_version": [1, 13, 0]
|
||||
@@ -72,24 +75,23 @@ Example:
|
||||
"subpacks": [
|
||||
{
|
||||
"folder_name": "subpack_1",
|
||||
"name": "First Subpack",
|
||||
"name": "初级材质",
|
||||
"memory_tier": 0
|
||||
},
|
||||
{
|
||||
"folder_name": "subpack_2",
|
||||
"name": "Second Subpack",
|
||||
"name": "高清材质",
|
||||
"memory_tier": 1
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
:::
|
||||
|
||||
- `name` - name that will show when selecting subpacks.
|
||||
- `name` - 在子包选择界面显示的名称
|
||||
- `memory_tier`- 设备运行所需内存配置(1个内存等级 = 0.25 GB)
|
||||
- `folder_name` - 对应子包文件夹名称,例如示例中的 `subpack_1` 或 `subpack_2`
|
||||
|
||||
- `memory_tier`- amount of RAM that device must have to enable this subpack. 1 memory tier = 0.25 GB.
|
||||
## 注意事项
|
||||
|
||||
- `folder_name` - name of the folder to be used for this subpack, for example in the examples above this would be `subpack_1` or `subpack_2`.
|
||||
|
||||
## Known Things
|
||||
|
||||
If you add only one subpack, there will be 2 options at the subpacks selection section, however second resolution (no subpack actually) does **not** make content in the root folder override subpacks.
|
||||
当仅添加一个子包时,选择界面会显示两个选项,但第二个"无子包"选项实际上**不会**用根目录内容覆盖子包内容。
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: Text and Localization
|
||||
title: 文本与本地化
|
||||
mentions:
|
||||
- ThijsHankelMC
|
||||
- SirLich
|
||||
@@ -14,13 +14,17 @@ mentions:
|
||||
- Sprunkles
|
||||
---
|
||||
|
||||
Minecraft is a game with fully localized text in languages all over the world. To achieve this, Minecraft employs a system where internal **translation keys** are assigned values on a per-language basis. Minecraft will generate translation keys for custom entities, items, and blocks, and it is up to us to assign them a localized name in our resource pack.
|
||||
# 文本与本地化
|
||||
|
||||
## Language Files
|
||||
<!--@include: @/wiki/bedrock-wiki-mirror.md-->
|
||||
|
||||
### File Location
|
||||
Minecraft 是一款支持全球多语言本地化的游戏。为实现这一特性,游戏采用了基于语言代码的**翻译键值系统**。对于自定义实体(Entity)、物品(Item)和方块(Block),Minecraft 会自动生成翻译键值,而我们需要通过资源包为其提供本地化文本。
|
||||
|
||||
Language files typically go within the resource pack in the "texts" folder as files with the `.lang` file extension. These files can be placed in the behavior pack, but the only translatable text it can change is the pack manifest's name and description.
|
||||
## 语言文件
|
||||
|
||||
### 文件位置
|
||||
|
||||
语言文件通常位于资源包的 `texts` 文件夹中,使用 `.lang` 扩展名。虽然也可以放置在行为包中,但行为包仅能修改资源包清单(manifest)的名称和描述。
|
||||
|
||||
<FolderView :paths="[
|
||||
'RP/texts/en_US.lang',
|
||||
@@ -29,128 +33,128 @@ Language files typically go within the resource pack in the "texts" folder as fi
|
||||
]"
|
||||
></FolderView>
|
||||
|
||||
Minecraft supports 29 languages currently, as described in [§ Vanilla Languages](/concepts/text-and-translations#vanilla-languages).
|
||||
Minecraft 目前支持 29 种语言,详见 [§ 原版支持语言](/wiki/concepts/text-and-translations#vanilla-languages)。
|
||||
|
||||
### Format
|
||||
### 格式规范
|
||||
|
||||
The format for a language file is rather straightforward. Translations are supplied as key-value pairs separated by an equals sign (`=`), the key being a translation key and the value being a string. Values cannot contain newline characters.
|
||||
语言文件采用键值对格式,使用等号(`=`)分隔。键为翻译键值,值为字符串(不支持换行符)。
|
||||
|
||||
```toml
|
||||
wiki.example_translation.line_1=The first line!
|
||||
wiki.example_translation.line_2=Some more information following the first line.
|
||||
wiki.example_translation.line_1=第一行内容!
|
||||
wiki.example_translation.line_2=这里是第一行之后的其他信息。
|
||||
```
|
||||
|
||||
Comments may be added with two pound signs (`##`), either as line comments or in-line comments. All text after the pound signs are a comment until the next line.
|
||||
可通过双井号(`##`)添加注释,支持行尾注释和整行注释(注释内容持续到行尾)。
|
||||
|
||||
:::warning
|
||||
Trailing spaces are not trimmed for in-line comments. If you want to indent a comment, use the Tab character.
|
||||
行尾注释前的空格不会被自动删除。如需缩进注释,请使用制表符(Tab)。
|
||||
:::
|
||||
|
||||
```toml
|
||||
## Translator note: I thought this would be funny to put here.
|
||||
item.flint_and_steel.name=Flint and Steve ##[sic]
|
||||
## 译者注:这个翻译可能有点幽默成分
|
||||
item.flint_and_steel.name=燧石与史蒂夫 ##[原文如此]
|
||||
```
|
||||
|
||||
A translation can contain substitutions in place of text. Substitutions can either be ordered (`%1`, `%2`, etc.) or not ordered (`%s`). Vanilla translations have their values filled in by the game, while players can manually set the substitutions' values with commands that use the raw JSON text format, like with [`/tellraw`](/commands/tellraw).
|
||||
翻译文本支持占位符替换,可使用有序占位符(`%1`、`%2`)或无序占位符(`%s`)。原版占位符由游戏自动填充,而通过原始JSON文本命令(如 [`/tellraw`](/wiki/commands/tellraw))可手动指定替换值。
|
||||
|
||||
```toml
|
||||
commands.op.success=Opped: %s
|
||||
immersive_reader.book_page_header=Page %1 of %2
|
||||
commands.op.success=已授予管理员权限:%s
|
||||
immersive_reader.book_page_header=第 %1 页 / 共 %2 页
|
||||
```
|
||||
|
||||
### Usage
|
||||
### 应用场景
|
||||
|
||||
Localization can be done just about anywhere text can be used, including (but not limited to):
|
||||
本地化文本可用于以下场景(包括但不限于):
|
||||
|
||||
- Pack name and description
|
||||
- Entity, item, or block names
|
||||
- Pages in a book
|
||||
- Lines on a sign
|
||||
- `/tellraw` and `/titleraw` commands
|
||||
- Text in dialogue
|
||||
- 资源包/行为包名称与描述
|
||||
- 实体、物品或方块的名称
|
||||
- 书页内容
|
||||
- 告示牌文字
|
||||
- `/tellraw` 和 `/titleraw` 命令
|
||||
- 对话系统中的文本
|
||||
|
||||
Some text cannot be translated however, such as for an item renamed in an anvil.
|
||||
但某些文本(如铁砧重命名的物品)不支持本地化。
|
||||
|
||||
## Localization
|
||||
## 本地化实践
|
||||
|
||||
:::tip
|
||||
It is good practice create a copy of your language file for each major language your pack supports. For example, to support full English one should create both an `en_US.lang` and an `en_GB.lang` file, to cover English in both the United States and Great Britain countries, respectively.
|
||||
最佳实践是为每个主要支持语言创建独立语言文件。例如要完整支持英语,应同时创建 `en_US.lang`(美式英语)和 `en_GB.lang`(英式英语)文件。
|
||||
:::
|
||||
|
||||
When editing language files one must also add a `languages.json` file in the `texts` folder containing an array with each of the languages you plan to change. This lets Minecraft know that it should apply localization for these languages.
|
||||
编辑语言文件时,需在 `texts` 文件夹中添加 `languages.json` 文件,声明需要修改的语言列表。这会告知 Minecraft 应用对应的本地化配置。
|
||||
|
||||
<CodeHeader>RP/texts/languages.json</CodeHeader>
|
||||
|
||||
```json
|
||||
::: code-group
|
||||
```json [原始CodeHeader的值]
|
||||
[
|
||||
"en_US",
|
||||
"en_GB",
|
||||
"fr_FR"
|
||||
]
|
||||
```
|
||||
:::
|
||||
|
||||
### Custom Languages
|
||||
### 自定义语言
|
||||
|
||||
With a global resource pack, custom languages may be introduced through the `languages.json` and `language_names.json` files. Once the pack is applied globally the language can be changed in the "Language" tab of the in-game settings.
|
||||
通过全局资源包,可使用 `languages.json` 和 `language_names.json` 添加自定义语言。应用全局资源包后,即可在游戏设置的"语言"选项中选择新语言。
|
||||
|
||||
For the following examples, lets assume that we have 2 fully functional language files, one named `xx_XX.lang`, and another named `yy_YY.lang`.
|
||||
假设我们有两个功能完善的语言文件:`xx_XX.lang` 和 `yy_YY.lang`。
|
||||
|
||||
<CodeHeader>RP/texts/languages.json</CodeHeader>
|
||||
|
||||
```json
|
||||
::: code-group
|
||||
```json [原始CodeHeader的值]
|
||||
[
|
||||
"xx_XX",
|
||||
"yy_YY"
|
||||
]
|
||||
```
|
||||
|
||||
`language_names.json` is an array as well, but this time to define the names to display for the languages.
|
||||
|
||||
<CodeHeader>RP/texts/language_names.json</CodeHeader>
|
||||
|
||||
```json
|
||||
[
|
||||
[ "xx_XX", "New Language (Custom Language #1)" ],
|
||||
[ "yy_YY", "Wiki-Speak (Custom Language #2)" ]
|
||||
]
|
||||
```
|
||||
|
||||
:::warning
|
||||
Whenever using a custom language, make sure to unequip the language before you disable the Resource Pack which it is stored in, or else Minecraft will crash.
|
||||
:::
|
||||
|
||||
### Vanilla Languages
|
||||
`language_names.json` 用于定义语言在选项菜单中的显示名称:
|
||||
|
||||
The following is a table of the 29 languages Minecraft supports by default.
|
||||
::: code-group
|
||||
```json [原始CodeHeader的值]
|
||||
[
|
||||
[ "xx_XX", "新语言(自定义语言 #1)" ],
|
||||
[ "yy_YY", "维基语(自定义语言 #2)" ]
|
||||
]
|
||||
```
|
||||
:::
|
||||
|
||||
| File ID | Language | Country |
|
||||
| ---------- | --------------------- | -------------- |
|
||||
| id_ID | Indonesian | Indonesia |
|
||||
| da_DK | Danish | Denmark |
|
||||
| de_DE | German | Germany |
|
||||
| en_GB | English | Great Britain |
|
||||
| en_US | English | North America |
|
||||
| es_ES | Spanish | Spain |
|
||||
| es_MX | Mexican Spanish | Mexico |
|
||||
| fr_CA | Canadian French | Canada |
|
||||
| fr_FR | French | France |
|
||||
| it_IT | Italian | Italy |
|
||||
| hu_HU | Hungarian | Hungary |
|
||||
| nl_NL | Dutch | Netherlands |
|
||||
| nb_NO | Bokmål | Norway |
|
||||
| pl_PL | Polish | Poland |
|
||||
| pt_BR | Brazilian Portuguese | Brazil |
|
||||
| pt_PT | Portuguese | Portugal |
|
||||
| sk_SK | Slovak | Slovakia |
|
||||
| fi_FI | Finnish | Finland |
|
||||
| sv_SE | Swedish | Sweden |
|
||||
| tr_TR | Turkish | Turkey |
|
||||
| cs_CZ | Czech | Czech Republic |
|
||||
| el_GR | Greek | Greece |
|
||||
| bg_BG | Bulgarian | Bulgaria |
|
||||
| ru_RU | Russian | Russia |
|
||||
| uk_UA | Ukrainian | Ukraine |
|
||||
| ja_JP | Japanese | Japan |
|
||||
| zh_CN | Chinese (Simplified) | China |
|
||||
| zh_TW | Chinese (Traditional) | Taiwan |
|
||||
| ko_KR | Korean | Korea |
|
||||
:::warning
|
||||
使用自定义语言时,在禁用其所属资源包前请先切换回其他语言,否则可能导致游戏崩溃。
|
||||
:::
|
||||
|
||||
### 原版支持语言
|
||||
|
||||
下表列出了 Minecraft 默认支持的 29 种语言:
|
||||
|
||||
| 文件ID | 语言 | 国家/地区 |
|
||||
| ---------- | ------------------- | --------------- |
|
||||
| id_ID | 印度尼西亚语 | 印度尼西亚 |
|
||||
| da_DK | 丹麦语 | 丹麦 |
|
||||
| de_DE | 德语 | 德国 |
|
||||
| en_GB | 英语 | 英国 |
|
||||
| en_US | 英语 | 北美 |
|
||||
| es_ES | 西班牙语 | 西班牙 |
|
||||
| es_MX | 墨西哥西班牙语 | 墨西哥 |
|
||||
| fr_CA | 加拿大法语 | 加拿大 |
|
||||
| fr_FR | 法语 | 法国 |
|
||||
| it_IT | 意大利语 | 意大利 |
|
||||
| hu_HU | 匈牙利语 | 匈牙利 |
|
||||
| nl_NL | 荷兰语 | 荷兰 |
|
||||
| nb_NO | 书面挪威语 | 挪威 |
|
||||
| pl_PL | 波兰语 | 波兰 |
|
||||
| pt_BR | 巴西葡萄牙语 | 巴西 |
|
||||
| pt_PT | 葡萄牙语 | 葡萄牙 |
|
||||
| sk_SK | 斯洛伐克语 | 斯洛伐克 |
|
||||
| fi_FI | 芬兰语 | 芬兰 |
|
||||
| sv_SE | 瑞典语 | 瑞典 |
|
||||
| tr_TR | 土耳其语 | 土耳其 |
|
||||
| cs_CZ | 捷克语 | 捷克共和国 |
|
||||
| el_GR | 希腊语 | 希腊 |
|
||||
| bg_BG | 保加利亚语 | 保加利亚 |
|
||||
| ru_RU | 俄语 | 俄罗斯 |
|
||||
| uk_UA | 乌克兰语 | 乌克兰 |
|
||||
| ja_JP | 日语 | 日本 |
|
||||
| zh_CN | 简体中文 | 中国 |
|
||||
| zh_TW | 繁体中文 | 台湾地区 |
|
||||
| ko_KR | 韩语 | 韩国 |
|
||||
@@ -8,21 +8,24 @@ mentions:
|
||||
- TheItsNameless
|
||||
---
|
||||
|
||||
## General Overview
|
||||
# textures_list.json
|
||||
|
||||
The `textures_list` file is Minecraft's way of *caching* each texture so that it can retrieve it faster than looking through each image in your textures folder. This is especially important when you have an abundance of textures, where Minecraft could potentially mess up and swap textures or even not load them at all. Minecraft tends to throw a content log _warning_ if you don't have the textures listed in the file. You can ignore it if you have a small amount, but it is recommended that you list the textures anyway.
|
||||
<!--@include: @/wiki/bedrock-wiki-mirror.md-->
|
||||
|
||||
## What textures can be used in the file?
|
||||
## 概述
|
||||
|
||||
Any texture! Any textures can and _should_ be used in the textures_list.json file for best practice and performance.
|
||||
`textures_list` 文件是 Minecraft 用来*缓存*所有纹理的机制,相比从纹理文件夹中逐张查找,这种方式能更快地检索纹理。当您拥有大量纹理时这一点尤为重要,因为 Minecraft 可能会因纹理过多而出现错误交换纹理甚至无法加载的情况。如果您未在文件中列出纹理,Minecraft 通常会在内容日志中抛出_警告_。纹理数量较少时可以忽略该警告,但仍建议您将所有纹理列入清单。
|
||||
|
||||
## File Structure
|
||||
## 可使用的纹理类型
|
||||
|
||||
The structure is simple. The file itself is in `RP/textures` and is named `textures_list.json`. The file includes the file path to every texture you want in the file:
|
||||
所有纹理!最佳实践表明,任何纹理都可以且_应该_被列入 textures_list.json 文件中以优化性能。
|
||||
|
||||
<CodeHeader>RP/textures/textures_list.json</CodeHeader>
|
||||
## 文件结构
|
||||
|
||||
```json
|
||||
结构非常简单。该文件位于 `RP/textures` 目录下,命名为 `textures_list.json`。文件包含您需要缓存的所有纹理文件路径:
|
||||
|
||||
::: code-group
|
||||
```json [RP/textures/textures_list.json]
|
||||
[
|
||||
"textures/blocks/foo",
|
||||
"textures/blocks/bar",
|
||||
@@ -37,7 +40,8 @@ The structure is simple. The file itself is in `RP/textures` and is named `textu
|
||||
"textures/entity/bar"
|
||||
]
|
||||
```
|
||||
:::
|
||||
|
||||
## Automating
|
||||
## 自动化处理
|
||||
|
||||
If you have a lot of textures, this could obviously be tedious to go and list all the texture paths. In this case you can start to use [Regolith](https://bedrock-oss.github.io/regolith/) with its wonderful filters.
|
||||
当您需要处理大量纹理时,手动列出所有纹理路径显然非常繁琐。此时可以使用集成强大过滤器的 [Regolith](https://bedrock-oss.github.io/regolith/) 工具来实现自动化处理。
|
||||
Reference in New Issue
Block a user