TebexClaimSystem
TebexClaimSystem 是一个适用于 Minecraft 1.8 Bukkit/Spigot 的插件,允许玩家通过自定义图形用户界面(GUI)在游戏内认领 Tebex 购买的商品,并让玩家在下一次上线时领取这些商品。
功能说明
- 接受来自控制台的类 Tebex 交付风格命令:
tebexclaimsystem add <username> <productName> <quantity>
- 将待处理的认领记录存储在扁平化的 YAML 文件中,以确保重启后数据不丢失
- 当玩家拥有待处理物品时,在加入服务器时通知玩家
- 每 30 分钟向有待处理认领记录的在线玩家发送提醒消息
- 打开一个 GUI,其中包含每个待处理商品的一个条目以及一个全部领取按钮
- 在认领前检查空闲的物品栏空间
- 执行可配置的商品命令,支持
{player} 占位符
- 记录每次认领的时间戳、玩家、商品和数量
安装步骤
- 构建插件 jar 文件。
- 将 jar 文件放入服务器的
plugins/ 文件夹中。
- 启动或重启服务器。
- 编辑
plugins/TebexClaimSystem/config.yml 以匹配你的商品/命令设置。
- 配置文件更改后重新加载或重启服务器。
命令
/tebexclaimsystem - 为玩家打开认领 GUI。
- 别名:
/tcs, /claimstore, /claims, /webstoreclaim, /wsc。
tebexclaimsystem add <username> <productName> <quantity> - 仅限控制台使用的命令(旨在用于 Tebex 交付)。
/tebexclaimsystem reload - 无需重启服务器即可重新加载 config.yml(权限节点为 tebexclaimsystem.reload,默认为 op)。
Tebex 示例
tebexclaimsystem add Notch vip_rank 1
tebexclaimsystem add Notch starter_kit 2
配置
主配置文件:plugins/TebexClaimSystem/config.yml
products
通过 ID 定义每个可认领的商品。ID 必须与 Tebex 发送的 <productName> 完全匹配。
displayName - GUI 中显示的名称
itemMaterial - GUI 图标的材质
requiredSlotsPerUnit - 每购买单位所需的空格检查数量
commands - 认领时执行的命令(支持 {player} 和 {quantity})
示例:
products:
vip_rank:
displayName: "&6VIP Rank"
itemMaterial: "EMERALD"
requiredSlotsPerUnit: 1
commands:
- "lp user {player} parent set vip"
starter_kit:
displayName: "&bStarter Kit"
itemMaterial: "CHEST"
requiredSlotsPerUnit: 2
commands:
- "give {player} diamond_sword 1"
- "give {player} bread 16"
gui
title - 物品栏标题
size - 物品栏大小(9-54,向上舍入到 9 的倍数)
claimAllSlot - “全部领取”按钮的槽位索引
claimAllName / claimAllMaterial - “全部领取”按钮的显示名称和材质
quantityLore - 数量文本的描述行(Lore)
messages
所有面向玩家的消息和反馈消息均可配置。
- 前缀令牌:
{prefix}
- 颜色支持:
& 颜色代码
运行时数据文件
创建在 plugins/TebexClaimSystem/ 目录下:
pending-claims.yml - 每位玩家/每种商品的当前待处理认领记录
claim-log.txt - 认领审计日志条目
每当添加或删除认领记录时,pending-claims.yml 会立即更新。
认领系统流程
- Tebex(或控制台)运行
tebexclaimsystem add ...
- TebexClaimSystem 存储该玩家/商品的待处理数量
- 玩家加入服务器,如果存在待处理认领记录则收到通知
- 玩家打开
/tebexclaimsystem(或任何配置的别名)
- 玩家点击某个商品或全部领取
- 插件验证可用的物品栏槽位
- 如果有效,则分发商品命令并移除待处理条目
- 认领记录写入
claim-log.txt
故障排除
unknown product 消息:确保 Tebex 商品 ID 与 products 下的键完全匹配。
- 玩家因空间不足无法认领:增加空闲物品栏槽位或调整
requiredSlotsPerUnit。
- 在游戏中拒绝控制台命令:
add 命令故意限制为仅由控制台发送者使用。
- GUI 中没有物品:验证
pending-claims.yml 是否有条目,并且商品 ID 存在于 config.yml 中。
TebexClaimSystem
TebexClaimSystem is a Minecraft 1.8 Bukkit/Spigot plugin that lets players claim Tebex purchases in-game through a custom GUI and allows players to collect their purchases the next time they are online.
What it does
- Accepts Tebex-delivery style commands from console:
tebexclaimsystem add <username> <productName> <quantity>
- Stores pending claims in a flat YAML file so claims survive restarts
- Notifies players on join when they have pending items
- Sends online reminder messages every 30 minutes to players with pending claims
- Opens a GUI with one entry per pending product plus a Claim All button
- Checks free inventory space before claiming
- Executes configurable product commands with
{player} placeholders
- Logs each claim with timestamp, player, product, and quantity
Installation
- Build the plugin jar.
- Put the jar in your server's
plugins/ folder.
- Start/restart the server.
- Edit
plugins/TebexClaimSystem/config.yml to match your products/commands.
- Reload/restart after config changes.
Commands
/tebexclaimsystem - Opens the claim GUI for players.
- Aliases:
/tcs, /claimstore, /claims, /webstoreclaim, /wsc.
tebexclaimsystem add <username> <productName> <quantity> - Console-only command (intended for Tebex delivery).
/tebexclaimsystem reload - Reloads config.yml without restarting the server (tebexclaimsystem.reload, default op).
Tebex example
tebexclaimsystem add Notch vip_rank 1
tebexclaimsystem add Notch starter_kit 2
Configuration
Main config file: plugins/TebexClaimSystem/config.yml
products
Define each claimable product by ID. The ID must match what Tebex sends as <productName>.
displayName - Name shown in GUI
itemMaterial - GUI icon material
requiredSlotsPerUnit - Space check amount per purchased unit
commands - Commands run on claim (supports {player} and {quantity})
Example:
products:
vip_rank:
displayName: "&6VIP Rank"
itemMaterial: "EMERALD"
requiredSlotsPerUnit: 1
commands:
- "lp user {player} parent set vip"
starter_kit:
displayName: "&bStarter Kit"
itemMaterial: "CHEST"
requiredSlotsPerUnit: 2
commands:
- "give {player} diamond_sword 1"
- "give {player} bread 16"
gui
title - Inventory title
size - Inventory size (9-54, rounded to a multiple of 9)
claimAllSlot - Slot index for Claim All button
claimAllName / claimAllMaterial - Claim All button display
quantityLore - Lore line for quantity text
messages
All player-facing and feedback messages are configurable.
- Prefix token:
{prefix}
- Color support:
& color codes
Runtime data files
Created in plugins/TebexClaimSystem/:
pending-claims.yml - Current pending claims per player/product
claim-log.txt - Claim audit log entries
pending-claims.yml is updated immediately whenever claims are added or removed.
Claim System
- Tebex (or console) runs
tebexclaimsystem add ...
- TebexClaimSystem stores pending quantity for that player/product
- Player joins and gets a notification if pending claims exist
- Player opens
/tebexclaimsystem (or any configured alias)
- Player clicks one item or Claim All
- Plugin validates available inventory slots
- If valid, product commands are dispatched and pending entry is removed
- Claim is written to
claim-log.txt
Troubleshooting
unknown product message: ensure Tebex product ID exactly matches a key under products.
- Player cannot claim due to space: increase empty inventory slots or tune
requiredSlotsPerUnit.
- Console command denied in-game:
add is intentionally restricted to console senders.
- No GUI items: verify
pending-claims.yml has entries and product IDs exist in config.yml.
评论 0
登录后参与评分
还没有评论,来抢沙发吧