Files
netease-modsdk-wiki/docs/mcguide/20-玩法开发/13-模组SDK编程/2-Python脚本开发/100-2.12版本物品id变更.md
2025-03-18 14:46:12 +08:00

139 lines
6.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 2.12版本物品id变更
## 简介
2.12版本与2.11版本相比有部分物品的名称发生了变更取消了附加值例如橙色羊毛从minecraft:wool 1变为minecraft:orange_wool云杉原木从minecraft:log 1变为minecraft:spruce_log。
## 处理方法
在ModSDK的接口与事件中我们针对上述情况做了以下处理
1. 对于返回物品信息字典的接口与事件:
newItemName及newAuxValue返回新版名称与附加值。
原字段itemName及auxValue返回旧版名称与附加值。
2. 对于接受物品信息字典的接口与事件:
当字典存在newItemName及newAuxValue时使用这两个字段。
不存在时使用旧字段itemName及auxValue。
## 注意事项
* 通过附加值获取获取方块状态接口没有做兼容例如GetBlockAuxValueFromStates、GetBlockStatesFromAuxValue、GetBlockStates、SetBlockStates如果您的组件对此有依赖则需要对这次的改动自行做兼容处理。
* **开发完成或正在开发的组件建议统一采用newItemName及newAuxValue字段也不要新旧字段混用。**
* 某些写法可能会失效,例如
```python
# 获取itemDict然后在他基础上修改itemName或auxValue后再用来生成
itemdict = GetPlayerItem()
itemdict['itemName'] = 'xxx'
itemdict['auxValue'] = itemdict['auxValue']+1
SpawnItemToPlayerInv(itemdict)
```
因为GetPlayerItem返回的itemDict含有新字段再传入SpawnItemToPlayerInv时会读取新字段生成物品因此对原字段的修改无效。
## 物品名称变更表
以下为2.12版本变更了名称的物品列表。表格内的名称省略了minecraft命名空间。
| 中文名称 | 旧命名 | 旧附加值 | 新命名 |
| :------------- | ----------- | -------- | ---------------------- |
| 白色羊毛 | wool | 0 | white_wool |
| 橙色羊毛 | wool | 1 | orange_wool |
| 品红色羊毛 | wool | 2 | magenta_wool |
| 淡蓝色羊毛 | wool | 3 | light_blue_wool |
| 黄色羊毛 | wool | 4 | yellow_wool |
| 黄绿色羊毛 | wool | 5 | lime_wool |
| 粉红色羊毛 | wool | 6 | pink_wool |
| 灰色羊毛 | wool | 7 | gray_wool |
| 淡灰色羊毛 | wool | 8 | light_gray_wool |
| 青色羊毛 | wool | 9 | cyan_wool |
| 紫色羊毛 | wool | 10 | purple_wool |
| 蓝色羊毛 | wool | 11 | blue_wool |
| 棕色羊毛 | wool | 12 | brown_wool |
| 绿色羊毛 | wool | 13 | green_wool |
| 红色羊毛 | wool | 14 | red_wool |
| 黑色羊毛 | wool | 15 | black_wool |
| 橡木原木 | log | 0 | oak_log |
| 云杉原木 | log | 1 | spruce_log |
| 白桦原木 | log | 2 | birch_log |
| 丛林原木 | log | 3 | jungle_log |
| 金合欢原木 | log2 | 0 | acacia_log |
| 深色橡木原木 | log2 | 1 | dark_oak_log |
| 橡木栅栏 | fence | 0 | oak_fence |
| 云杉木栅栏 | fence | 1 | spruce_fence |
| 白桦木栅栏 | fence | 2 | birch_fence |
| 丛林木栅栏 | fence | 3 | jungle_fence |
| 金合欢木栅栏 | fence | 4 | acacia_fence |
| 深色橡木栅栏 | fence | 5 | dark_oak_fence |
| 管珊瑚 | coral | 0 | tube_coral |
| 脑纹珊瑚 | coral | 1 | brain_coral |
| 气泡珊瑚 | coral | 2 | bubble_coral |
| 火珊瑚 | coral | 3 | fire_coral |
| 鹿角珊瑚 | coral | 4 | horn_coral |
| 失活的管珊瑚 | coral | 8 | dead_tube_coral |
| 失活的脑纹珊瑚 | coral | 9 | dead_brain_coral |
| 失活的气泡珊瑚 | coral | 10 | dead_bubble_coral |
| 失活的火珊瑚 | coral | 11 | dead_fire_coral |
| 失活的鹿角珊瑚 | coral | 12 | dead_horn_coral |
| 白色地毯 | carpet | 0 | white_carpet |
| 橙色地毯 | carpet | 1 | orange_carpet |
| 品红色地毯 | carpet | 2 | magenta_carpet |
| 淡蓝色地毯 | carpet | 3 | light_blue_carpet |
| 黄色地毯 | carpet | 4 | yellow_carpet |
| 黄绿色地毯 | carpet | 5 | lime_carpet |
| 粉红色地毯 | carpet | 6 | pink_carpet |
| 灰色地毯 | carpet | 7 | gray_carpet |
| 淡灰色地毯 | carpet | 8 | light_gray_carpet |
| 青色地毯 | carpet | 9 | cyan_carpet |
| 紫色地毯 | carpet | 10 | purple_carpet |
| 蓝色地毯 | carpet | 11 | blue_carpet |
| 棕色地毯 | carpet | 12 | brown_carpet |
| 绿色地毯 | carpet | 13 | green_carpet |
| 红色地毯 | carpet | 14 | red_carpet |
| 黑色地毯 | carpet | 15 | black_carpet |
| 白色潜影盒 | shulker_box | 0 | white_shulker_box |
| 橙色潜影盒 | shulker_box | 1 | orange_shulker_box |
| 品红色潜影盒 | shulker_box | 2 | magenta_shulker_box |
| 淡蓝色潜影盒 | shulker_box | 3 | light_blue_shulker_box |
| 黄色潜影盒 | shulker_box | 4 | yellow_shulker_box |
| 黄绿色潜影盒 | shulker_box | 5 | lime_shulker_box |
| 粉红色潜影盒 | shulker_box | 6 | pink_shulker_box |
| 灰色潜影盒 | shulker_box | 7 | gray_shulker_box |
| 淡灰色潜影盒 | shulker_box | 8 | light_gray_shulker_box |
| 青色潜影盒 | shulker_box | 9 | cyan_shulker_box |
| 紫色潜影盒 | shulker_box | 10 | purple_shulker_box |
| 蓝色潜影盒 | shulker_box | 11 | blue_shulker_box |
| 棕色潜影盒 | shulker_box | 12 | brown_shulker_box |
| 绿色潜影盒 | shulker_box | 13 | green_shulker_box |
| 红色潜影盒 | shulker_box | 14 | red_shulker_box |
| 黑色潜影盒 | shulker_box | 15 | black_shulker_box |
| 白色混凝土 | concrete | 0 | white_concrete |
| 橙色混凝土 | concrete | 1 | orange_concrete |
| 品红色混凝土 | concrete | 2 | magenta_concrete |
| 淡蓝色混凝土 | concrete | 3 | light_blue_concrete |
| 黄色混凝土 | concrete | 4 | yellow_concrete |
| 黄绿色混凝土 | concrete | 5 | lime_concrete |
| 粉红色混凝土 | concrete | 6 | pink_concrete |
| 灰色混凝土 | concrete | 7 | gray_concrete |
| 淡灰色混凝土 | concrete | 8 | light_gray_concrete |
| 青色混凝土 | concrete | 9 | cyan_concrete |
| 紫色混凝土 | concrete | 10 | purple_concrete |
| 蓝色混凝土 | concrete | 11 | blue_concrete |
| 棕色混凝土 | concrete | 12 | brown_concrete |
| 绿色混凝土 | concrete | 13 | green_concrete |
| 红色混凝土 | concrete | 14 | red_concrete |
| 黑色混凝土 | concrete | 15 | black_concrete |