diff --git a/bukkit/loader/src/main/resources/translations/zh_cn.yml b/bukkit/loader/src/main/resources/translations/zh_cn.yml index 498ebfe90..9e458de6c 100644 --- a/bukkit/loader/src/main/resources/translations/zh_cn.yml +++ b/bukkit/loader/src/main/resources/translations/zh_cn.yml @@ -39,11 +39,11 @@ argument.parse.failure.aggregate.failure: "无效的组件 '': 无法从 '' 解析 " argument.parse.failure.namedtextcolor: "'' 不是颜色代码" command.reload.config.success: "重新加载配置完成. 耗时 毫秒 (异步: ms | 同步: ms)" -command.reload.config.failure: "重新加载配置失败,请检查控制台日志。" +command.reload.config.failure: "重新加载配置失败,请检查控制台日志" command.reload.pack.success: "资源包重新加载完成. 耗时 毫秒" -command.reload.pack.failure: "重新加载资源包失败,请检查控制台日志。" +command.reload.pack.failure: "重新加载资源包失败,请检查控制台日志" command.reload.all.success: "全部重新加载完成. 耗时 毫秒 (异步: ms | 同步: ms | 资源包: ms)" -command.reload.all.failure: "重新加载失败,请检查控制台日志。" +command.reload.all.failure: "重新加载失败,请检查控制台日志" command.item.get.success: "获得" command.item.get.failure.not_exist: "'>" command.item.give.success.single: "':'':''>" @@ -53,4 +53,39 @@ command.search_recipe.not_found: "找不到此物品的配方" command.search_usage.not_found: "找不到此物品的用途" command.search_recipe.no_item: "请手持物品后再执行此命令" command.search_usage.no_item: "请手持物品后再执行此命令" -command.totem.not_totem: "'' 不是 totem_of_undying 类型" \ No newline at end of file +command.totem.not_totem: "'' 不是 totem_of_undying 类型" +warning.config.image.duplicated: "在文件 中发现问题 - 图片 '' 重复定义" +warning.config.image.lack_height: "在文件 中发现问题 - 图片 '' 缺少必要的 'height' 高度参数" +warning.config.image.height_smaller_than_ascent: "在文件 中发现问题 - 图片 '' 违反位图规则:'height' 高度值不应小于 'ascent' 基准线高度" +warning.config.image.no_file: "在文件 中发现问题 - 图片 '' 缺少必要的 'file' 文件参数" +warning.config.image.invalid_resource_location: "在文件 中发现问题 - 图片 '' 的 'file' 参数 [] 包含非法字符,请参考资源路径规范:https://zh.minecraft.wiki/w/%E5%91%BD%E5%90%8D%E7%A9%BA%E9%97%B4ID#%E5%90%88%E6%B3%95%E5%AD%97%E7%AC%A6" +warning.config.image.invalid_font_name: "在文件 中发现问题 - 图片 '' 的 'font' 字体参数 [] 包含非法字符,请参考资源路径规范:https://zh.minecraft.wiki/w/%E5%91%BD%E5%90%8D%E7%A9%BA%E9%97%B4ID#%E5%90%88%E6%B3%95%E5%AD%97%E7%AC%A6" +warning.config.image.lack_char: "在文件 中发现问题 - 图片 '' 缺少必要的 'char' 字符参数" +warning.config.image.codepoint_in_use: "在文件 中发现问题 - 图片 '' 使用的字体 字符 [()] 已被其他图片 '' 占用" +warning.config.image.invalid_codepoint_grid: "在文件 中发现问题 - 图片 '' 的 'chars' 码位网格配置无效" +warning.config.image.file_not_exist: "在文件 中发现问题 - 图片 '' 对应的PNG文件 不存在" +warning.config.recipe.duplicated: "在文件 中发现问题 - 配方 '' 重复定义" +warning.config.i18n.unknown_locale: "在文件 中发现问题 - 未知的语言区域 ''" +warning.config.template.duplicated: "在文件 中发现问题 - 模板 '' 重复定义" +warning.config.vanilla_loot.type_not_exist: "在文件 中发现问题 - 原版战利品 '' 未设置 'type' 类型参数" +warning.config.vanilla_loot.block.invalid_target: "在文件 中发现问题 - 原版战利品 '' 中的方块目标 [] 无效" +warning.config.sound.duplicated: "在文件 中发现问题 - 音效 '' 重复定义" +warning.config.jukebox_song.duplicated: "在文件 中发现问题 - 唱片机歌曲 '' 重复定义" +warning.config.furniture.duplicated: "在文件 中发现问题 - 家具 '' 重复定义" +warning.config.furniture.lack_placement: "在文件 中发现问题 - 家具 '' 缺少必要的 'placement' 放置参数" +warning.config.furniture.element.lack_item: "在文件 中发现问题 - 家具 '' 的某个元素缺少必要的 'item' 物品参数" +warning.config.item.duplicated: "在文件 中发现问题 - 物品 '' 重复定义" +warning.config.item.lack_material: "在文件 中发现问题 - 物品 '' 缺少必要的 'material' 材料参数" +warning.config.item.invalid_material: "在文件 中发现问题 - 物品 '' 使用了无效的材料类型 ''" +warning.config.item.bad_custom_model_data_value: "在文件 中发现问题 - 物品 '' 的自定义模型数据值 [] 过大,建议使用低于16,777,216的值" +warning.config.item.custom_model_data_conflict: "在文件 中发现问题 - 物品 '' 的自定义模型数据 [] 与物品 '' 发生冲突" +warning.config.item.lack_model_id: "在文件 中发现问题 - 物品 '' 缺少必要的 'custom-model-data' 或 'item-model' 模型标识参数" +warning.config.block.duplicated: "在文件 中发现问题 - 方块 '' 重复定义" +warning.config.block.lack_state: "在文件 中发现问题 - 方块 '' 缺少必要的 'state' 状态参数" +warning.config.block.lack_real_id: "在文件 中发现问题 - 方块 '' 的 'state' 配置缺少必要的 'id' 标识参数" +warning.config.block.state.lack_state: "在文件 中发现问题 - 方块 '' 的 'state' 配置缺少必要的 'state' 状态参数" +warning.config.block.state.lack_properties: "在文件 中发现问题 - 方块 '' 的 'states' 配置缺少必要的 'properties' 属性配置" +warning.config.block.state.lack_appearances: "在文件 中发现问题 - 方块 '' 的 'states' 配置缺少必要的 'appearances' 外观配置" +warning.config.block.state.lack_variants: "在文件 中发现问题 - 方块 '' 的 'states' 配置缺少必要的 'variants' 变体配置" +warning.config.block.state.variant.lack_appearance: "在文件 中发现问题 - 方块 '' 的 '' 变体配置缺少必要的 'appearance' 外观参数" +warning.config.block.state.variant.invalid_appearance: "在文件 中发现问题 - 方块 '' 的 '' 变体引用了不存在的外观配置 ''" \ No newline at end of file diff --git a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/network/PacketConsumers.java b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/network/PacketConsumers.java index 42372cd01..b4d9ff905 100644 --- a/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/network/PacketConsumers.java +++ b/bukkit/src/main/java/net/momirealms/craftengine/bukkit/plugin/network/PacketConsumers.java @@ -972,28 +972,31 @@ public class PacketConsumers { Object entity = Reflections.method$EntityLookup$get.invoke(entityLookup, id); if (entity == null) return; Object entityType = Reflections.method$Entity$getType.invoke(entity); - if (entityType != Reflections.instance$EntityType$BLOCK_DISPLAY) return; - List packedItems = (List) Reflections.field$ClientboundSetEntityDataPacket$packedItems.get(packet); - for (int i = 0; i < packedItems.size(); i++) { - Object packedItem = packedItems.get(i); - int entityDataId = (int) Reflections.field$SynchedEntityData$DataValue$id.get(packedItem); - if ((VersionHelper.isVersionNewerThan1_20_2() && entityDataId != 23) - || (!VersionHelper.isVersionNewerThan1_20_2() && entityDataId != 22)) { - continue; + if (entityType == Reflections.instance$EntityType$BLOCK_DISPLAY) { + List packedItems = (List) Reflections.field$ClientboundSetEntityDataPacket$packedItems.get(packet); + for (int i = 0; i < packedItems.size(); i++) { + Object packedItem = packedItems.get(i); + int entityDataId = (int) Reflections.field$SynchedEntityData$DataValue$id.get(packedItem); + if ((VersionHelper.isVersionNewerThan1_20_2() && entityDataId != 23) + || (!VersionHelper.isVersionNewerThan1_20_2() && entityDataId != 22)) { + continue; + } + Object blockState = Reflections.field$SynchedEntityData$DataValue$value.get(packedItem); + Object serializer = Reflections.field$SynchedEntityData$DataValue$serializer.get(packedItem); + int stateId = BlockStateUtils.blockStateToId(blockState); + int newStateId; + if (!user.clientModEnabled()) { + newStateId = remap(stateId); + } else { + newStateId = remapMOD(stateId); + } + packedItems.set(i, Reflections.constructor$SynchedEntityData$DataValue.newInstance( + entityDataId, serializer, BlockStateUtils.idToBlockState(newStateId) + )); + break; } - Object blockState = Reflections.field$SynchedEntityData$DataValue$value.get(packedItem); - Object serializer = Reflections.field$SynchedEntityData$DataValue$serializer.get(packedItem); - int stateId = BlockStateUtils.blockStateToId(blockState); - int newStateId; - if (!user.clientModEnabled()) { - newStateId = remap(stateId); - } else { - newStateId = remapMOD(stateId); - } - packedItems.set(i, Reflections.constructor$SynchedEntityData$DataValue.newInstance( - entityDataId, serializer, BlockStateUtils.idToBlockState(newStateId) - )); } + // todo修改其他实体的物品的方块谓词 } catch (Exception e) { CraftEngine.instance().logger().warn("Failed to handle ClientboundSetEntityDataPacket", e); }