GuardCore
WorldGuard 的 use 标志是“全有或全无”的。这正是问题所在。
/rg flag spawn use deny
你刚刚锁上了门、熔炉、工作台、铁砧以及箱子。它们无法被分开控制,也从未有过这样的可能。大多数服务器通过在每个工作台周围划定子区域来绕过这一限制——导致 /rg list 中出现数十个没人记得创建过的条目。
GuardCore 将这一个标志拆分为十三个:
/rg flag spawn guardcore-use-doors deny
/rg flag spawn guardcore-use-barrels deny
门和箱子已锁定。工作台、铁砧和熔炉仍对公众开放。只需一个区域。
当区域标志仍然过于粗糙时
上述标志是按区域的。GuardCore 还支持按方块进行设置:
在整个城镇范围内拒绝 use-doors,然后标记出那三扇仍应允许打开的门。
在出生点拒绝 use,设置 chest-use-exception allow,然后标记那两个玩家可从中取物的箱子。
右键点击法杖即可。这就是全部的工作流程。
每个例外都是作用域化的。 它会记录创建该例外的区域,并在该方块不再归属于该区域的瞬间停止生效。调整区域大小、删除区域或重命名区域——例外会自动静默。无论使用何种保护插件替代,你都不会留下任何无法解释的安全漏洞。
标志列表
交互 — use 拆分(13项,默认均为允许)
陷阱门 · 门 · 熔炉(包括烟熏炉、高炉) · 工作台 · 铁砧 ·
切石机 · 锻造台 · 砂轮 · 织布机 · 制图台 · 酿造台 · 附魔台 · 箱子
载具(4项) — 放置船 · 使用船 · 放置矿车 · 使用矿车。
将 放置 与 使用 分开是关键:交通枢纽可以让玩家乘坐其提供的矿车,而不让他们将自己的矿车放置在轨道上。此外,船仍是跨越出生点围墙的经典方式。
移动(1项) — 使用鞘翅。这是跨越围墙的另一经典方式,且无需放置任何物品。
实体(2项) — 允许宠物(适用于无宠大厅);以及供其他插件尊重的生物清理标记。
例外闸门(1项) — chest-use-exception。
哪些方块属于哪个家族由配置而非代码决定:基于名称的映射表,带有 *_SUFFIX 通配符,因此 Minecraft 下个月添加的新方块可以通过 YAML 分配,而无需更新插件。
你未获得的功能
买家理应提前知晓。GuardCore 仅增加 use 的粒度。它并不替换任何功能。
没有 PvP 标志、进入标志、退出标志、箱子访问标志、生物生成标志、破坏方块标志、放置方块标志或建造标志。WorldGuard 中的这些标志历史悠久,部署范围更广,且经过更充分的测试,远非本插件所能超越。重新实现它们意味着两个插件会在相同的事件上发生冲突。
这不是声明类插件,不是反破坏插件,也不是 WorldGuard 的替代品——后者是其永久硬依赖。捆绑的文档中包含完整的“应使用哪个标志”对照表。
安装它不会改变任何东西
GuardCore 仅在你为区域明确写入的值上发挥作用。未被任何区域覆盖的位置,以及从未提及任何标志的区域,都完全不受影响。放入 jar 包,重启服务器,你的服务器表现将与之前完全一致——直到你设置了一个标志。
对于这样一个作用于 PlayerInteractEvent 的东西来说,这是唯一可接受的初始印象。
它能与其他插件良好协作
服务器上没有任何插件需要知道 GuardCore 的存在。 执行过程是通过普通的、可取消的 Bukkit 事件完成的——仅此而已。GuardCore 不调用任何其他插件的 API,没有钩子(hooks),也不需要其他作者实现任何东西。
- 声明类插件: 两者都会取消相同的事件, whichever denies first wins(谁先拒绝谁获胜)。两个独立的“不”投票产生一个“不”。无需配置。
- 区域挖矿工具: 它们通过真实事件逐个方块进行操作,因此按方块的规则对它们的作用与对手动挥动完全相同。
- 宠物插件: 宠物通过
CreatureSpawnEvent 生成。allow-pets deny 会取消生成——无需软依赖,无需编写集成代码。
使保护变松的那个监听器 —— 即按方块的例外覆盖 —— 受到五个条件的限制,并且它绝不会覆盖它无法归因于 WorldGuard 的拒绝。如果声明类插件取消了交互,GuardCore 会保持原样,因为它无法知道那个插件正在保护什么。危险的逃生舱已被移除,且一行配置即可禁用整个机制。
Bukkit 的 ServicesManager 上提供了一个可选的只读查询服务,供希望在行动前询问的插件使用。没有 API jar 包,也不应将 GuardCore 添加到其 pom.xml 中。
还值得了解
- 标志在
onLoad() 中注册,这是 WorldGuard 唯一接受标志注册的时机。如果处理不当,标志插件可能会无声地失效;而 GuardCore 能正确执行,报告所有未能成功注册的标志,并将任何失败的标志视为 允许(allow),而非无法解释的拒绝。
- 可配置的标志前缀,支持遗留前缀。 正在从旧版设置迁移?设置
prefix: cc、legacy-prefixes: [communitycore],即可让所有现有区域继续正常工作——GuardCore 会复用你数据中已存在的名称,而不是重命名任何东西。
- 按家族选择性禁用。
/rg flag 补全中多出二十个额外条目是一个实际的成本。被禁用的家族将完全不进行注册。
- 批量同步标志并支持试运行。 手动在两百个区域上设置单个标志是导致服务器放弃精细粒度标志的原因。只需一条命令,加上
--dry-run 即可精确报告将要进行的更改。
/guardcore where —— 查看脚下解析出的区域、其优先级以及每个标志的有效值。这条命令能将“标志已设置但门仍然打不开”的问题转化为十秒内就能得到解答。
- 原子写入。 GuardCore 拥有的唯一一个文件采用“先写入临时文件再移动”的方式。一个未写完的例外列表会导致无声的保护漏洞。
- 开箱即用的双语支持。 英文和荷兰语均完整提供,包括法杖的名称和描述文本。没有任何面向玩家的文本是硬编码的。
- 基于权限,而非基于阶级。 一个全局绕过权限加上每个家族一个节点权限。插件中没有任何地方使用阶级名称。
- 三个模块,每个均可单独切换,且当依赖缺失时会拒绝半启动状态。
命令
| 命令 |
功能 |
/guardcore where |
此处解析到的区域,以及每个标志的值 |
/guardcore flags |
所有标志、是否已注册、以及所使用的名称 |
/guardcore exceptions <list|tp|remove> |
管理按区块的例外情况 |
/guardcore sync <world> <source> <target> <allow|deny> [--dry-run] |
批量编辑标志 |
/guardcore <status|reload> |
查看状态并实时重载 |
/gcexception <add|remove|info|wand> |
标记你正看着的区块 |
完整的命令、权限和标志参考请查阅捆绑的 docs/ 目录。
要求
- Paper 1.21 或更高版本
- Java 21 或更高版本
- WorldGuard 7 — 必需,也是唯一的依赖项
不支持 Spigot 和 Folia。请先安装 WorldGuard,并在服务器停止运行时安装 GuardCore:标志只能在启动期间注册。
GuardCore
WorldGuard's use flag is all-or-nothing. That is the whole problem.
/rg flag spawn use deny
You just locked the doors and the furnaces and the crafting tables and the
anvils and the barrels. There is no way to separate them, and there never has been. Most
servers work around it by carving a sub-region around every crafting table — dozens of
entries in /rg list that nobody remembers creating.
GuardCore splits that one flag into thirteen:
/rg flag spawn guardcore-use-doors deny
/rg flag spawn guardcore-use-barrels deny
Doors and barrels locked. Crafting tables, anvils and furnaces still public. One region.
And when a region flag is still too coarse
The flags above are per-region. GuardCore also does per-block:
Deny use-doors across a whole town, then mark the three doors that should still open.
Deny use across spawn, set chest-use-exception allow, then mark the two barrels
players may take from.
Right-click with the wand. That is the whole workflow.
Every exception is scoped. It records the region it was created in and stops applying
the moment the block no longer resolves to that region. Resize the region, delete it,
rename it — the exception goes quiet by itself. You never leave an unexplained hole behind
in whatever protection replaces it.
The flags
Interaction — the use split (13, all default allow)
trapdoors · doors · furnaces (and smokers, blast furnaces) · crafting tables · anvils ·
stonecutters · smithing tables · grindstones · looms · cartography tables · brewing stands ·
enchanting tables · barrels
Vehicles (4) — place boats · use boats · place minecarts · use minecarts.
Splitting place from use is the point: a transport hub can let players ride the
minecarts it provides without letting them drop their own on the rails. And a boat is still
the classic way over a spawn wall.
Movement (1) — use elytra. The other classic way over a wall, and it needs nothing
placed.
Entities (2) — allow pets, for a no-pets lobby; and a mob-cleanup marker other plugins
can honour.
The exception gate (1) — chest-use-exception.
Which blocks fall in which family is configuration, not code: a name-based map with
*_SUFFIX wildcards, so a block Minecraft adds next month gets assigned in YAML rather than
in a plugin update.
What you are not getting
A buyer deserves this up front. GuardCore adds granularity to use. It does not replace
anything.
There is no pvp flag, no entry, no exit, no chest-access, no mob-spawning, no block-break,
no block-place, no build. WorldGuard's versions of those are years older, far more widely
deployed, and better tested than anything this plugin would write. Re-implementing them
would mean two plugins fighting over the same events.
It is not a claim plugin, not an anti-grief plugin, and not a replacement for WorldGuard —
which is a permanent hard dependency. The bundled docs include a full "which flag to reach
for" table.
Installing it changes nothing
GuardCore acts only on a value you explicitly wrote on a region. A location no region
covers, and a region that never mentions a flag, are both left completely alone. Drop the
jar in, restart, and your server behaves exactly as it did — until you set a flag.
That is the only acceptable first impression for something that sits on
PlayerInteractEvent.
It plays well with everything else
No plugin on your server needs to know GuardCore exists. Enforcement is ordinary,
cancellable Bukkit events — nothing more. GuardCore calls no other plugin's API, has no
hooks, and has nothing for another author to implement.
- Claim plugins: both cancel the same events, whichever denies first wins. Two
independent "no" votes produce one "no". Nothing to configure.
- Area-mining tools: they act one block at a time through real events, so per-block
rules apply to them exactly as they do to a manual swing.
- Pet plugins: pets are spawned through
CreatureSpawnEvent. allow-pets deny cancels
the spawn — no soft dependency, no integration to write.
The one listener that makes protection looser — the per-block exception override — is
fenced in by five conditions, and it never overrides a denial it cannot attribute to
WorldGuard. If a claim plugin cancelled the interaction, GuardCore leaves it exactly as it
found it, because it has no way to know what that plugin was protecting. The dangerous
escape hatch ships off, and one config line disables the whole mechanism.
There is an optional read-only query service on Bukkit's ServicesManager for a plugin that
wants to ask before it acts. No API jar, and nothing should add GuardCore to its
pom.xml.
Also worth knowing
- Flags register in
onLoad(), which is the only time WorldGuard accepts them. Get this
wrong and a flag plugin ships silently broken; GuardCore gets it right, reports every flag
that did not make it, and makes any failed flag behave as allow rather than as an
unexplained denial.
- A configurable flag prefix, with legacy prefixes. Migrating from an older setup? Set
prefix: cc, legacy-prefixes: [communitycore] and every existing region keeps working —
GuardCore reuses the name your data already has rather than renaming anything.
- Per-family opt-out. Twenty extra entries in
/rg flag tab completion is a real cost.
A family you switch off is not registered at all.
- Bulk flag sync with a dry run. Setting one flag on two hundred regions by hand is why
servers give up on fine-grained flags. One command, and
--dry-run reports exactly what
would change.
/guardcore where — which region resolves at your feet, its priority, and every
flag's effective value. This is the command that turns "the flag is set and the door still
will not open" into a ten-second answer.
- Atomic writes. The one file GuardCore owns is written temp-then-move. A half-written
exception list would be a silent protection hole.
- Bilingual out of the box. English and Dutch ship complete, including the wand's name
and lore. No player-facing text is hardcoded.
- Permission-driven, never rank-driven. A global bypass plus one node per family. No
rank name anywhere in the plugin.
- Three modules, each switchable, each refusing to half-start when a dependency is off.
Commands
| Command |
What it does |
/guardcore where |
which region resolves here, and every flag's value |
/guardcore flags |
every flag, whether it registered, under which name |
/guardcore exceptions <list|tp|remove> |
manage per-block exceptions |
/guardcore sync <world> <source> <target> <allow|deny> [--dry-run] |
bulk flag edit |
/guardcore <status|reload> |
status and a live reload |
/gcexception <add|remove|info|wand> |
mark the block you are looking at |
Full command, permission and flag reference in the bundled docs/.
Requirements
- Paper 1.21 or newer
- Java 21 or newer
- WorldGuard 7 — required, and the only dependency
Spigot and Folia are not supported. Install WorldGuard first, and install GuardCore with the
server stopped: flags can only be registered during start-up.
评论 0
登录后参与评分
还没有评论,来抢沙发吧