- 欢迎来到Minecraft插件百科!
- 对百科编辑一脸懵逼?帮助:快速入门带您快速熟悉百科编辑!
- 因近日遭受攻击,百科现已限制编辑,有意编辑请加入插件百科企鹅群:223812289
PermissionsEX:修订间差异
(→多世界继承) |
|||
第741行: | 第741行: | ||
当你在使用PEX插件时,你可以在文件里一行指定多个物品,用|分开,打出这个需要按住shift后按反斜杠\,比如(260|296|297) 就是苹果,小麦和面包,当然先要设置use-material-names: false | 当你在使用PEX插件时,你可以在文件里一行指定多个物品,用|分开,打出这个需要按住shift后按反斜杠\,比如(260|296|297) 就是苹果,小麦和面包,当然先要设置use-material-names: false | ||
=== | ===重要提醒=== | ||
Thanks to Bukkit user @Tahg we were notified about one issue with the modifyworld.blocks.place.* node: If you remove modifyworld.* from a group, for the group to place blocks, you will need to specify what blocks the group is allowed to place other blocks on using the modifyworld.blocks.interact.* (alternately you can use a wildcard for the block ID with modifyworld.blocks.interact.*) in addition to the modifyworld.blocks.place.* for the blocks the group is allowed to place. This is because Bukkit checks first for onPlayerInteract() then for onBlockPlace(). | Thanks to Bukkit user @Tahg we were notified about one issue with the modifyworld.blocks.place.* node: If you remove modifyworld.* from a group, for the group to place blocks, you will need to specify what blocks the group is allowed to place other blocks on using the modifyworld.blocks.interact.* (alternately you can use a wildcard for the block ID with modifyworld.blocks.interact.*) in addition to the modifyworld.blocks.place.* for the blocks the group is allowed to place. This is because Bukkit checks first for onPlayerInteract() then for onBlockPlace(). | ||
For example, when trying to place a sand block on a grass block, the permission node checks are modifyworld.blocks.interact.grass then modifyworld.blocks.place.sand. Consider the block being targeted with this action - the interact permission is required for the block that is targeted with right-click, and thus could be to the side or above the placed block. | For example, when trying to place a sand block on a grass block, the permission node checks are modifyworld.blocks.interact.grass then modifyworld.blocks.place.sand. Consider the block being targeted with this action - the interact permission is required for the block that is targeted with right-click, and thus could be to the side or above the placed block. | ||
Metadata can appear on a lot of blocks and items that you might not expect, please make sure you read the section on Metadata and check the debug output before posting in the forums! | Metadata can appear on a lot of blocks and items that you might not expect, please make sure you read the section on Metadata and check the debug output before posting in the forums! | ||
===配置文件=== | ===配置文件=== | ||
2015年8月11日 (二) 10:22的版本
- 点击此处开始翻译。
- 如本模板出现在原文存档页面,请注意更新主页面后,仍需要去除此处该模板。
- 如当前页面已经没有需要翻译的内容,请删去待翻译模板。
- 有标题的大篇幅文章,如果短时间内无法全部翻译,请先把所有的标题翻译出来,以便之后的贡献者选择与翻译章节内容。
外文名 | PermissonEX(PEX) |
插件类型 | Spigot / CraftBukkit |
最新版本 | v1.23.1 |
兼容服务端 | 1.8.1 |
前置插件 | 无 |
源地址 | http://dev.bukkit.org/bukkit-plugins/PermissionsEX |
概述
介绍
PermissionsEx (PEX) 是一个新的权限(组), 基于权限组和它的所有功能. 但是PEX插件能做到更多! 它提供了各式各样有力的后台和游戏内管理方式, 很好的限制了一些玩家对于服务器的修改.
现有特性
版本V1.21开始支持UUID 不同的存储方式。目前的存储方式有:文本存储(YAML),数据库存储(MySQL,SQLite)。当然,也支持你自己添加! YAML存储方式,对于新手,最容易配置的方式,所有玩家的信息都存储在 permission.yml 文件里面,缺点:后期读取可能出现卡顿。 SQL存储方式,对于有一定基础的人,推荐此方式,目前支持MySQL和SQLite,其他的数据库(如Postgre)也是可以的。PEX会自动创建数据库的表单。这就说明了,你只需要设置好PEX如何连接到数据库,剩余的你就只需要看着PEX自己完成了。 简明的构架和API接口,如果你对编程有一定了解,那么你可以改变很多。 全面的指令,你可以在游戏里/控制台,做到你想做的任何事情。指令列表看下文。 多世界 - 你可以设置一个玩家在某个世界的单独权限,比如在世界A不能破坏,在世界B不能拾取等等。(设置个别方块等权限,见下文) 权限组的继承,用户可以继承组的权限,组也可以继承组的权限,并且可以选择继承他们的权限、前缀、后缀。 权限的表达方式,这说明,如果你习惯于GroupManager,你也不用担心更换权限插件之后的不习惯。例子: - essentials.fly 这个权限就是允许玩家使用/fly指令 多世界权限继承,你可以继承不同世界的权限。也可以在不同世界继承不同的权限。 良好的优化,当你拥有大量用户的时候,你会发现没有延迟! 排行榜,你可以设置权限组的排列顺序 计时权限!你可以使用指令给玩家添加一个时限权限!注意:当服务端重启,或者崩溃将会失效。 V1.21.1版本开始 PEX支持自动更新,不过并不是跨阶段的更新,只支持BUG修复等更新,防止出现大更新,没有备份而导致文件丢失(V1.21.1→V1.21.2 而不是 V1.21.1 →V1.22.1),当然你也可以在config.yml文件中关闭更新。 Bukkit权限的兼容 禁用错误报告,在插件文件夹目录下创建一个文件,名为'report-disable'。
进阶权限管理
权限的继承
很多服务器配置了多个权限组, 添加权限要各组分别添加. 权限继承可以服务器管理最大限度的减少每一组重复的节点数量.
这里假定您已经完成了基本教程,如还没有,请看基础权限知识,不然的话不能保证您能明白这里的每一步.
实际上,使用了基本教程中的案例,你会发现Member, VIP 和Moderator组都有共同的节点 , modifyworld.* .这里不需要使用继承.
权限继承规则
当继承需要处理,PEX会遵循下列规则:
对玩家的设置(前缀,后缀,权限节点,etc.)拥有比组更高的优先权. 设置给一个组的玩家权限在当玩家个人设置生效前被组中任意玩家继承. Permission nodes are evaluated in order of the inheritance tree (see The Inheritance Tree for details) A group set to inherit from another group will inherit everything (this includes other inheritance directives!) from the source group, not just permissions. For example, if you have group B inheriting from group A, and group A is set to inherit from group B, PEX will follow the inheritance chain on group A, which is set to inherit from B, which inherits from A, and so on. Watch for this, it will cause a loop that will crash PEX.
对现有的权限组使用继承功能
用现有的组使用继承功能的话 设置PEX默认组的命令会很容易.
用Moderator权限组继承VIP权限组的例子
pex group VIP parents set Member (这个命令是VIP组组继承了Moderator组的所有权限) pex group Moderator parents set VIP (这个命令是Moderator组继承了VIP组的所有权限) 删除多余的权限节点
pex group VIP remove modifyworld.* pex group Moderator remove modifyworld.*
现在,VIP组和Moderator组仍然具有相同的权限,VIP组得到 modifyworld.* 权限节点 VIP组成员获得了 -modifyworld.mobtarget.monster.creeper 的权限节点,和Moderator组继承来自VIP组的节点(包括从它的组成员继承的节点)同时获得了modifyworld。mobtarget节点。
权限文件的相关部分现在看起来应该像这样:
Member: prefix: '&0(&8M&7ember&0)&7 ' permissions: - modifyworld.* options: rank: '900' VIP: prefix: '&0(&eVIP&0)&7 ' inheritance: - Member permissions: - -modifyworld.mobtarget.monster.creeper options: rank: '800' Moderator: prefix: '&0(&1Moderator&0)&7 ' inheritance: - VIP permissions: - -modifyworld.mobtarget.* options: rank: '100'
这个例子不能大幅度的减少文件大小, 但是如果一个服务器有几个权限组 十几个权限组或者更多的权限节点与权限组的话,权限文件大小是可以被大幅度的压缩的.
这种继承也可以应用于服务器的一个世界或多个世界。想知道更多的话 可以去看 multiworld 继承部分哦.
继承树
(Thanks goes to aviator14 for use of these nodes)
Due to the way PEX deals with file backends, it may help to view inheritance as a tree. For example, we have the following permission nodes:
Guest: prefix: '&7' default: true permissions: [] Player: prefix: '&f' default: false permissions: - generic.user.permissions - -multiverse.access.world_creative - -multiverse.portal.access.end - multiverse.access.* - multiverse.core.coord - multiverse.core.info - multiverse.core.list.who - multiverse.portal.access.* inheritance: - Guest Donator: prefix: '&5' permissions: - generic.donor.permissions - multiverse.access.world_creative inheritance: - Player Supporter: prefix: '&6' permissions: - more.generic.donor.permissons - multiverse.portal.access.end inheritance: - Donator Moderator: prefix: '&d' permissions: - generic.moderator.permissions inheritance: - Player ModD: prefix: '&d' permissions: [] inheritance: - Moderator - Donator ModS: prefix: '&d' permissions: [] inheritance: - Moderator - Supporter
The original forum post these nodes came from was asking why the ModD group was not getting the multiverse.portal.access.end node it was inheriting from the Donator group. Well, the reason for this is because of the way PEX evaluates nodes in a file backend and the inheritance tree.
An abbreviated version of the tree for the ModD group is this:
ModD permissions (none) Moderator (generic.moderator.permissions) which inherits from Player Player (which has -multiverse.access.world_creative among others) and inherits from Guest Guest (no permissions) Donator (generic.donor.permissions, multiverse portal access node) which inherits from Player Player (which has -multiverse.access.world_creative among others) and inherits from Guest Guest (no permissions) In this case, the issue was due to the Moderator tree being evaluated first, which finds the negation node for multiverse and stops looking. If the Donator tree was listed first (which was the suggested fix), PEX would follow that inheritance tree first, which has the multiverse permissions, and allow access to that node.
Regular Expressions (regex)
Regular Expressions, also known as regex or regexp, is a way to 'match' strings of text, such as particular characters, words, or patterns of characters. PEX supports a subset of regex in it's permission node checks.
PEX supports open and closed parentheses ( ) for grouping, curly braces { } for pattern matching, a pipe | for "or", and a dash - for through (as in numbers 1 through 5).
WARNING: If you have any nodes that use these characters then you MUST either put the line in quotes or escape with a backslash the character. If you do not, PEX may mistake the character as an attempt to use a regex, causing a Java error and rendering your permissions useless!
To use it, place the conditions/keywords and/or id numbers in a group, separated by a pipe or a dash if wanting to cover multiple numbers in a sequence.
If this is confusing, worry not. There is a reason why several technical book publishers sell books dedicated to regular expressions. Fortunately, for the purposes of PEX and permission nodes, it's much simpler to deal with, especially with examples of it in action.
Assume that you have a group that you don't want opening the following:
Dispensers ('dispenser', or 23) Chests ('chest', or 54) Furnaces ('furnace', or 61 unlit and 'burning_furnance', or 62 lit) Jukeboxes ('jukebox', or 84) Remember to check your use-material-names node setting.
You could have a set of nodes like this:
- -modifyworld.blocks.interact.dispenser - -modifyworld.blocks.interact.chest - -modifyworld.blocks.interact.furnace - -modifyworld.blocks.interact.burning_furnace - -modifyworld.blocks.interact.jukebox
However, this is unnecessary. Using the regex support in PEX, you can combine the nodes into a single line: - -modifyworld.blocks.interact.(dispenser|chest|burning_furnace|furnace|jukebox) - -modifyworld.blocks.interact.(23|54|61|62|84) (for use-material-names: false)
If you wanted to keep a group from destroying stone (1), grass (2), dirt (3), and cobblestone (4), you can use modifyworld.blocks.destroy.(1-4)
You can also use 'or' on other parts of the node.
Keeping with the previous example, adding the ability to place the blocks looks like modifyworld.blocks.(destroy|place).(1-4) Adding sand (12) to this example, you could use modifyworld.blocks.(destroy|place).(1-4|12)
Adding this to a group, such as the default group, is as simple as using the pex group <group> add <node> command.
pex group default add modifyworld.blocks.(destroy|place).(1-4|12) Any extra nodes can be removed with the pex group <group> remove <node> command. See Commands for more on the add/remove commands.
For advanced users, users can place a $ character directly in front of the node (after any other flag characters) to prevent PEX from performing regex escaping of . and *, so that they behave as normal regex characters rather than their function as delimiters in permissions nodes (escaped by default for backwards compatibility and user sanity)
As you can see, the ability to use regex in permissions can save a lot of typing.
File Back-end Example
In the interest of completeness, this is the full permissions file after the inheritance and regex commands listed above. This example assume use-material-names: false in your plugins/Modifyworld/config.yml file.
groups:
default: default: true options: rank: '1000' permissions: - modifyworld.chat - modifyworld.blocks.(destroy|place).(1-4|12) Member: prefix: '&0(&8M&7ember&0)&7 ' permissions: - modifyworld.* options: rank: '900' VIP: prefix: '&0(&eVIP&0)&7 ' inheritance: - Member permissions: - -modifyworld.mobtarget.monster.creeper options: rank: '800' Moderator: prefix: '&0(&1Moderator&0)&7 ' inheritance: - VIP permissions: - -modifyworld.mobtarget.* options: rank: '100' Admins: prefix: '&0(&4Admins&0)&7 ' permissions: - -modifyworld.mobtarget.* - modifyworld.* - permissions.* options: rank: '1'
users:
AnotherPlayer: group: - default YourPlayerName: group: - Admins
===Multiworld===Multiworld
Having several maps (or worlds) on a server is a common way to offer more than one game play experience. However, not all commands are suitable for all worlds. You wouldn't want a hardcore survival world to have access to the give command, but it may be perfectly fine, if not required, in a world intended for free building. Fortunately, limiting a permission node to a specific world is easy with PEX by specifying the world when adding the permission node.
Assume the following server setup:
A survival world with Nether and End worlds (named survival, survival_nether, and survival_the_end respectively) A free build world (named freebuild) A group (pvp) that has the ability to build in the survival world only (modifyworld.*) A group (build) that has the ability to build in the survival and free build world (modifyworld.*)
See Modifyworld page for details on block placement permission nodes.
The commands to set this up are:
/pex group pvp add modifyworld.* survival (add build permissions to the survival world for the pvp group) /pex group build add modifyworld.* freebuild (add build permissions to the freebuild world for the build group) /pex group build parents set pvp (Set the build group to inherit the permission to build in the survival world)
Keep in mind that if you edit/add the multiworld lines into the permissions file by hand, make sure the name you use matches the one used in the bukkit configs and what is on the server, capitalization matters here!
The resulting permissions will look like this in the file back-end:
groups:
pvp: permissions: worlds: survival: permissions: - modifyworld.* build: inheritance: - pvp permissions: worlds: freebuild: permissions: - modifyworld.*
多世界继承
你也许看到了这一步的缺陷, 这两个权限组都被允许在地狱与末地使用. 可以用这两种方法对其纠正:
为每个世界单独添加modifyworld.*权限 用以下指令来/pex world <world> inherit <parentWorlds> /pex world pvp_nether inherit pvp /pex world pvp_the_end inherit pvp进行世界权限继承 这些指令执行后后台的配置文件应该会像这样:
worlds:
pvp_nether: inheritance: - pvp pvp_the_end: inheritance: - pvp
Backends
原帖是这么说的 PermissionsEx provides several backends to store permissions data. This page (will explain) explains them all. (PEX插件提供了一些用于保存权限数据的后台,这个页面会解释所有) 但其实这个页面只有这一句话(或许是服务器问题) 所以请等待更新。
基础的权限设定
权限节点的基本添加和否定
PEX插件有一个普遍原则,就是权限运行命令是不允许的,除非这个权限节点是具体列出的. 对于那些可以被默认(default)操作的事件和命令, PEX插件可以拒绝访问那些被否定的节点.
使用一个可以拒绝访问节点就像用 pex group <group> add <node>(最基本的权限给予命令) 命令那样简单. 使用同样的命令,只在权限节点前加一个负号(-)即可.
举个例子 /give 和 /plugins 命令是水桶客户端的一部分(基本命令)
/give 命令有一个权限节点 command.give 这个命令一般限制在ops.txt列出的人使用(管理员命令) /plugins 命令也有个权限节点 command.plugins 它可以被服务器中任何人使用。
我们可以试试对于某个权限组增加和否定这两个节点:
如果允许某个权限组使用/give, 就可以输入命令 pex group 组别名 add bukkit.command.give 不允许某个权限组使用 /plugins, 这时候的命令就为 pex group 组别名 add -bukkit.command.plugins
重要的关于*的信息
PEX插件允许使用XXX*来给予XXX下的所有的分权限节点,但是呢,在使用这个前,你必须要明白它怎么工作以及会造成什么效果。一开始浏览的时候,这看上去很简单,给一个权限组“*”使它可以访问所有的权限节点,但是这也可能会导致你给了你不想要给这个权限组的权限。例如,在插件VanishNoPacket(简称VNP)中,它提供了一个权限vanish.silentjoin,使得所有的用户在登入时都不会显示加入公告,这是大多数服务器主人都不想要的效果。实际上这也可以用否定节点来简单解决(否定节点优先),任何给默认组使用的权限节点都能被否定以“关闭功能”
重要的后台文件
如果你要在后台修改编辑权限的话,请阅读并遵守以下规则: 权限必须以一个空格或者负号开始 - modifyworld.chat 和 - -modifyworld.mobtarget.*是在后台文件中有效的(格式正确)。 modifyworld.chat 和 -modifyworld.mobtarget.* 在后台文件中无效(格式不正确,无空格或负号)。 所有在YAML文件中的格式规则在PEX插件基本文件中必须被遵守,错误的文件会使得PEX插件无法启动,然后把log文件塞满错误信息。 PEX插件用自上而下的方式来检查用户和组别的权限节点,就像网络防火墙一样,如果它找到了一个与它想找的匹配的节点,它就会停止寻找,这就意味着在现实中,如果一个权限给了主要组别和它所有的子组别,它在看到允许的权限后就会停止寻找而忽略否定节点。 我们举个错误的例子
default:
options: default: true permissions: - modifyworld.* - -modifyworld.blocks.interact.23
用这样的权限节点文件,如果一个玩家想要打开一个发射器(ID 23),它第一个会匹配到modifyworld.*节点然后停止,以至于允许玩家打开!(实际上第二个权限节点是不允许这样的事情发生的。
不过,如果把这两行互换,-modifyworld.blocks.interact.23在modifyworld.*之前,玩家会被拒绝访问发射器(插件先检测到-modifyworld.blocks.interact.23节点)如果一个玩家想要打开一个熔炉(ID 61)插件就会检测到modifyworld.*节点,然后认为是modifyworld.blocks.interact.61节点,使得玩家可以打开。
上机操作
先来试试基本的权限指令和插件基本功能(以下作为教程实例并且推荐各服务器使用。) 创建五个组别个组别:Default,Member,VIP,Mod,Admin。
"Default" 可以聊天但是不可以改动任何东西,没有称号 "Member"信任的玩家组别,可以改动世界,拥有称号 ("&0(&8M&7ember&0)&7 ") "VIP" 可以改动世界还可以不受到苦力怕的烦恼(这个VIP棒)! 并且拥有称号"&0(&eVIP&0)&7 ". A "Mod" 可以不受到任何怪物的困扰(万岁!). An "Admin" (管理员) 是超级用户,可以使用这个插件的所有功能并且拥有炫酷的称号比如 "&0(&4Admin&0)&7 ".
可选: 去除 modifyworld.* 权限从 "Default" 权限组中 可选: 添加 modifyworld.chat 权限到 "Default" 权限组里 是时候测试环境了
准备
安装PEX插件(放在插件目录下)
开启服务器.
打开浏览器控制台(租借,后台服务器的话)
在浏览器中打开PEX插件的配置文件
开始基础及基本权限
这些命令必须在控制台输入
创建一个Admin权限组(pex group admin create命令)
把 permissions.* 权限加入到组别中(pex group Admin add pressions.*命令) 把你自己加入组中 (pex user 你的游戏名 group set Admin), 其中你的游戏名是你在游戏内的ID名. 可选的:给自己所有权限不管自己是不是在拥有permissions.*权限的权限组里
如果你不想(不能)在控制台输入
创建一个permissions.yml文件输入以下文字,并上传(放置)到PEX插件的目录,请确保你的格式是正确的!看上面的YAML后台信息的帮助。
groups: Default: options: default: true permissions:
modifyworld.* Admin: options: prefix: '&0(&4Admin&0)&7 ' permissions: permissions.* users:你的用户名: group: Admin permissions: permissions.*
是时候创建其他组别了
创建其他组别: Member, VIP, Mod
使用这个命令创建Member组 /pex group Member create 使用这个命令创建VIP组 /pex group VIP create 使用这个命令创建Mod组 /pex group Mod create
接下来我们要标注这几个组别的阶级使得符合这样的顺序 Member -> VIP -> Mod -> Admin.看阶级页面以知道更多
设置阶级
输入以下命令
/pex group default set rank 1000 /pex group Member set rank 900 /pex group VIP set rank 800 /pex group Mod set rank 100 /pex group Admin set rank 1
阶级100是最高提升的阶级数。
升级和降级命令都会在游戏内收到限制 (但在控制台不会). 在游戏中,你不可以:
把一个低于你阶级的升到你的阶级 (Mod到Admin, 用前面的例子) 把一个阶级高于你的降到低于你的阶级(Admin到Mod,用前面的例子) 不能对于你同样阶级的升降级 (Mob不能对Mob操作,Admin不能对Admin操作。) 如果你在游戏内(只是举个例子)是Admin,想要把一个玩家提高到你一样的阶级必须使用/pex user PlayerName group set Admin.
在控制台,你很自由可以不受以上限制。
炫酷的滑板鞋!(好吧只是称号吗)
使用以下命令
/pex group Member prefix "&0(&8M&7ember&0)&7 " /pex group VIP prefix "&0(&eVIP&0)&7 " /pex group Mod prefix "&0(&1Mod&0)&7 " /pex group Admin prefix "&0(&4Admin&0)&7 "
确保在每个称号后面都加上了个空格,这可以阻止称号和用户名混在一起在聊天中。实际上,后缀前也是因为同样的理由加一个空格为好。还有一种可以显示前缀后缀的方法就是前缀后缀相同(只需把prefix变成suffix就行)。
给每个组别添加权限
注意: 如果你还没有允许这些组别修改世界,那么删除modifiyworld.*这一步是不需要的.
可选的: /pex group default remove modifyworld.* 可选的: /pex group default add modifyworld.chat (Only needed if modifyworld.* has been removed)
/pex group Member add modifyworld.* /pex group VIP add modifyworld.* /pex group VIP add -modifyworld.mobtarget.monster.creeper /pex group Mod add modifyworld.* /pex group Mod add -modifyworld.mobtarget.* /pex group Admin add permissions.* /pex group Admin add modifyworld.* /pex group Admin add -modifyworld.mobtarget.*
来看看成果吧!
见证奇迹!
你想要改变你的权限组的话,使用这个命令 /pex user 玩家名 group set 权限组名,接下来就测试啦!
Default
验证你可以聊天 验证你有正确的前缀在聊天时 验证你可以在出生点外破坏方块 注意: 如果你把modifyworld.* 节点之前移除了,就不能破坏(之前是可选项) 如果你可以破坏但是modifyworld.* 节点被移除了!, 找到个爬行者然后拥抱它! (别担心,它保证对你没兴趣但是你伤得了它)
Member
验证你可以聊天 验证你有正确的前缀在聊天时 验证你可以在出生点外破坏方块
VIP
验证你可以聊天 验证你有正确的前缀在聊天时 验证你可以在出生点外破坏方块 如果你可以破坏但是modifyworld.* 节点被移除了!, 找到个爬行者然后拥抱它! (别担心,它保证对你没兴趣但是你伤得了它)
Admin
验证你可以聊天 验证你有正确的前缀在聊天时 验证你可以在出生点外破坏方块 (如果你把玩家名字放在了OP文件中,并且在PEX插件配置config文档里把allowOps设置为了true,你将可以在出生点附近破坏). 验证你可以使用PEX插件所有命令(使用/pex reload命令测试,它应该会回复 "Permissions Reloaded(权限重新加载)") 验证所有怪物都对你没兴趣 下一步你可以换一个玩家作为“实验对象”比如加入游戏的好基友(这是为了科学!!)
测试阶级
首先使用/pex user 另一个玩家 group set default 验证升降级别命令有效 使用/pex promote 前面你移动的那个玩家. 你会看见 "User AnotherPlayer promoted to NextGroup(这个玩家到了下个组别)"
一直使用这个命令直到出现 "Promotion error: User is not promotable(升级错误,用户不允许)". 使用 /pex user 这个玩家 命令会显示:
playername are member of: Mod (rank 100 @ default) playername's permissions: -modifyworld.mobtarget.* (from Mod) modifyworld.* (from Mod) playername's options: 降级和升级一样,只不过把命令中的promote变成demote
如果那个玩家只是个机器人, 如果你想的话,使用这个命令把它删掉 /pex user 玩家名 delete 如果那个玩家是真人,确保每个组别都正常工作(看上机教程最前面。)
后台文件案例
如果你成功了上面那个案例,你就会发现后台文件变成了这样。很具有参考性:
groups: default: options: rank: '1000' default: true permissions: - modifyworld.chat Member: permissions: - modifyworld.* options: rank: '900' prefix: '&0(&8M&7ember&0)&7 ' VIP: permissions: - -modifyworld.mobtarget.monster.creeper - modifyworld.* options: rank: '800' prefix: '&0(&eVIP&0)&7 ' Mod: permissions: - -modifyworld.mobtarget.* - modifyworld.* options: rank: '100' prefix: '&0(&1Mod&0)&7 ' Admin: permissions: - -modifyworld.mobtarget.* - modifyworld.* - permissions.* options: rank: '1' prefix: '&0(&4Admin&0)&7 ' users: AnotherPlayer: group: - default YourPlayerName: group: - Admin
这就是被解析后的文件的样子,但是最好使用YAML编写工具来确保你的文件已经正确,不然插件可能会出所有类别的错误!
{
"users": { "AnotherPlayer": { "group": [ "default" ] }, "YourPlayerName": { "group": [ "Admin" ] } }, "groups": { "default": { "options": { "default": true, "rank": "1000" }, "permissions": [ "modifyworld.chat" ] }, "Member": { "options": { "prefix": "&0(&8M&7ember&0)&7 ", "rank": "900" }, "permissions": [ "modifyworld.*" ] }, "VIP": { "options": { "prefix": "&0(&eVIP&0)&7 ", "rank": "800" }, "permissions": [ "-modifyworld.mobtarget.monster.creeper", "modifyworld.*" ] }, "Mod": { "options": { "prefix": "&0(&1Mod&0)&7 ", "rank": "100" }, "permissions": [ "-modifyworld.mobtarget.*", "modifyworld.*" ] }, "Admin": { "options": { "prefix": "&0(&4Admin&0)&7 ", "rank": "1" }, "permissions": [ "-modifyworld.mobtarget.*", "modifyworld.*", "permissions.*" ] } }
}
Chat Manager
命令
实用指令
注意,在以下命令里 user=玩家名字,world=世界名字 permission=权限 node=节点 backend=后台文件 group=权限组别
/pex 显示帮助
permissions.manage
/pex toggle debug 调试开关(不要总开着!,要不然会出很多信息文件)
permissions.debug
/pex user <user> toggle debug 给指定的一个人测试调整(上面一样)
permissions.manage.<user>
/pex user <user> check <permission> 检查一个具体的玩家的具体的权限
permissions.manage.<user>
/pex reload 重新载入所有pex文件
permissions.manage.reload
/pex config <node> [value] 看节点的值(写上后面的更改值)
permissions.manage.config
/pex backend 看现在的后台文件(也就是正在用的文件)
permissions.manage.backend
/pex hierarchy 看现在服务器结构(阶级)
permissions.manage.users
/pex dump <backend> <filename> 把你的后台文件倒到另外一个文件里 谨慎使用!不会立刻保存,但会在游戏中有效果
permissions.manage.dump
/pex users cleanup <group> [threshold] 清走“死亡”的会员(默认30天不活动)
permissions.manage.users.cleanup
世界管理
/pex worlds 看PEX里面的世界
permissions.manage.worlds
/pex world <world> 看这个世界的层次信息
permissions.manage.worlds
/pex world <world> inherit <parentWorlds> 让你选择的世界继承一个世界(继承permission,etc.)
permissions.manage.worlds.inheritance 玩家指令:
/pex users list 看所有在PEX里面的玩家
permissions.manage.users
/pex users 一样一样 /pex user 一样一样 = =
玩家permission管理:
/pex user 一样.....······
permissions.manage.users
/pex user <user> 看玩家的权限
permissions.manage.users.permissions.<user>
/pex user <user> prefix [newprefix] 设置玩家前缀颜色
permissions.manage.users.prefix.<user>
/pex user <user> suffix [newsuffix] 设置玩家后缀颜色
permissions.manage.users.suffix.<user>
/pex user <user> delete 把玩家从权限文件里面移除
permissions.manage.users.<user>
/pex user <user> list [world] 看玩家的权限
permissions.manage.users.permissions.<user>
/pex user <user> add <permission> [world] 给玩家增加权限
permissions.manage.users.permissions.<user>
/pex user <user> remove <permission> [world] 给玩家移除权限
permissions.manage.users.permissions.<user>
/pex user <user> timed add <permission> <lifetime in seconds> [world] 给玩家在时间内(秒)添加权限
permissions.manage.users.permissions.timed.<user>
/pex user <user> timed remove <permission> <lifetime in seconds> [world]给玩家在时间内(秒)移除权限
permissions.manage.users.permissions.timed.<user>
/pex user <user> set <option> <value> [world] 给玩家设选择值(不怎么懂表示,望进一步翻译和解释)
permissions.manage.users.permissions.<user>
玩家组管理
/pex user <user> group list 给出玩家所有现在在的组
permissions.manage.membership.<user>
/pex user <user> group add <group> [world] [lifetime]把玩家加入组(时间,秒,不设默认永久)
permissions.manage.membership.<group>
/pex user <user> group set <group> [world] 把玩家放进组,注意这将会把玩家从另一个组移除
permissions.manage.membership.<group>
/pex user <user> group remove <group> [world] 把玩家从组移除
permissions.manage.membership.<group>
默认组管理
/pex default group [world] 看默认的管理组情况
permissions.manage.groups.inheritance
/pex set default group <group> [world] 把权限组组设成默认
permissions.manage.groups.inheritance
组的指令
/pex group 显示所有创建了的组
permissions.manage.groups.list
/pex groups ↑(同上)
permissions.manage.groups.list
/pex groups list ↑
permissions.manage.groups.list
/pex group <group> prefix [newprefix] 设置组前缀
permissions.manage.groups.prefix.<group> /pex group <group> suffix [newsuffix] 设置组后缀 permissions.manage.groups.suffix.<group>
/pex group <group> create [parents] 创建组,parents(母权限组)是说他是从哪里升级得来的(继承权限)
permissions.manage.groups.create.<group>
/pex group <group> delete 删除权限组
permissions.manage.groups.remove.<group>
/pex group <group> parents list 看权限组的继承表
permissions.manage.groups.inheritance.<group>
/pex group <group> parents set <parents> 设置权限组组的母权限组
permissions.manage.groups.inheritance.<group>
/pex group <group> 显示所有组的权限
permissions.manage.groups.permissions.<group>
/pex group <group> list [world] 组的所有权限,加上世界名称可以看单个世界的权限
permissions.manage.groups.permissions.<group>
/pex group <group> add <permission> [world] 给小组加权限
permissions.manage.groups.permissions.<group>
/pex group <group> remove <permission> [world] 移除权限
permissions.manage.groups.permissions.<group>
/pex group <group> timed add <permission> [lifetime] [world] 给权限组限时加权限,不填默认永久
permissions.manage.groups.permissions.timed.<group>
/pex group <group> timed remove <permission> [world] 给权限组限时移除权限组,不填默认永久
permissions.manage.groups.permissions.timed.<group>
/pex group <group> set <option> <value> [world] 给组的人设置选则的值
permissions.manage.groups.permissions.<group>
组的玩家的管理
/pex group <group> users 所有在组里的玩家
permissions.manage.membership.<group>
/pex group <group> user add <user> 把玩家弄进小组
permissions.manage.membership.<group>
/pex group <group> user remove <user> 把玩家从组里移除
permissions.manage.membership.<group>
/pex promote <user> <ladder> 不知道怎么翻译了Promote <玩家名> on <ladder>. If <ladder> is not specified, the default ladder (named default) will be used.
permissions.user.promote.<ladder>
/pex demote <user> <ladder> 大题同上
permissions.user.demote.<ladder>
FAQ
Features
Integrating with PEX
Migration
Migration and UUIDs
Modifyworld(中译世界修改)
需要注意的地方
这些需要你已经安装了一个权限插件,其中需要先设置默认组只能聊天。
默认情况下,玩家不会受限制,但是服务器通常需要通过自定义取消用户的权限节点来限制玩家的行为,你可以把modifyworld.*这个权限否定,这样玩家就什么都干不了了
除了以上,默认时,这些关于世界修改的权限是使用方块名字来替代物品ID,如果你想使用ID,设置或增加config文件中的use-material-names: false即可
否定一个节点(在前面加负号"-",或者把它的值设为false)来否定玩家或者组别的一些功能。而通配符*是指父(即*前)权限节点下的所有子权限节点。
当你在使用PEX插件时,你可以在文件里一行指定多个物品,用|分开,打出这个需要按住shift后按反斜杠\,比如(260|296|297) 就是苹果,小麦和面包,当然先要设置use-material-names: false
重要提醒
Thanks to Bukkit user @Tahg we were notified about one issue with the modifyworld.blocks.place.* node: If you remove modifyworld.* from a group, for the group to place blocks, you will need to specify what blocks the group is allowed to place other blocks on using the modifyworld.blocks.interact.* (alternately you can use a wildcard for the block ID with modifyworld.blocks.interact.*) in addition to the modifyworld.blocks.place.* for the blocks the group is allowed to place. This is because Bukkit checks first for onPlayerInteract() then for onBlockPlace(). For example, when trying to place a sand block on a grass block, the permission node checks are modifyworld.blocks.interact.grass then modifyworld.blocks.place.sand. Consider the block being targeted with this action - the interact permission is required for the block that is targeted with right-click, and thus could be to the side or above the placed block. Metadata can appear on a lot of blocks and items that you might not expect, please make sure you read the section on Metadata and check the debug output before posting in the forums!
配置文件
Modifyworld 的配置文件储存在 plugins/Modifyworld/config.yml
下面是 ModifyWorld 的配置文件:
informPlayers: true itemRestrictions: true whitelist: false messages: prohibitedItem: 你拥有违禁物品 "%s". whitelist: 你没有白名单加入这个服务器.拜拜! permissionDenied: 对不起,你没有足够的权限! use-material-names: true drop-restricted-item: false item-use-check: false
Configuration Properties
由于搬运,格式有些耽误此处格式为:
权限/实体...名 (默认是否开启,false为不开启,或者该项的值) 简介
informPlayers false 是否通知玩家该玩家的权限变化 itemRestrictions false Enable/disable item restrictions. If this is enabled, items not configured to be allowed will be removed from the player's inventory if it's found. messages.prohibitedItem 你禁止某项物品后,会发送信息给拥有被禁止的物品者 messages.whitelist You are not allowed to join this server. Goodbye! 给不在白名单内玩家的信息 messages.permissionDenied Sorry, you don't have enough permissions 给尝试做没有权限的事情的玩家的信息 whitelist false 是否开启白名单 drop-restricted-item false 设置为true后玩家丢出物品时是“吐出”然而设置为false后玩家丢物品,物品会直接不见! use-material-names true true时,检查节点时会使用物品名字来代替ID check-metadata (版本 1.19.1后无) false If true, modifyworld will use the meta-data for blocks and items in the permissions checks. This means that your nodes may need a :* or .* added to the end of them! item-use-check false 设置为true后,可以设置modifyworld.item.use.<物品id>.on.block.<方块id> 的节点,即检查物品使用的对象,基本取代了modifyworld.interact.<实体名称>
Metadata Notes
Starting with release 1.19.1, metadata handling has been changed a bit.
There is no longer a need to specifically turn on metadata handling for modifyworld. However, a lot of blocks and items have metadata that one might not expect, or now has metadata due to changes in minecraft and bukkit.
A few examples are leaf blocks (each type has it's own value), planks (for the different colours), and sandstone (the different designs).
For item ID's that have metadata, using :* will cover all possible values for the metadata. For nodes that cover multiple items/blocks where some have metadata and others do not, the regex value of :?* will cover ID's that have metadata and ID's that do not.
Many blocks that you might not expect can have metadata, such as chests and doors that are freshly placed but have not been opened yet. When in doubt and you can't get a permission node, turning on debug will show what is being looked for. Please do this before posting in the forums, I can't stress this enough. Metadata is a very large stumbling block for many new users to PEX.
Generic Nodes
modifyworld.login 是否允许玩家加入游戏,你需要吧白名单开启来启动这个功能 modifyworld.chat 是否允许玩家能发布公告,聊天 modifyworld.sneak Player can crouch (check your Minecraft client config for the key) NOTE: Per https://github.com/PEXPlugins/PermissionsEx/issues/78, 这个节点在bukkit中因为缺少支持难以工作 modifyworld.sprint Player can sprint (double tap your forward key) NOTE: Per http://github.com/t3hk0d3/PermissionsEx/issues/78,也因为同样的原因难以工作。 modifyworld.chat.private 玩家是否能私聊 modifyworld.usebeds 玩家是否能使用床 modifyworld.bucket.empty.<fluid> 玩家是否能使用液体(清空桶) <fluid>指的是水或岩浆 modifyworld.bucket.fill.<fluid> 玩家是否能用桶装东西 <fluid> 指的是谁,岩浆或牛奶(早期版本里,air就是牛奶) modifyworld.digestion Allows players' energy bar to deplete. A popular application of this would be to do -modifyworld.digestion to disable energy consumption whilst still enabling modifyworld.*
Block Nodes
See Materials for <blockid> values.
modifyworld.blocks.destroy.<blockid> Player can break <blockid>. It's also possible to specify <blockid> by name. Example: modifyworld.blocks.destroy.stone modifyworld.blocks.place.<blockid> Player can place <blockid>. NOTICE: This permission requires modifyworld.blocks.interact.<blockid> to work properly. modifyworld.blocks.interact.<blockid> Player can interact with <blockid> (use levers, press buttons, etc.)
Item Nodes
See Materials for <itemid> values.
modifyworld.items.craft.<itemid> Player can craft <itemid>. modifyworld.items.drop.<itemid> Player can drop <itemid>. modifyworld.items.enchant.<itemid> Player can enchant <itemid>. modifyworld.items.have.<itemid> Player can have <itemid> in their inventory. itemRestrictions: true need to be set for this to work. modifyworld.items.hold.<itemid> Player can have <itemid> in their hand. itemRestrictions: true need to be set for this to work. modifyworld.items.pickup.<itemid> Player can pickup <itemid>. Also it's possible to specify <itemid> by name, example: 、modifyworld.items.pickup.diamondpickaxe modifyworld.item.use.<itemid>.on.block.<blockid> Player can use <itemid> on block <blockid>. item-use-check: true need to be set for this to work and is check in addition to the modifyworld.interact.<entityName> checks
As of 1.19.3
modifyworld.items.use.<itemid>.on.block.<blockid> Player can use <itemid> on block <blockid>. item-use-check: true need to be set for this to work and is check in addition to the modifyworld.interact.<entityName> checks modifyworld.items.throw.<itemid> Player may throw eggs, snowballs, splash potions or experience bottles. Potion metadata excludes splash flag: potion:34 will match a Splash Potion of Swiftness II.
As of 1.19.4
modifyworld.items.take.<itemid>.of.<container> Player may take items from containers, such as chests. modifyworld.items.put.<itemid>.of.<container> Player may take put items in containers, such as chests.
实体权限节点
modifyworld.damage.deal.<实体名称> Player can deal damage to <entityName> (e.g. skeleton, spider, creeper, cow, pig, minecart, etc) modifyworld.damage.take.<实体名称> Player can take damage from <entityName> modifyworld.mobtarget.<实体名称> Player can be targeted by <entityName> modifyworld.interact.<实体名称> Player can interact with <entityName> modifyworld.tame.<实体名称> Player can tame <entityName>. This permission won't give you ability to tame animals or mobs that are not normally tameable (no pet creepers). Currently, only animal.wolf and animal.ocelot are applicable.
Possible <entityName> values
Players and Wolves
player.<playerName> Player called <playerName>. (Example: player.t3hk0d3) group.<groupName> Any member of <groupName> group. (Example: group.admins) animal.wolf Wild wolf animal.wolf.<playerName> Wolf tamed by <playerName> (Example: wolf.t3hk0d3) animal.ocelot Wild ocelot (cat) animal.ocelot.<playerName> Tamed cat (ocelot) Example: animal.ocelot.t3hk0d3 npc.villager Not related to Bert snowman Not related Frosty irongolem Defenders of the Villagers
Animals
animal.chicken cluck-cluck animal.cow Mooo animal.mushroomcow Mooshroom animal.pig Pig animal.sheep Sheep animal.squid Squid
Monsters
monster.blaze Pyros, every one... monster.cavespider Worse than spiders monster.creeper SssssSSSssss monster.enderman Don't look at them directly monster.ghast AWWWWWWW monster.giant Giant Zombie monster.pigzombie Pig Zombie, omg monster.silverfish Beware the horde monster.skeleton Them bones, them dry bones... monster.slime Covers regular slimes and magma cubes monster.spider Yep, this is Spider, he is annoying. monster.zombie Brainzzzz...
Environment
starvation Num nums, or lack there of fire Initial fire damage lava Lava damage. Add firetick too for full protection. firetick Damage from touching fire (or after stepping into lava) over time. blockexplosion Damage from TNT explosion. projectile.arrow Arrows shot at player drowning Failing to grab a breath of fresh air fall Jumping without a parachute suicide Committing Seppuku poison Poison potions
坐骑权限
注意:如果你想有权限进入或跳下一个坐骑(矿车 马等),你还需要modifyworld.*权限。
modifyworld.vehicle.destroy.<坐骑名称> 玩家能破坏这个矿车 (坐骑名称要是英文) modifyworld.vehicle.enter.<坐骑名称> 玩家能够骑上一个坐骑(坐骑名称要是英文) modifyworld.vehicle.collide.<坐骑名称> 玩家能够跳下一个坐骑 (坐骑名称要是英文)
Possible <vehicleName> values
Boat boat Not related to the Love Boat Minecart minecart Indiana Jones rides in one of these
物品名称
如果 use-material-names 设置为 false 就使用物品 ID . 否则使用物品英文名称.
你可以找到更多的细节,包括数据值信息,在Minecraft wiki.
Pex basics
权限和服务器术语
服务器控制台 (又叫控制台); 就是当服务器启动时出现的黑色窗口.显示服务器和插件启动信息,以及服务器和插件错误.
全局权限: 就是在服务器上所有世界通用的权限.
世界特定权限: 只在某一个世界启用的特定权限.(如world世界允许飞行而别的世界不可以)
用户: 你服务器的玩家们.
权限组: 一个命名的许多权限权限在一起就叫权限组, 通常用于在服务器上指定各种权限级别 (如VIP1,VIP2)
权限组可以拥有全局和世界特定权限,以及其他插件使用的权限.
权限:表示一个命令、动作或能力是否允许。例如,/give 命令在Bukkit里具有bukkit.command.give节点.
否定权限: 标记为不可用的节点. 一般只在某些特定情况下使用.
继承:一个权限组能够自动使用另一个权限组的所有权限的能力。PEX支持组和世界继承。
数据值: (又叫附加值) 数据值是另一个值添加到一个物品ID号的值,如不同颜色的羊毛块,一个开关的位置,如果一扇门打开或关闭,等等。主要用于 modifyworld。
权限层次
PEX支持基于文件和SQL权限的权限等级: 。为了方便解释和可视化,下面的示例将使用一个基于文件的权限层次结构.
users: <- 玩家部分
t3hk0d3: <- 玩家名字 group: <- 玩家组部分 - default <- 玩家所在的组的名字 permissions: <- 玩家特定权限部分 - permissions.* <- 玩家所拥有的特定权限 worlds: <- 世界特定权限部分 world: <- 世界名称 permissions: <- 世界特定的权限组 - test.* <- 世界特定权限 group: <- 世界特定权限组部分 - testers <- 世界特定权限组 prefix: '&5[YARR]&f' <- 世界特定称号
groups: <- 权限组部分
default: <- 权限组名称 default: true <- 默认组部分 permissions: <- 权限组部分 - -modifyworld.blocks.interact.23 <- 否认权限节点 - modifyworld.* <- 权限节点 admins: inheritance: <- 该组继承的组 - default <- 从default继承 permissions: - example.permission - -punish.noobs options: <- 组选项部分 test.test: '100500' <- 额外数据 rank: '1' <- 阶级 worlds: nether: permissions: - nocheat.fly prefix: '&7[ADMIN FROM HELL]' testers: inheritance: - admins options: test.test: '9000'
worlds: <- 世界特定部分
nether: <- 世界名称 inheritance: <- 继承世界部分 - world <- 从world世界里继承
PEX文件格式(YAML) (YAML)
PEX,像许多别的插件一样, 使用的文件格式是 YAML (YAML Ain't Markup Language, 如果你想知道更多 猛点这个网址 http://yaml.org/). YAML, 不像其他的文件格式,有着非常挑剔的格式和字符使用。所以PEX的配置文件,包括权限的文件,必须缩进正确!Capitalization matters as well!
适用于PEX的YAML规则:
Certain characters are reserved for use by YAML. Some of the characters are ' - : # and %. If the data for an entry is going to use one of those characters, it must be in quotes. %prefix%player%suffix> &e%message is invalid. "%prefix%player%suffix> &e%message" is valid Any entries that are made of numbers only must be in quotes. rank: 1000 or 45625: is invalid. rank: '1000' or '45625': is valid. Tabs are not allowed to be in the file anywhere, unless it is in quotes. Any place where you would use a tab must use exactly two spaces. Each group must start at the very beginning of the line, and each section contained within that section must be indented. Due to the regex support in PEX, there are other characters that one has to be aware of. Characters such as } { ) ( ? and * must be quoted or escaped (a backslash works well). This isn't a YAML limitation, but is a similar situation to the reserved characters in YAML.