Pumpkin

应用程序

Pumpkin-MC/Pumpkin

用 Rust 构建的高性能 Minecraft 服务器。

项目简介

Pumpkin 是一个用 Rust 完全编写的 Minecraft 服务器,注重性能、兼容性和安全性。它同时支持 Java 和 Bedrock 版本,利用多线程提高速度,提供配置选项、插件和代理支持。该项目正在积极开发中,目标是成为快速、可定制的服务器替代方案。

README 预览

\n\n# Pumpkin\n\n\n[](https://discord.gg/wT8XjrjKkf)\n[](https://opensource.org/licenses/gpl-3-0)\n\n\n\n[Pumpkin](https://pumpkinmc.org/) is a Minecraft server built entirely in Rust, offering a fast, efficient,\nand customizable experience. It prioritizes performance and player enjoyment while adhering to the core mechanics of the game.\n\n\n\n\n\n\n## Goals\n\n- **Performance**: Leveraging multi-threading for maximum speed and efficiency.\n- **Compatibility**: Supports the latest Java & Bedrock Minecraft server version while adhering to Vanilla game mechanics.\n- **Security**: Prioritizes security by preventing known security exploits.\n- **Flexibility**: Highly configurable, with the ability to disable unnecessary features.\n- **Extensibility**: Provides a foundation for plugin development.\n\n> [!IMPORTANT]\n> Pumpkin is currently under heavy development.\n>\n> [See what needs to be done before the 1.0.0 Release](https://github.com/Pumpkin-MC/Pumpkin/issues/449)\n\n## Features\n\n- [x] Configuration (toml)\n- [Tracking: Protocol](https://github.com/Pumpkin-MC/Pumpkin/issues/1401)\n  - [x] Server Status/Ping\n  - [x] Encryption\n  - [x] Packet Compression\n  - [x] Java Edition\n  - [x] Bedrock Edition (W.I.P)\n  - ...\n- [Tracking: World](https://github.com/Pumpkin-MC/Pumpkin/issues/1403)\n  - [x] Player Tab-list\n  - [x] Scoreboard\n  - [x] World Loading\n  - [x] World Time\n  - [x] World Borders\n  - [x] World Saving\n  - [x] Lighting\n  - [x] Entity Spawning\n  - [x] Bossbar\n  - [x] Chunk Loading (Vanilla, Linear, Pump)\n  - [Chunk Generation](https://github.com/Pumpkin-MC/Pumpkin/issues/36)\n  - [x] Chunk Saving (Vanilla, Linear, Pump)\n  - [Redstone](https://github.com/Pumpkin-MC/Pumpkin/issues/1402)\n  - [x] Liquid Physics\n  - ...\n- [Tracking: Player](https://github.com/Pumpkin-MC/Pumpkin/issues/1405)\n  - [x] Skins\n  - [x] Teleport\n  - [x] Movement\n  - [x] Animation\n  - [x] Inventory\n  - [Combat](https://github.com/Pumpkin-MC/Pumpkin/issues/1404)\

常见问题 (5)

故障排除
如何修复 Pumpkin 服务器在重新加载后,包含已填充地图的区块从种子重新生成的问题?

这是由 Pumpkin 0.2.0+26.3–26.51 中的一个 NBT 序列化 bug 导致的。MapDecorationsImpl 使用了默认的 DataComponentImpl::write_data,它会为 minecraft:map_decorations 写入 NbtTag::End(0x00),而不是 TAG_Compound(0x0A)。无效的 NBT 使区块在重新加载时无法读取,因此 Pumpkin 会重新生成该区块并破坏其中的方块实体。

修复方法:将 Pumpkin 更新到包含 fix(data): prevent map decoration NBT corruption 更改的构建版本,在该版本中 map_decorations 会以复合标签的形式写入。

受影响版本的临时解决方案:先备份存档,然后在用 Pumpkin 加载该存档之前,从每个物品上移除 minecraft:map_decorations 组件。实际的地图图像不会丢失,因为它仍保存在 data/minecraft/maps/*.dat 中,并由正确序列化的 minecraft:map_id 组件引用。已经被重新生成的区块必须从备份中恢复;其方块实体无法从已被覆盖的区域文件中找回。

来源 Issue #3698
故障排除
为什么 Minecraft 服务器控制台命令在 Pterodactyl 或 Pelican 中会延迟一行显示?

在 Pumpkin 中,在 pumpkin.toml 的 [commands] 部分设置 use_tty = false,然后重启服务器:

[commands]
use_tty = false

这修复了第一条命令不被执行、每条命令只有在下一条命令发送后才会运行的问题。该问题由 Rustyline 依赖中的 TTY 处理 bug 引起;上游修复存在于提交 f2bbcc5 中,但在该问题被报告时尚未包含在已发布的版本中。

来源 Issue #3696
故障排除
为什么服务器在对大面积树苗使用 /fill 时会崩溃并产生 core dump?

崩溃是由无界的递归邻居/形状方块更新引起的。大量聚集的树苗、压力板以及类似的自毁方块会递归地传播更新,直到工作线程的堆栈溢出。请将您的服务器更新到包含修复程序的构建版本,该修复通过有界的迭代工作堆栈来处理邻居更新。作为受影响版本上的临时解决方法,请将填充操作拆分为较小的体积,例如使用 16×16×1 的层而不是 16×16×16:

/fill ~ ~ ~ ~15 ~ ~15 minecraft:acacia_sapling
/fill ~ ~1 ~ ~15 ~1 ~15 minecraft:acacia_sapling
/fill ~ ~2 ~ ~15 ~2 ~15 minecraft:acacia_sapling

继续递增 Y 坐标,直到填满整个体积。在修复之前,避免在单条命令中填充超过大约 512–576 个树苗或压力板方块。

来源 Issue #2016
故障排除
为什么正在枯萎的树叶方块会播放方块破坏音效,而不是悄无声息地消失?

这是由树叶枯萎逻辑调用 world.break_block(...) 导致的,该调用会触发方块破坏的音效和粒子效果。枯萎的树叶应使用 world.set_block_state(...),使其被静默移除,从而与原版行为保持一致。该修复已在提交 742beaf6f9f84fb99a04402434f6c6feb86667d1 中引入;请将你的服务器更新到包含 PR fix(block): don't play break effects when leaves decay 的构建版本。如果你在维护 fork,请将树叶枯萎逻辑中的 world.break_block(...) 调用替换为 world.set_block_state(...)。

来源 Issue #3058
故障排除
如何修复在 Pumpkin Minecraft 服务器上从侧面点燃时下界传送门生成部分损坏的问题?

这会影响 Pumpkin Java Edition 的 0.2.0+26.3 到 26.51 版本。当从侧面的黑曜石方块点燃传送门时,NetherPortal::create 在放置传送门方块时缺少原版的 UPDATE_KNOWN_SHAPE 标志,导致构建过程中的邻居更新会移除点燃的火焰和部分传送门方块。

修复方法:将 Pumpkin 更新到包含 PR fix(portal): write nether portal blocks without neighbour shape updates 的发布版本或构建(该 PR 修复了 issue #3839),然后重启服务器并重新点燃传送门。

临时解决方法:在传送门底部/地面的黑曜石方块上使用打火石,而不是侧面或垂直面。重新点燃前,请清除所有残留的火焰或不完整的传送门方块。

来源 Issue #3839