Skip to content

Conversation

@YsGqHY
Copy link
Contributor

@YsGqHY YsGqHY commented Nov 17, 2025

修改 ConfigurationSection.getMap 扩展函数,使其支持将配置键从 String 类型转换为其他基本类型。

主要改动:

  • 将泛型参数 K 添加 reified 修饰符,使其在运行时保留类型信息
  • 新增 convertKey 函数,支持将 String 键转换为目标类型
  • 使用 taboolib.common5 的类型转换扩展函数(cint、clong 等)

修复前:section.getKeys(false) 返回的 String 类型键直接强转为 K,无法正确转换为 Int 等数值类型

修复后:根据泛型 K 的实际类型,自动将 String 键转换为对应类型

YsGqHY and others added 3 commits November 17, 2025 10:25
修改 ConfigurationSection.getMap 扩展函数,使其支持将配置键从 String 类型转换为其他基本类型。

主要改动:
- 将泛型参数 K 添加 reified 修饰符,使其在运行时保留类型信息
- 新增 convertKey 函数,支持将 String 键转换为目标类型
- 使用 taboolib.common5 的类型转换扩展函数(cint、clong 等)

修复前:section.getKeys(false) 返回的 String 类型键直接强转为 K,无法正确转换为 Int 等数值类型

修复后:根据泛型 K 的实际类型,自动将 String 键转换为对应类型
- 通过 WatchKey 获取监听目录,构建完整变更路径
- 更新 handleEvent 方法参数为完整路径
- 优化目录和文件路径匹配逻辑
- 确保回调函数接收正确的文件路径
- 保持原有 relativize 路径关系检查机制
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant