Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
GNU Affero General Public License v3.0 or later

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include the full AGPL license text

This file is only a short license notice, not the complete AGPL text that the README directs users to as the full license. For source archives or offline distributions, recipients still do not receive the license terms referenced by the notice itself, so replace this with the full GNU AGPL v3 text or add a separate COPYING file and point the README there.

Useful? React with 👍 / 👎.


Copyright (C) 2026 GroupMountain

This project is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This project is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this project. If not, see <https://www.gnu.org/licenses/agpl-3.0.html>.

SPDX-License-Identifier: AGPL-3.0-or-later
62 changes: 62 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# ModAPI

ModAPI 是 GroupMountain 维护的 Minecraft Bedrock Dedicated Server 模组开发接口库,面向基于 LeviLamina 与 GMLIB 的服务器扩展开发。项目提供一组 C++20 API,用于注册和管理自定义物品、方块、配方、游戏规则、世界生成、战利品表、效果、实体等内容。

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Stop advertising APIs that are only placeholders

This overview tells users the library provides registration/management APIs for blocks, loot tables, effects, and entities, but the corresponding public surface is not implemented: the block/entity/loot base headers only contain #pragma once plus includes, and include/modapi/effect/CustomEffectRegistry.h is empty. Users following the README will try to build against APIs that do not exist, so please limit the feature list to implemented modules or add the missing APIs.

Useful? React with 👍 / 👎.


## 功能概览

- 自定义物品、护甲、工具和食物组件注册接口
- 自定义合成、熔炉、酿造、切石、锻造等配方接口
- 自定义游戏规则、世界生成特征、战利品表、状态效果和实体接口
- Addons 加载支持
- 基于 xmake 的构建流程,并在构建后生成 DLL、PDB、LIB、头文件和 `manifest.json`

## 环境要求

- Windows / Visual Studio C++ 工具链
- [xmake](https://xmake.io/)
- C++20 编译环境
Comment on lines +15 to +17

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include Python in the build prerequisites

In a fresh Windows/Visual Studio environment that follows this list, the documented build can fail before compilation because xmake.lua runs python ./scripts/header_file_patch.py in after_load and python ./scripts/include_correction.py / format_all.py in before_build. Add Python to the required tools, including any version constraint if needed, so users know the executable must be on PATH.

Useful? React with 👍 / 👎.

- 依赖包:
- LeviLamina `26.10.*`
- LeviBuildScript `0.6.0`
- GMLIB `26.10.0`

依赖仓库已在 `xmake.lua` 中配置:

- `https://github.com/LiteLDev/xmake-repo.git`
- `https://github.com/GroupMountain/xmake-repo.git`

## 构建

```bash
xmake f -m release
xmake
```

构建完成后,产物会复制到 `bin/` 目录,主要包括:

- `bin/dll/ModAPI/ModAPI.dll`
- `bin/dll/ModAPI/manifest.json`
- `bin/pdb/ModAPI.pdb`
- `bin/lib/ModAPI.lib`
- `bin/include/`

## 项目结构

```text
include/modapi/ 对外公开的 ModAPI 头文件
src/modapi/ ModAPI 内部实现
src/mc/ Minecraft / LeviLamina 相关适配实现
scripts/ 构建辅助脚本
xmake.lua xmake 构建配置
```

## 开发说明

- 公开接口头文件位于 `include/modapi/`。
- 构建前会自动执行头文件包含修正和格式化脚本。
- 版本信息由 `scripts/get-version-info.lua` 读取并注入到 `include/modapi/Version.h.in` 生成的配置头中。
- 发布产物的 `manifest.json` 由 `scripts/generate-manifest.lua` 生成。

## 许可证

本项目基于 GNU Affero General Public License v3.0 或更新版本(AGPL-3.0-or-later)开源。完整许可文本见 [LICENSE](LICENSE)。
Loading