ClaimCore
为 Paper 打造的领地声明与反破坏保护插件——围绕其他所有领地插件让你不得不绕开的痛点而构建。
一个领地是一系列矩形,而非一个包围盒。 标记一块地块。在它旁边标记一条带状区域。标记角落。这三者合并为一个 L 形的领地:同一个所有者、同一个成员列表、同一组标志位。没有接缝,没有包围盒吞掉你邻居的花园,不会占用你限额内的第二个领地名额。再做十几次这样的操作,它仍然只是一个领地。
付费前的彩色实时预览。 当手持工具时,地块会以彩色玻璃绘制——如果你可以声明该地块,显示为绿色;如果它与你的已有土地相连,显示为蓝色;如果你负担不起,显示为橙色;如果它属于其他人,显示为红色。世界中不会放置任何方块;每个方块都仅通过数据包发送给你个人。
游玩即赚取领地方块。 提供初始额度,每 N 分钟发放一次收益并设有每日上限,且有一条硬性规则:一列方块消耗一个领地方块,高度不限。撤销声明会立即全额返还。
信任一次,处处生效。 执行 /claim trustall Steve,Steve 便获得对你名下所有土地的信任权限——包括你尚未建立的领地。按领地的信任设置仍可覆盖此全局信任,因此你的金库可以与其余部分不同。
每个领地两组标志位。 分别定义访客和受信任玩家能做什么。“我的朋友可以打开我的箱子,陌生人不行”只需一条命令,无需妥协。
十六个标志位对应真实的反破坏报告。 破坏、放置、交互、容器、PvP、TNT、怪物爆炸、红石控制、活塞、物品展示框、盔甲架、载具、火焰、末影人破坏、其他爆炸、农田踩踏。没有任何标志位是为了服务于其他插件的功能而存在。
购买这款插件的理由
每个领地插件都存在的两个 Bug
活塞永远不会跨越领地边界——既不会进入领地,也不会离开领地。系统会检查方块当前所在的列及其目标位置,也会检查活塞头。这是一条硬性规则而非可配置标志位,因为这是 Minecraft 中最古老的领地绕过手段之一,且对于旁观者来说看起来像是“活塞工作了”。
爆炸是按方块过滤的,而非直接取消。 在领地边缘的苦力怕会在荒野中炸出弹坑,但保持领地完整。直接取消爆炸会导致 TNT 炮塔和刷怪笼在领地附近与远离领地时的行为表现不一致,玩家会注意到这一点。
以及那个消耗 TPS 的问题
存储不规则领地的直观方法是保存它所覆盖的每一列。一个 500×500 的领地则包含二十五万个装箱键值(boxed keys)——单块地块约占四兆字节——每次插件需要整体处理该领地时都要重新构建。
ClaimCore 将同样的领地存储为一个矩形。面积、包含关系、重叠、相邻及边界几何形状均通过对简短列表进行区间运算得出。
findClaim——在每次方块破坏、放置、交互、爆炸方块生成和活塞推动时运行——不分配任何内存。世界解析基于对象身份标识,而非每次调用都构建小写字符串;区块以原始 long 类型作为开放寻址表的键,而非 HashMap 中的装箱 Long;候选项以数组形式迭代,甚至没有迭代器对象。
十个领地还是十万个领地,单次方块破坏的成本完全相同。
也值得了解
- 无依赖项。
depend: 和 softdepend: 中均无内容。无需数据库、无需经济挂钩、无需其他保护插件的 API。ClaimCore 从不调用其他保护插件——它就是那个保护插件。
- 扁平文件,易于修复。 领地按世界分组存储,余额单独存放,格式经过文档化说明,所有者可在文本编辑器中修复任何部分。
- 认真对待数据安全。 每次保存都是原子的——先写入临时文件,再移动——并设有会话备份。保存不仅在定时器触发时进行,也在每次破坏性操作后执行,且仅针对发生变化的世界。无法解析的领地文件会停止模块加载,而不是静默加载为空领地集,因为从空集开始会让服务器上的所有基地失去保护,而下一次的自动保存会使这种状态永久化。
- 三个模块,各自可切换,当某个依赖项关闭时仅输出一条清晰的日志行——绝不会启动半残模块。关闭视觉效果后,保护功能依然完全一致,且不发送任何方块变化数据包。
- 基于权限驱动,而非等级驱动。
claimcore.blocks.bonus.<amount> 赋予某个用户组更多土地,而 ClaimCore 并不知晓什么是“等级”;撤销该节点,相应的额度也随之收回。插件内部从未出现任何等级名称。
- 开箱即用双语支持。 英文和荷兰语完整内置。每条消息、每个菜单字符串、每个标志位描述以及工具自身的名称和背景 lore 均位于语言文件中。
- 在关键处经过测试。 拥有 147 个单元测试,覆盖几何结构、选择规则、切割算法、合并规则、预算算术及轮廓几何——所有那些容易出错且代价高昂的部分。
ClaimCore
Land claims and grief protection for Paper — built around the thing every other claim
plugin makes you work around.
A claim is a list of rectangles, not a bounding box. Mark a plot. Mark a strip beside
it. Mark the corner. All three become one L-shaped claim: one owner, one member list, one
flag set. No seams, no bounding box swallowing your neighbour's garden, no second claim
against your limit. Do it a dozen more times and it is still one claim.
A live preview, in colour, before you pay. While the wand is in your hand the plot is
drawn in coloured glass — green if you can claim it, blue where it joins land you already
own, orange if you cannot afford it, red if it belongs to somebody else. Nothing is placed
in the world; every block is a packet sent to you alone.
Claim blocks you earn by playing. A starting allowance, a payout every N minutes with a
daily cap, and a hard rule that one block column costs one claim block, height free.
Unclaiming returns them in full, immediately.
Trust once, everywhere. /claim trustall Steve and Steve is trusted on everything you
own — including the claims you have not made yet. Per-claim trust still overrides it, so
your vault can be different from the rest.
Two flag sets per claim. What a visitor may do, and what a trusted player may do.
"My friends can open my chests, strangers cannot" is one command, not a compromise.
Sixteen flags that map to real grief reports. Break, place, interact, containers, PvP,
TNT, mob explosions, redstone controls, pistons, item frames, armour stands, vehicles,
fire, enderman grief, other explosions, farmland trampling. Nothing that exists to serve
another plugin's feature.
The reason to buy this one
The two bugs every claim plugin has
A piston never crosses a claim border — not into a claim, and not out of one. Both the
block's current column and its destination are checked, and so is the piston head. It is a
hard rule rather than a flag, because it is the oldest claim bypass in Minecraft and it
looks like "the piston worked" to anybody watching.
An explosion is filtered block by block, not cancelled. A creeper at the edge of a
claim craters the wilderness and leaves the claim intact. Cancelling outright would make
TNT cannons and mob farms behave differently near claims than away from them, and players
notice.
And the one that costs you TPS
The obvious way to store an irregular claim is a set of every column it covers. A 500×500
claim is then a quarter of a million boxed keys — about four megabytes for one plot —
rebuilt every time the plugin needs the claim as a whole.
ClaimCore stores that same claim as one rectangle. Area, containment, overlap,
adjacency and border geometry all come from interval arithmetic over a short list.
findClaim — which runs on every block break, place, interact, explosion block and piston
push — allocates nothing. The world is resolved by object identity rather than by
building a lowercased string every call, chunks are keyed by a primitive long in an
open-addressed table rather than a boxed Long in a HashMap, and candidates are iterated
as an array so there is not even an iterator object.
Ten claims and ten thousand claims cost the same per block break.
Also worth knowing
- No dependencies. Nothing in
depend:, nothing in softdepend:. No database, no
economy hook, no protection-plugin API. ClaimCore never calls another protection plugin —
it is the protection plugin.
- Flat files you can repair. Claims are grouped per world, balances are separate, and
the format is documented so an owner can fix any of it in a text editor.
- Data safety taken seriously. Every save is atomic — temp file, then move — with a
session backup, saves on a timer and after every destructive action, and only for the
worlds that changed. A claim file that will not parse stops the module rather than
loading silently as an empty claim set, because starting empty would unprotect every base
on the server and the next autosave would make it permanent.
- Three modules, each switchable, with one clear log line when a dependency is off —
never a half-started module. Turn the visuals off and the protection is identical with no
block-change packets at all.
- Permission-driven, never rank-driven.
claimcore.blocks.bonus.<amount> gives a group
more land without ClaimCore knowing what a rank is; revoke the node and the allowance goes
with it. No rank name anywhere in the plugin.
- Bilingual out of the box. English and Dutch ship complete. Every message, every menu
string, every flag description and the wand's own name and lore live in the language
files.
- Tested where it matters. 147 unit tests over the geometry, the selection rules, the
carve maths, the merge rules, the budget arithmetic and the outline geometry — all the
parts that are easy to get subtly and expensively wrong.
评论 0
登录后参与评分
还没有评论,来抢沙发吧