关于此分支
这是由 MattiDragon 开发的 Universal Perms 的一个临时分支,已适配 Minecraft 1.21.11。
该分支的存在仅为了在原版更新等待期间保持模组在最新版本上正常运行。所做的更改仅限于实现 1.21.11 兼容性所必需的部分。
一旦原版项目完成更新,此分支将被设为隐藏(unlisted)。
Universal Perms
你是否曾经不得不在服务器上安装一个没有为其命令提供权限节点的模组?
你是否遇到过某些模组不允许你屏蔽其根命令访问权限的问题(比如 luckperms)?
好吧,这个模组解决了这些问题,以及更多。
使用方法
首先,你需要安装另一个模组来为你管理权限。我推荐 luckperms,但 player roles 也能起到同样的效果。
在使用本模组之前,我建议先登录一次,以便让 luckperms 识别所有节点,这样你就可以在网页编辑器中看到它们了。
现在我们开始设置权限。该模组为每个命令提供了两个权限节点:一个以 universal_perms.use 开头,另一个以 universal_perms.view 开头。
如果设置了 use 权限,它将覆盖命令的正常要求,使得拥有该权限且值设为 true 的人可以使用该命令,而拥有该权限且值设为 false 的人则被拒绝访问。
view 权限很有用,如果你只是想隐藏自动补全功能,但仍允许宏或其他功能使用这些命令。
对于所有原版命令(是的,甚至是 execute),子命令和参数会作为独立的子节点显示。例如,要禁用 /help <command> 的使用但不禁用 /help,你可以使用 universal_perms.use.help.command 节点。但是,这对于使用自己子命令系统的模组无效(为什么是 luckperms?)。
你甚至可以通过使用 universal_perms.use 和 universal_perms.view 作为权限节点来影响所有命令,但我看不出这样做有什么好处。
其他权限
该模组还添加了一些非命令但依然需要进行权限检查的权限节点。
universal_perms.misc.selector 允许使用选择器如 @a 和 @e。在原版中这需要权限等级 2
universal_perms.misc.query_block_nbt 允许客户端在使用 F3 + I 时从服务器查询一些方块数据。在原版中这需要权限等级 2
universal_perms.misc.query_entity_nbt 与上述相同,但针对实体
universal_perms.misc.update_difficulty 允许在暂停菜单中更改难度。
universal_perms.misc.update_difficulty_lock 允许更改难度锁定状态,默认为 universal_perms.misc.update_difficulty
universal_perms.misc.use_admin_blocks 如果玩家处于创造模式,则允许通过 minecrafts 的 isCreativeLevelTwoOp 检查。
这主要用于管理员工具,如命令方块和调试棒
还有一个 universal_perms.misc.forced_permission_level 元权限,可以设置为给予玩家一个原版的权限等级。
权限等级用作此模组添加的所有检查的默认值。它们也会发送给客户端,并在客户端用于某些功能(如游戏模式切换器)的检查。
它们应该涵盖所有尚未被覆盖的权限检查。
陷阱与怪癖
- 在发送客户端可用命令方面,
view 权限对 use 具有控制权。这意味着你可以创建命令可见但不可用的场景。
- 当目标被禁止/隐藏但命令本身可见时,指向其他命令的别名行为会很奇怪。以下是一些需要注意的原版别名列表:
tell 和 w 重定向到 msg
tp 重定向到 teleport
xp 重定向到 experiance
tm 重定向到 teammsg
- 如果其他模组比通常情况更晚添加其命令或在 universal perms 之后修改其要求,则与其他模组的兼容性无法保证。
About this fork
This is a temporary fork of Universal Perms by MattiDragon updated for Minecraft 1.21.11.
The fork exists only to keep the mod working on the latest version while upstream updates are pending. Changes are limited to what was necessary for 1.21.11 compatibility.
Once the original project is updated, this fork will be unlisted.
Universal Perms
Have you ever had to install mod that doesn't provide permission nodes for its commands on a server?
Have you had trouble with a mod not allowing you to block access to their root command (looking at you luckperms)?
Well, this mod fixes that, and more.
Usage
First, you'll need to install another mod to manage permissions for you. I recommend luckperms, but player roles should work just as well.
Before you start using this mod, I recommend logging in once so that luckperms gets to know all the nodes, so you can see them in the web editor.
Now we get to setting up the permissions. This mod provides two permissions for each command, one beginning with universal_perms.use and one with universal_perms.view.
If set, the use permissions overrides the commands normal requirements making anyone with it set to true able to use the command while denying access to anyone with it set to false.
The view permissions is useful if you just want to hide the autocompletion, but still allow functionality for macros or something else.
For all vanilla commands (yes, even execute), subcommands and arguments are visible as their own sub-nodes, for example, to disable the use of /help <command>, but not /help you would use the universal_perms.use.help.command node. However, this doesn't work with mods that use their own subcommand system (why luckperms?).
You can even affect all commands by using universal_perms.use and universal_perms.view as permission nodes, but I don't really see the benefit in that.
Misc Permissions
This mod also adds some permission nodes for things that aren't commands, but still use permission checks.
universal_perms.misc.selector allows the use of selectors like @a and @e. In vanilla this requires permission level 2
universal_perms.misc.query_block_nbt allows clients to query some block data from the server when using F3 + I. In vanilla this requires permission level 2
universal_perms.misc.query_entity_nbt is the same as above but for entities
universal_perms.misc.update_difficulty allows changing the difficulty in the pause menu.
universal_perms.misc.update_difficulty_lock allows changing the difficulty lock status, defaults to universal_perms.misc.update_difficulty
universal_perms.misc.use_admin_blocks allows minecrafts isCreativeLevelTwoOp check to pass if the player is in creative mode.
This is mostly used for admin tools like command blocks and debug sticks
There's also a universal_perms.misc.forced_permission_level meta permission that can be set to give a player a vanilla permission level.
Permission levels are used as defaults for all checks this mod adds. They are also sent to the client and are checked there for certain features like the gamemode switcher
They should cover all permissions checks that aren't already covered.
Pitfalls and Quirks
- The
view permission has power over the use one when it comes to sending the client the available commands. This means that you can create scenarios where a command is visible, but unusable.
- Commands that are aliases to other commands behave weirdly when their target is forbidden/hidden, but they are visible. Here is a list of vanilla aliases to watch out for:
tell and w redirect to msg
tp redirects to teleport
xp redirects to experiance
tm redirects to teammsg
- Compatibility with other mods isn't guaranteed if the other mods add their commands later than usual or mess with their requirements after universal perms does.
评论 0
登录后参与评分
还没有评论,来抢沙发吧