OS Cobblemon Library
适用于 Fabric 和 NeoForge 的轻量级共享 Cobblemon API 与兼容性库。
简介
OS Cobblemon Library 是用于 Cobblemon 模组的共享 API 和兼容层。
它将重复出现的宝可梦、存储、实体、事件、对战和图鉴集成统一到一个专注的公共 API 背后,使项目能够在 Fabric 和 NeoForge 之间共享相同的实现,而无需维护重复的 Cobblemon 集成代码。
该库有意提供基础设施,而非独立的游戏玩法系统。
亮点
- 宝可梦身份、形态、方面与印记
- 可复用的宝可梦属性匹配
- 命名空间感知的物种解析
- 无需命令即可创建和生成宝可梦
- 持久化的命名空间宝可梦数据
- 自然且高效的个体值(IV)检查
- 特性分类与类型辅助工具
- 原生宝可梦尺寸工具
- 队伍与电脑存储查询
- 宝可梦实体身份、所有权与状态
- 可复用的 Cobblemon 事件钩子
- 对战检查与分类
- 图鉴进度与完成度查询
- 共享的 Fabric 和 NeoForge 集成层
要求
Minecraft: 1.21.1 Cobblemon: 1.8.1 至 <1.9.0 Java: 21 加载器: Fabric & NeoForge
请使用与您的模组加载器匹配的文件。
Fabric
- Fabric Loader 0.17.2+
- Fabric API
- Fabric Language Kotlin
- Cobblemon 1.8.1 至 <1.9.0
NeoForge
- NeoForge 21.1.182+
- Cobblemon 1.8.1 至 <1.9.0
给玩家
OS Cobblemon Library 主要是一个依赖库。
它本身不会添加任何独立的游戏玩法内容。
当其他模组将OS Cobblemon Library列为必需依赖时,请安装它,并确保下载与您加载器匹配的 JAR 文件。
如果您已安装的模组中没有任何一个需要 OS Cobblemon Library,那么单独安装它不会增加新的游戏功能。
给开发者
OS Cobblemon Library 在以下包名下提供了专注的公共 API:
com.ourstory.oscobblemon
API 被组织为可复用的 Cobblemon 特定领域:
pokemon- 身份、匹配、创建、持久化数据、个体值、特性、类型、标签和尺寸entity- 宝可梦实体身份、所有权与状态storage- 队伍与电脑访问、查找、匹配和计数event- 可复用的 Cobblemon 事件订阅与生命周期处理battle- 对战检查与分类pokedex- 物种、形态、变体与完成度查询
共享功能在设计上尽可能保持加载器无关性,由 Fabric 和 NeoForge 模块处理平台特定的集成。
宝可梦 API
宝可梦 API 包含以下辅助功能:
- 稳定的命名空间物种身份
- 形态、方面与印记
- 阿尔法(Alpha)兼容性
- 不可变的身份快照
- 可复用的
PokemonMatcher谓词 - 跨命名空间的物种解析
- 宝可梦与 PokémonEntity 创建
- 直接服务端宝可梦生成
- 命名空间持久化模组数据
- 自然与超极巨个体值
- 完美个体值计数与总数
- 普通、隐藏、强制与未知特性的分类
- 当前形态类型检查
- 数据驱动的标签
- 原生尺寸类别与安全缩放值
持久化数据使用由消费模组拥有的命名空间键,允许项目在不复制 Cobblemon 集成逻辑的情况下,将自身状态附加到宝可梦上。
存储、实体与对战
PokemonStorage 提供对玩家队伍和电脑存储的共享访问,具备以下功能:
- UUID 查找
- 队伍槽位查找
- 成员资格快照
- 基于谓词的搜索
- 基于谓词的计数
PokemonEntities 提供只读辅助功能,包括:
- 底层宝可梦访问
- 宝可梦 UUID
- 所有者 UUID
- 对战状态
- 忙碌状态
- 进化状态
- 存在性与存活检查
BattleInspector 提供可复用的对战信息,包括:
- 野生对战
- 训练家对战
- PvP 对战
- 对战参与者
- 玩家 UUID
- 参与的宝可梦
- 昏厥的宝可梦
- 胜利者与失败者
事件 API
1.1 版本通过 Java 友好的 Cobblemon 事件钩子扩展了该库。
支持的事件领域包括:
- 捕获计算与捕获完成
- 进化
- 战斗开始与胜利
- 昏厥与逃跑
- 战斗 gimmick 指令
- 宝可梦的派出与收回
- 治疗
- 宝可梦方面(Aspects)
- 图鉴更新
- 宝可梦生成
- 实体保存与加载事件
- 孵化
- 交易
- 放生
- 昵称
- 等级变化
- 经验值变化
EventSubscriptionGroup 还可以跟踪多个订阅并统一取消订阅,使其适用于可重载或可选的系统。
图鉴 API
PokedexQueries 提供以下只读辅助功能:
- 已看到和已捕获的种类
- 形态进度
- 方面进度
- 闪光知识
- 全球图鉴计数
- 单个图鉴计数
- 完成百分比
文档
完整的 API 文档、集成指南和兼容性信息可在网上获取。
文档内容包括:
- 入门指南
- 公共 API 概览
- 集成模式
- 宝可梦 API
- 存储 API
- 事件 API
- 战斗 API
- 图鉴 API
- API 稳定性策略
- Cobblemon 更新策略
- 本地开发与 Maven 使用
许可证 & API 使用
OS Cobblemon Library 本身为 All Rights Reserved,并根据 OS Cobblemon Library Proprietary API License 分发。
开发者可以使用记录的公共 API 构建和分发独立模组。
使用 API 并不要求消耗型模组发布或披露其源代码。
除非获得单独授权,否则禁止重新分发、修改构建、重新品牌化或复制 Library 源代码。
支持该项目
在你的项目中使用 OS Cobblemon Library?
通过 Patreon 支持持续的维护、兼容性更新以及即将到来的 Our Story 项目。
如需集成帮助、API 建议、兼容性报告或错误报告,请加入 Discord 上的 Our Story 社区。
游戏托管
需要为你的 Cobblemon 项目搭建服务器吗?
使用 BisectHosting 托管你的服务器,并使用代码 OURSTORY 享受 25% OFF 优惠。
每笔购买都有助于支持 Our Story 项目的开发。
OS Cobblemon Library
A lightweight shared Cobblemon API and compatibility library for Fabric and NeoForge.
About
OS Cobblemon Library is a shared API and compatibility layer for Cobblemon mods.
It centralizes recurring Pokémon, storage, entity, event, battle and Pokédex integrations behind a focused public API, allowing projects to share the same implementation across Fabric and NeoForge instead of maintaining duplicated Cobblemon integration code.
The library intentionally provides infrastructure rather than standalone gameplay systems.
Highlights
- Pokémon identity, forms, aspects and marks
- Reusable Pokémon property matching
- Namespace-aware species resolution
- Command-free Pokémon creation and spawning
- Persistent namespaced Pokémon data
- Natural and effective IV inspection
- Ability classification and type helpers
- Native Pokémon size utilities
- Party and PC storage queries
- Pokémon entity identity, ownership and state
- Reusable Cobblemon event hooks
- Battle inspection and classification
- Pokédex progress and completion queries
- Shared Fabric and NeoForge integration layer
Requirements
Minecraft: 1.21.1 Cobblemon: 1.8.1 to <1.9.0 Java: 21 Loaders: Fabric & NeoForge
Use the file matching your mod loader.
Fabric
- Fabric Loader 0.17.2+
- Fabric API
- Fabric Language Kotlin
- Cobblemon 1.8.1 to <1.9.0
NeoForge
- NeoForge 21.1.182+
- Cobblemon 1.8.1 to <1.9.0
For Players
OS Cobblemon Library is primarily a dependency library.
It does not add standalone gameplay content by itself.
Install it when another mod lists OS Cobblemon Library as a required dependency, and make sure to download the JAR matching your loader.
If none of your installed mods require OS Cobblemon Library, installing it by itself will not add new gameplay features.
For Developers
OS Cobblemon Library provides a focused public API under:
com.ourstory.oscobblemon
The API is organized into reusable Cobblemon-specific domains:
pokemon- identity, matching, creation, persistent data, IVs, abilities, types, labels and sizeentity- Pokémon entity identity, ownership and statestorage- Party and PC access, lookup, matching and countsevent- reusable Cobblemon event subscriptions and lifecycle handlingbattle- battle inspection and classificationpokedex- species, form, variation and completion queries
Shared functionality is designed to remain loader-independent whenever possible, with Fabric and NeoForge modules handling platform-specific integration.
Pokémon API
The Pokémon API includes helpers for:
- Stable namespaced species identities
- Forms, aspects and marks
- Alpha compatibility
- Immutable identity snapshots
- Reusable
PokemonMatcherpredicates - Species resolution across namespaces
- Pokémon and PokémonEntity creation
- Direct server-side Pokémon spawning
- Namespaced persistent mod data
- Natural and Hyper Trained IV values
- Perfect IV counts and totals
- Common, Hidden, Forced and Unknown ability classification
- Current-form type inspection
- Data-driven labels
- Native size categories and safe scale values
Persistent data uses namespaced keys owned by the consuming mod, allowing projects to attach their own state to a Pokémon without copying Cobblemon integration logic.
Storage, Entities & Battles
PokemonStorage provides shared access to player Party and PC storage with:
- UUID lookup
- Party slot lookup
- Membership snapshots
- Predicate-based searches
- Predicate-based counts
PokemonEntities provides read-only helpers for:
- Underlying Pokémon access
- Pokémon UUIDs
- Owner UUIDs
- Battle state
- Busy state
- Evolution state
- Presence and alive checks
BattleInspector provides reusable battle information including:
- Wild battles
- Trainer battles
- PvP battles
- Battle actors
- Player UUIDs
- Participating Pokémon
- Fainted Pokémon
- Winners and losers
Event API
Version 1.1 expands the library with Java-friendly Cobblemon event hooks.
Supported event areas include:
- Capture calculations and completed captures
- Evolution
- Battle start and victory
- Fainting and fleeing
- Battle gimmick instructions
- Pokémon sending and recalling
- Healing
- Pokémon aspects
- Pokédex updates
- Pokémon spawning
- Entity save and load events
- Hatching
- Trading
- Releasing
- Nicknames
- Level changes
- Experience changes
EventSubscriptionGroup can also track multiple subscriptions and cleanly unsubscribe them together, making it useful for reloadable or optional systems.
Pokédex API
PokedexQueries provides read-only helpers for:
- Seen and caught species
- Form progress
- Aspect progress
- Shiny knowledge
- Global Pokédex counts
- Individual Pokédex counts
- Completion percentages
Documentation
Complete API documentation, integration guides and compatibility information are available online.
The documentation includes:
- Getting Started
- Public API Overview
- Integration Patterns
- Pokémon API
- Storage API
- Event API
- Battle API
- Pokédex API
- API stability policy
- Cobblemon update strategy
- Local development and Maven usage
License & API Use
OS Cobblemon Library itself is All Rights Reserved and distributed under the OS Cobblemon Library Proprietary API License.
Developers may build and distribute independent mods using the documented public API.
Using the API does not require consuming mods to publish or disclose their own source code.
Redistribution, modified builds, rebranding or copying Library source code are not permitted unless separately authorized.
Support the Project
Using OS Cobblemon Library in your project?
Support continued maintenance, compatibility updates and upcoming Our Story projects through Patreon.
For integration help, API suggestions, compatibility reports or bug reports, join the Our Story community on Discord.
Game Hosting
Need a server for your Cobblemon projects?
Host your server with BisectHosting and use code OURSTORY for 25% OFF.
Every purchase helps support the development of Our Story projects.
下载 OS Cobblemon Library
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 OS Cobblemon Library
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 OS Cobblemon Library
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 OS Cobblemon Library
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 OS Cobblemon Library
下载 OS Cobblemon Library
下载 OS Cobblemon Library
下载 OS Cobblemon Library
下载 OS Cobblemon Library
下载 OS Cobblemon Library
OS Cobblemon Library v1.7.0
新增
- 添加了生成修饰器,使兼容模组能够根据物种、形态、维度或玩家调整符合条件的野生宝可梦的遭遇概率。
OS Cobblemon Library v1.6.0
新增
- 为防御性 NBT 复制、类型化编解码器读写、存储值格式错误、更新失败回滚以及幂等移除操作添加了 PokemonData 回归测试。
- 为裸 Cobblemon ID 和显式命名空间的附加模组物种 ID 添加了 物种 ID 解析测试。
- 为环境战斗天气初始化添加了 NeoForge 1.8.4 运行时冒烟测试,并增加了针对服务器停止时距离缓存清理以及 Cobblemon
boot()Vmixin 目标的回归检查。
更改
- 本次维护版本未更改任何公共 API 或游戏玩法行为。
OSCL — v1.5.1
- 将版本限制的初始和活跃战斗天气桥接扩展至 Cobblemon 1.8.4。
- 支持 Fabric 和 NeoForge 上的 Cobblemon 1.8.2+1.21.1 至 1.8.4+1.21.1。
- 在 CI 中对所有三个受支持的 Cobblemon 版本构建两个加载器。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
模组
缓冲的原始输入和线程化的事件轮询
模组
一个用于收集生物掉落物的多区块模组。
模组
显示你正在注视的方块的信息。(适用于 Minecraft 1.16+ 的 Hwyla/Waila 分支)
模组
原版世界生成优化模组
模组
在游戏画面角落显示附近世界地形、玩家、生物和实体的地图。可创建路径点,帮助你找到标记过的位置。
模组
查看物品与配方
评论 0
登录后参与评分
还没有评论,来抢沙发吧