DatapackLoader
本项目托管在 Codeberg:
请使用 Codeberg 提交问题、拉取请求以及获取最新源代码。
DatapackLoader 会自动将数据包添加到你的 Minecraft 服务器中。它支持 Paper、Folia 和 Spigot,可以为你安装数据包并加速数据包的开发生涯。
功能
- 自动安装数据包:支持从
.zip URL、本地文件夹或内置的初始数据包进行安装。
- 即插即用工作流 — 将数据包放入插件的
datapacks 文件夹,它们将在下次启动时复制到你的世界中。
- 递归发现 — 处理嵌套归档文件和包装文件夹,并在解压后清理原始归档文件。
- 支持 Folia — 在 Folia 上运行时使用 Folia 的调度器。数据包本身仍需兼容 Folia。
- 兼容 Spigot — 基于 Paper API 构建,但在运行时仅使用 Bukkit API(除了受保护的-platform 检查)。
- 开发者模式 — 每次启动都进入应用了你数据包的全新世界。
- 轻量级 — 当插件在配置中被禁用时,不会注册任何命令或监听器。
要求
| 要求 |
版本 |
| Minecraft 服务器 |
26.3 或更高版本 (api-version: 26.3) |
| Java |
25 或更高版本 |
| 服务器软件 |
Paper 26.3+、Folia 26.3+ 或 Spigot 26.3+ |
此版本不支持较旧的 Minecraft 版本(1.21.x 及以下)。对于这些服务器,请使用 DatapackLoader 1.4.x。
安装
- 从 Codeberg releases 或 SpigotMC 下载
DatapackLoader-1.5.0.jar。
- 将 jar 文件放入服务器的
plugins/ 文件夹中。
- 启动服务器一次。DatapackLoader 会创建
plugins/DatapackLoader/config.yml 和 plugins/DatapackLoader/datapacks/。
- 使用以下任一方法添加数据包,然后停止并重新启动服务器以应用更改。
添加数据包
有三种添加数据包的方法:
1. 从 URL 导入(控制台)
dl import https://example.com/my-datapack.zip
URL 必须使用 http 或 https 并指向一个 .zip 文件。归档文件将被下载、解压并放置在插件的 datapacks 文件夹中。只有控制台可以运行此命令。
2. 拖放
将数据包文件夹或 .zip 归档文件放入:
plugins/DatapackLoader/datapacks/
在启动时,DatapackLoader 会在文件夹和归档文件中找到数据包,解压它们,并清理所使用的容器。
3. 初始数据包
在 config.yml 中设置 starter-datapack: true。如果 datapacks 文件夹为空,DatapackLoader 会从 misode/mcmeta 下载与你服务器版本对应的原版数据包。
命令和权限
| 命令 |
权限 |
描述 |
适用对象 |
/dl |
datapackloader.command |
基础命令。 |
拥有权限的所有人 |
/dl help |
datapackloader.command.help |
显示文档链接。 |
拥有权限的所有人 |
/dl import <url> |
datapackloader.command |
从 .zip URL 导入数据包。 |
仅限控制台 |
/dltp <worldname> |
datapackloader.command.tp |
以旁观者模式传送到世界的出生点。 |
玩家 |
所有权限默认授予 op。控制台发送者绕过权限检查。
配置
plugins/DatapackLoader/config.yml:
| 键 |
默认值 |
描述 |
disable-plugin |
false |
完全禁用数据包的导入和应用。 |
dev-mode-applied |
false |
developer-mode 使用的内部标志。请勿编辑。 |
starter-datapack |
false |
当数据包文件夹为空时下载初始数据包。 |
developer-mode |
false |
每次会话都引导进入全新世界。破坏性操作 — 见下文。 |
开发者模式
启用 developer-mode 后,DatapackLoader 会执行以下操作:
- 将你的数据包复制到当前世界的
datapacks 文件夹中。
- 删除不再作为活动级别的旧世界文件夹。
- 在
server.properties 中切换 level-name 的值,使其在 world 和 wor1d 之间交替。
- 停止服务器,以便它可以重新启动并加载新世界。
警告: 这会删除世界。请备份任何重要内容,并在启用开发者模式之前配置服务器以自动重启。
Folia
DatapackLoader 在运行时检测 Folia,并使用 Folia 的调度器来处理异步和同步工作。这使得插件兼容 Folia;但它并不能使不兼容 Folia 的数据包在 Folia 上正常工作。
构建
要求:JDK 25 和 Maven 3.9+。
mvn clean package
阴影插件 jar 文件写入到:
target/DatapackLoader-1.5.0.jar
构建过程会将 bStats 和 commons-io 重定位到 com.lichenaut.datapackloader.libs.* 下,以避免与其他插件发生冲突。
项目结构
src/main/java/com/lichenaut/datapackloader/
├── DatapackLoaderPlugin.java
├── command/ 命令执行器和标签补全
├── datapack/ 导入、发现、验证和应用逻辑
└── util/ 调度、消息、更新检查、世界处理
指标
DatapackLoader 使用 bStats 收集匿名使用统计信息。你可以在 plugins/bStats/config.yml 中全局选择退出。
许可证
DatapackLoader 采用 GNU 通用公共许可证 v2.0 授权。
DatapackLoader
This project is maintained on Codeberg:
Please use Codeberg for issues, pull requests, and the latest source.
DatapackLoader automatically adds datapacks to your Minecraft server. It can install
datapacks for you and speed up datapack development, with support for Paper, Folia, and
Spigot.
Features
- Automatic datapack installation from
.zip URLs, local folders, or a built-in
starter datapack.
- Drop-in workflow — put datapacks in the plugin's
datapacks folder and they are
copied into your world on the next start.
- Recursive discovery — nested archives and wrapper folders are handled, and the
original archive is cleaned up after extraction.
- Folia support — uses Folia's schedulers when running on Folia. Datapacks
themselves still need to be Folia-compatible.
- Spigot compatible — built against the Paper API but only uses Bukkit APIs at
runtime, apart from guarded platform checks.
- Developer mode — always boot into a fresh world with your datapacks applied.
- Lightweight — no commands or listeners are registered when the plugin is disabled
in its config.
Requirements
| Requirement |
Version |
| Minecraft server |
26.3 or newer (api-version: 26.3) |
| Java |
25 or newer |
| Server software |
Paper 26.3+, Folia 26.3+, or Spigot 26.3+ |
Older Minecraft versions (1.21.x and below) are not supported by this release.
Use DatapackLoader 1.4.x for those servers.
Installation
- Download
DatapackLoader-1.5.0.jar from the
Codeberg releases or
SpigotMC.
- Place the jar in your server's
plugins/ folder.
- Start the server once. DatapackLoader creates
plugins/DatapackLoader/config.yml
and plugins/DatapackLoader/datapacks/.
- Add datapacks using one of the methods below, then stop and start the server to
apply them.
Adding datapacks
There are three ways to add datapacks:
1. Import from a URL (console)
dl import https://example.com/my-datapack.zip
The URL must use http or https and point to a .zip file. The archive is downloaded,
extracted, and placed in the plugin's datapacks folder. Only the console can run this
command.
2. Drag and drop
Put a datapack folder or .zip archive into:
plugins/DatapackLoader/datapacks/
On startup, DatapackLoader finds datapacks inside folders and archives, extracts them,
and cleans up the containers it used.
3. Starter datapack
Set starter-datapack: true in config.yml. If the datapacks folder is empty,
DatapackLoader downloads the vanilla data pack for your server version from
misode/mcmeta.
Commands and permissions
| Command |
Permission |
Description |
Who |
/dl |
datapackloader.command |
Base command. |
Everyone with permission |
/dl help |
datapackloader.command.help |
Shows a link to the documentation. |
Everyone with permission |
/dl import <url> |
datapackloader.command |
Imports a datapack from a .zip URL. |
Console only |
/dltp <worldname> |
datapackloader.command.tp |
Teleports you to the world's spawn in spectator mode. |
Players |
All permissions default to op. Console senders bypass permission checks.
Configuration
plugins/DatapackLoader/config.yml:
| Key |
Default |
Description |
disable-plugin |
false |
Disables datapack importing and applying entirely. |
dev-mode-applied |
false |
Internal flag used by developer-mode. Do not edit. |
starter-datapack |
false |
Downloads a starter datapack when the datapacks folder is empty. |
developer-mode |
false |
Boots into a fresh world every session. Destructive — see below. |
Developer mode
When developer-mode is enabled, DatapackLoader:
- Copies your datapacks into the current world's
datapacks folder.
- Deletes old world folders that are no longer the active level.
- Toggles
level-name in server.properties between world and wor1d.
- Stops the server so it can restart with a fresh world.
Warning: This deletes worlds. Back up anything important and configure your server
to restart automatically before enabling developer mode.
Folia
DatapackLoader detects Folia at runtime and uses Folia's schedulers for asynchronous and
synchronous work. This makes the plugin Folia-compatible; it does not make
Folia-incompatible datapacks work on Folia.
Building
Requirements: JDK 25 and Maven 3.9+.
mvn clean package
The shaded plugin jar is written to:
target/DatapackLoader-1.5.0.jar
The build relocates bStats and commons-io under com.lichenaut.datapackloader.libs.* to
avoid conflicts with other plugins.
Project layout
src/main/java/com/lichenaut/datapackloader/
├── DatapackLoaderPlugin.java
├── command/ Command executors and tab completers
├── datapack/ Import, discovery, validation, and application logic
└── util/ Scheduling, messages, update checks, world handling
Metrics
DatapackLoader uses bStats to
collect anonymous usage statistics. You can opt out globally in
plugins/bStats/config.yml.
License
DatapackLoader is licensed under the GNU General Public License v2.0.
评论 0
登录后参与评分
还没有评论,来抢沙发吧