LootrPlugin
LootrPlugin 为每位玩家提供独立的战利品库存,适用于支持原版战利品表的容器。玩家可以探索相同的结构并获得各自的战利品,无需争抢先手。
亮点
- 每位玩家拥有独立的战利品库存,并保存库存内容。
- 当首次打开带有原版战利品表的支持容器时,自动进行转换。
- 支持箱型方块容器(包括箱子、陷阱箱和木桶)以及存储矿车(当服务器将其暴露为可掠夺容器时)。
- 防止破坏、漏斗抽取、爆炸和活塞推动,并支持配置商店排除项。
- 可选粒子效果,用于显示附近玩家尚未掠夺的容器。
- 通过 QuickShop 元数据/名称/API 检查,避免转换商店容器。
- 可选的按玩家计时刷新功能。启用后,在配置的间隔时间过后,玩家下次打开该容器时将重新生成其战利品。
- 管理员命令:
/lootr help、reload、info、stats、clear、reset 和 list。
兼容性
此分支基于 Paper 26.3(使用 paper-api:26.3.build.258-stable)和 Java 25。插件描述符声明了 api-version: '26.3';旧于该版本的服务器将拒绝加载此插件。对于 Purpur 等分支服务器的兼容性,请在生产使用前针对具体的服务器构建版本进行检查。
构建
安装 JDK 25 和 Maven,然后运行:
mvn --batch-mode clean verify
输出的 JAR 文件为 target/LootrPlugin-1.3.0.jar。Paper API 是一个 provided 依赖项,不会打包到插件中。
安装
- 备份你的服务器及现有的
plugins/LootrPlugin 数据。
- 将
LootrPlugin-1.3.0.jar 复制到服务器的 plugins 目录中。
- 在 Paper 26.3 或更高版本上启动服务器,然后检查控制台是否有启动错误。
- 根据需要编辑
plugins/LootrPlugin/config.yml,然后运行 /lootr reload。
定时战利品刷新
在 config.yml 中:
loot:
refresh-hours: 24
设置为 24 表示每位玩家在上一轮战利品生成后的 24 小时重新生成自己的战利品。刷新是懒加载的:过期的战利品将在该玩家下次与容器交互时重新生成。将其设置为 0(默认值)以禁用自动刷新。缺少 generatedAt 字段的现有玩家数据文件仍可正常读取;其刷新计时器将在更新后的插件首次加载这些文件时开始计算。
管理员命令
/lootr info — 查看你当前注视的容器信息。
/lootr stats — 显示插件和存储计数统计。
/lootr reset — 重置你当前注视的容器对所有玩家的数据。
/lootr clear <player|all> — 清除已存储的玩家战利品。
/lootr list [page] — 列出注册的容器。
/lootr reload — 重新加载配置文件。
始终建议先在副本世界和插件数据中测试插件升级。
LootrPlugin
LootrPlugin gives each player a separate loot inventory for supported vanilla loot-table containers. Players can explore the same structure and receive their own loot without racing to be first.
Highlights
- Instanced loot per player, with saved inventory contents.
- Automatic conversion when a supported container with a vanilla loot table is first opened.
- Supports chest-style block containers (including chests, trapped chests and barrels) and storage minecarts when the server exposes them as lootable containers.
- Protection against breaking, hoppers, explosions and pistons, with configurable shop exclusions.
- Optional particles for containers a nearby player has not looted.
- QuickShop metadata/name/API checks to avoid converting shop containers.
- Optional per-player timed refresh. When enabled, a player's loot is regenerated the next time they open that container after the configured interval.
- Admin commands:
/lootr help, reload, info, stats, clear, reset and list.
Compatibility
This branch targets Paper 26.3 using paper-api:26.3.build.258-stable and Java 25. The plugin descriptor declares api-version: '26.3'; servers older than that will reject the plugin. Compatibility with forks such as Purpur should be checked on the exact server build before production use.
Build
Install JDK 25 and Maven, then run:
mvn --batch-mode clean verify
The output JAR is target/LootrPlugin-1.3.0.jar. The Paper API is a provided dependency and is not bundled into the plugin.
Installation
- Back up your server and existing
plugins/LootrPlugin data.
- Copy
LootrPlugin-1.3.0.jar into the server's plugins directory.
- Start the server on Paper 26.3 or newer, then check the console for startup errors.
- Edit
plugins/LootrPlugin/config.yml as needed and run /lootr reload.
Timed loot refresh
In config.yml:
loot:
refresh-hours: 24
A value of 24 lets each player regenerate their own loot 24 hours after their previous loot generation. Refresh is lazy: expired loot is regenerated on that player's next interaction with the container. Set it to 0 (the default) to disable automatic refresh. Existing player-data files without a generatedAt field remain readable; their refresh timer starts when the updated plugin first loads them.
Admin commands
/lootr info — inspect the container you are looking at.
/lootr stats — show plugin and storage counts.
/lootr reset — reset the container you are looking at for every player.
/lootr clear <player|all> — clear stored player loot.
/lootr list [page] — list registered containers.
/lootr reload — reload the configuration.
Always test plugin upgrades on a copy of your world and plugin data first.
评论 0
登录后参与评分
还没有评论,来抢沙发吧