ChocoRent
一款轻量级的 Minecraft Paper 插件,用于创建可租赁的 WorldGuard 区域,并允许通过兼容 Vault 的经济系统租用这些区域。
简短说明
创建受保护的区域,并按周期向玩家收费。支持重启后数据持久化、通过 Vault 进行离线扣费,以及提供交互式 GUI 供所有者管理 WorldGuard 标志(Flags)。
功能
- 使用 WorldEdit 选区创建 ProtectedCuboidRegion 租赁区域
- 租赁区域和租约数据存储在插件配置中,实现持久化
- 周期性计费器,即使玩家离线也能通过 Vault 进行扣费
- 租约所有权转移时,WorldGuard 区域的所有权也会转让给承租者
- 租约所有者可通过 GUI 切换常见标志(BUILD, PVP, ENTRY)
- 管理员命令用于管理区域和标志
依赖要求
- Paper 1.21.x(或兼容的 PaperMC 版本)
- WorldGuard 7.x
- WorldEdit 7.x
- Vault API
- 兼容 Vault 的经济插件(例如 EssentialsX (economy)、iConomy 等)
安装步骤
- 构建插件(推荐生成普通 jar 文件):
- 执行
gradle build -> jar 文件位于 build/libs/ 目录下
- 将生成的 JAR 文件放入服务器的
plugins/ 文件夹中。
- 安装并配置 WorldEdit、WorldGuard、Vault 以及一个经济插件。
- 启动服务器以生成默认的
config.yml。
命令
-
/rent help
-
/rent create <period> <price>
- 根据当前的 WorldEdit 选区创建新的租赁区域。
- 示例:
/rent create week 30
- 权限:chocorent.create(管理员可绕过)
-
/rent delete <regionName>
- 删除租赁区域及其对应的 WorldGuard 区域。
- 权限:chocorent.delete(管理员可绕过)
-
/rent list
- 列出已配置的租赁区域。
- 权限:chocorent.list(管理员可绕过)
-
/rent info <regionName>
- 显示租赁区域的数据:周期、价格、上次支付时间。
- 权限:chocorent.info(管理员可绕过)
-
/rent visualize
- 可视化最近的租赁区域(粒子效果)。
- 权限:chocorent.visualize(管理员可绕过)
-
/rent lease <regionName>
- 租用租赁区域(扣除初始费用并注册租约)。
- 权限:chocorent.lease(管理员可绕过)
-
/rent manage
-
/rent manage <regionId>
- 打开交互式 GUI(供所有者或管理员使用),用于切换常见标志。
-
/rent manage setflag <regionId> <flag> <allow|deny>
- 管理员可以设置任何 WorldGuard StateFlag。租约所有者可以切换 BUILD/PVP/ENTRY。
权限
- chocorent.admin — 完全访问权限(默认:op)
- chocorent.create — 创建租赁区域(默认:op)
- chocorent.delete — 删除租赁区域(默认:op)
- chocorent.list — 列出区域(默认:op)
- chocorent.info — 查看信息(默认:op)
- chocorent.visualize — 可视化(默认:op)
- chocorent.lease — 租用区域(默认:true)
- chocorent.manage — 管理租约(默认:false)
请根据你的服务器权限插件需求调整默认值。
config.yml
- rent-zones: 存储的租赁区域定义(周期、价格、上次支付时间)
- leases: 跨重启持久化的活跃租约(regionId, playerUuid, price, periodSeconds, lastPaid)
示例:当租约处于活跃状态时,插件将尝试每隔一个周期自动扣除设定的价格;如果玩家无法支付,则移除该租约。
ChocoRent
A lightweight Minecraft Paper plugin for creating rentable WorldGuard regions and letting players lease them with Vault-compatible economies.
Short description
Create protected zones and charge players on a recurring schedule. Supports persistence across restarts, offline charging via Vault, and owner-manageable WorldGuard flags from an interactive GUI.
Features
- Create ProtectedCuboidRegion rent zones using WorldEdit selections
- Persistent rent zones and leases stored in plugin config
- Recurring charge ticker that charges players even when offline (via Vault)
- Lease ownership transfers WorldGuard region ownership to lessee
- Lease owner GUI to toggle common flags (BUILD, PVP, ENTRY)
- Admin commands to manage zones and flags
Requirements
- Paper 1.21.x (or compatible PaperMC)
- WorldGuard 7.x
- WorldEdit 7.x
- Vault API
- An economy plugin compatible with Vault (e.g., EssentialsX (economy), iConomy, etc.)
Installation
- Build the plugin (recommended: normal jar):
- gradle build -> jar in build/libs/
- Drop the produced JAR into your server's
plugins/ folder.
- Install and configure WorldEdit, WorldGuard, Vault, and an economy plugin.
- Start the server so the default
config.yml is generated.
Commands
-
/rent help
- Shows help and usage for all rent commands.
-
/rent create <period> <price>
- Create a new rent zone from your WorldEdit selection.
- Example:
/rent create week 30
- Permission: chocorent.create (admins bypass)
-
/rent delete <regionName>
- Deletes a rent zone and its WorldGuard region.
- Permission: chocorent.delete (admins bypass)
-
/rent list
- Lists configured rent zones.
- Permission: chocorent.list (admins bypass)
-
/rent info <regionName>
- Shows data for a rent zone: period, price, last paid.
- Permission: chocorent.info (admins bypass)
-
/rent visualize
- Visualize the nearest rent region (particle effect).
- Permission: chocorent.visualize (admins bypass)
-
/rent lease <regionName>
- Lease a rent zone (withdraws initial payment and registers lease).
- Permission: chocorent.lease (admins bypass)
-
/rent manage
- Show leases you can manage.
-
/rent manage <regionId>
- Opens an interactive GUI (owners or admins) for toggling common flags.
-
/rent manage setflag <regionId> <flag> <allow|deny>
- Admins can set any WorldGuard StateFlag. Lease owners can toggle BUILD/PVP/ENTRY.
Permissions
- chocorent.admin — full access (default: op)
- chocorent.create — create rent zones (default: op)
- chocorent.delete — delete rent zones (default: op)
- chocorent.list — list zones (default: op)
- chocorent.info — view info (default: op)
- chocorent.visualize — visualize (default: op)
- chocorent.lease — lease a zone (default: true)
- chocorent.manage — manage leases (default: false)
Adjust defaults in your server's permission plugin as required.
config.yml
- rent-zones: stored rent zone definitions (period, price, lastPaid)
- leases: active leases persisted across restarts (regionId, playerUuid, price, periodSeconds, lastPaid)
Example: when a lease is active the plugin will automatically attempt to withdraw the configured price every period and remove the lease if the player cannot pay.
评论 0
登录后参与评分
还没有评论,来抢沙发吧