GetPerWorldPlugin 是一款轻量级、高性能的 Paper 插件,旨在赋予服务器管理员对插件命令使用地点的控制权。它通过拦截命令并检查玩家是否处于允许的世界中,来实现“按世界限制插件”的体验,且避免了动态加载/卸载插件所带来的不稳定性。
阻止玩家在创造模式下使用经济类命令,防止在枢纽(Hub)刷取 mcMMO 技能等级,并保持迷你游戏世界的纯净——所有这些只需一个简单的白名单配置即可实现。
它解决的问题
在拥有多个世界(生存、创造、枢纽、迷你游戏)的服务器上,全局生效的插件可能会引发混乱:
- 经济漏洞: 玩家在生存商店出售创造模式物品。
- 技能刷取: 在低风险世界中提升技能等级。
- 聊天刷屏: 玩家在大厅中使用大量依赖命令的功能。
解决方案
GetPerWorldPlugin 充当守门员的角色。当玩家输入命令时:
- 它会识别该命令属于哪个插件。
- 它会检查配置文件中是否对该插件进行了限制。
- 如果受限,它会检查玩家是否处于允许的世界中。
- 如果不被允许,该命令将被静默阻止。
主要功能
- 白名单系统: 你只需列出插件应该起作用的世界。所有其他世界将自动被阻止。
- Tab 补全隐藏: 受限制的命令会从 Tab 补全列表中移除,使这种限制感觉更加原生。
- 性能优化: 缓存配置和命令映射,确保仅产生 0.1ms 的额外开销。
- 全局绕过: 管理员可以通过单一权限绕过所有限制。
- 别名支持: 自动阻止主命令及其所有别名。
- 兼容 Multiverse: 与 Multiverse-Core 及其他世界管理插件无缝协作。
安装方法
- 下载
.jar 文件。
- 将其放入服务器的
plugins/ 文件夹中。
- 重启服务器。
- 配置
config.yml 文件。
- 运行
/gpw reload 命令。
要求:
- 服务器: Paper(或其分支如 Purpur)。
- Java: Java 21 或更高版本。
- Minecraft: 1.21.x +
配置说明
配置文件采用简单的白名单格式。如果某个插件未在配置中列出,则它在所有世界中均可用。如果已列出,则它仅在你指定的世界中可用。
文件位置: plugins/GetPerWorldPlugin/config.yml
plugin-restrictions:
# mcMMO 仅在这些世界中有效
mcMMO:
- survival
- survival_nether
- survival_the_end
# Jobs 仅限在主世界使用
Jobs:
- survival
# 限制经济类插件以防止创造模式漏洞
EssentialsX:
- survival
- shops
# Slimefun 仅在专用世界中有效
Slimefun:
- slimefun_world
blocked-message: "&c&l已阻止! &7此命令在此世界中不可用。"
debug: false
提示: 插件名称区分大小写。请使用在游戏中运行 /plugins 时显示的准确名称。
命令列表
/getperworld help - 显示帮助菜单。
/getperworld reload - 重新加载配置文件。
/getperworld list - 查看所有活动限制。
/getperworld info <plugin> - 查看允许特定插件的世界。
别名: /gpw, /perworld
权限节点
getperworld.admin - 允许访问重载和列表命令(默认:OP)。
getperworld.bypass - 允许玩家在任意世界中执行任何命令,忽略所有限制(默认:OP)。
getperworld.* - 授予所有权限。
常见问题
这会卸载插件吗?
不会。插件仍在后台运行。本插件仅阻止命令的执行。
为什么我仍然能在 Tab 补全中看到这些命令?
客户端会缓存 Tab 补全内容。切换世界或重新登录以更新补全列表。
这能用于原版命令吗?
不能。原版命令(如 /gamemode 或 /tp)不属于特定插件,因此无法通过此工具进行限制。请为这些命令使用 LuckPerms 等权限插件。
我的配置不起作用!
请检查插件名称的大小写。如果插件实际名为 mcMMO,那么写成 mcmmo 是无效的。请使用 /plugins 进行检查。
GetPerWorldPlugin is a lightweight, high-performance Paper plugin designed to give server administrators control over where plugin commands can be used. It creates a "per-world plugin" experience by intercepting commands and checking if the player is in an allowed world, without the instability of trying to load/unload plugins dynamically.
Stop players from using economy commands in creative mode, prevent mcMMO grinding in the hub, and keep your minigame worlds clean—all with a simple whitelist configuration.
THE PROBLEM IT SOLVES
On servers with multiple worlds (Survival, Creative, Hub, Minigames), global plugins can cause chaos:
- Economy Exploits: Players selling creative items in survival shops.
- Skill Grinding: Leveling up skills in low-risk worlds.
- Chat Spam: Players using command-heavy features in lobbies.
THE SOLUTION
GetPerWorldPlugin acts as a gatekeeper. When a player types a command:
- It identifies which plugin owns the command.
- It checks if that plugin is restricted in the config.
- If restricted, it checks if the player is in an allowed world.
- If not allowed, the command is silently blocked.
KEY FEATURES
- Whitelist System: You only list the worlds where a plugin should work. All other worlds are automatically blocked.
- Tab Completion Hiding: Restricted commands are removed from the tab-complete list, making the restriction feel native.
- Performance Optimized: Caches configurations and command mappings to ensure 0.1ms overhead.
- Global Bypass: Admins can bypass restrictions with a single permission.
- Alias Support: Blocks the main command and all its aliases automatically.
- Multiverse Ready: Works seamlessly with Multiverse-Core and other world managers.
HOW TO INSTALL
- Download the
.jar file.
- Place it in your server's
plugins/ folder.
- Restart your server.
- Configure the
config.yml.
- Run
/gpw reload.
Requirements:
- Server: Paper (or forks like Purpur).
- Java: Java 21 or higher.
- Minecraft: 1.21.x +
CONFIGURATION
The configuration uses a simple whitelist format. If a plugin is not listed in the config, it works everywhere. If it is listed, it only works in the worlds you specify.
File: plugins/GetPerWorldPlugin/config.yml
plugin-restrictions:
mcMMO will only work in these worlds
mcMMO:
- survival
- survival_nether
- survival_the_end
Jobs restricted to the main world
Jobs:
- survival
Economy plugins restricted to prevent creative exploits
EssentialsX:
- survival
- shops
Slimefun only in the dedicated world
Slimefun:
- slimefun_world
blocked-message: "&c&lBlocked! &7This command is not available in this world."
debug: false
Tip: Plugin names are case-sensitive. Use the exact name shown when you run /plugins in-game.
COMMANDS
/getperworld help - Show the help menu.
/getperworld reload - Reload the configuration file.
/getperworld list - View all active restrictions.
/getperworld info <plugin> - See which worlds allow a specific plugin.
Aliases: /gpw, /perworld
PERMISSIONS
getperworld.admin - Allows access to reload and list commands (Default: OP).
getperworld.bypass - Allows the player to use any command in any world, ignoring restrictions (Default: OP).
getperworld.* - Grants all permissions.
FAQ
Does this unload the plugin?
No. The plugin is still running in the background. This plugin only blocks the execution of commands.
Why can I still see the commands in Tab Complete?
The client caches tab completions. Switch worlds or relog to update the tab list.
Does this work with Vanilla commands?
No. Vanilla commands (like /gamemode or /tp) do not belong to a specific plugin and cannot be restricted by this tool. Use a permissions plugin like LuckPerms for those.
My config isn't working!
Check the capitalization of the Plugin Name. mcmmo will not work if the plugin is actually named mcMMO. Use /plugins to check.
评论 0
登录后参与评分
还没有评论,来抢沙发吧