选区指令
基本信息
| 属性 | 值 |
|---|---|
| 来源类 | com.sk89q.worldedit.command.SelectionCommands |
| 文件 | src/main/java/com/sk89q/worldedit/command/SelectionCommands.java |
| 注册位置 | CommandManager.java:147(根节点直接注册) |
| 命令数 | 16 |
| 文件行数 | 846(wc -l) |
命令表
| 指令 | 别名 | 说明 | 权限节点 |
|---|---|---|---|
//pos1 |
— | Set position 1 | worldedit.selection.pos |
//pos2 |
— | Set position 2 | worldedit.selection.pos |
//hpos1 |
— | Set position 1 to targeted block | worldedit.selection.hpos |
//hpos2 |
— | Set position 2 to targeted block | worldedit.selection.hpos |
//chunk |
— | Set the selection to your current chunk. | worldedit.selection.chunk |
//wand |
— | Get the wand object | worldedit.wand |
toggleeditwand |
— | Toggle functionality of the edit wand | worldedit.wand.toggle |
//expand |
— | Expand the selection area | worldedit.selection.expand |
//contract |
— | Contract the selection area | worldedit.selection.contract |
//shift |
— | Shift the selection area | worldedit.selection.shift |
//outset |
— | Outset the selection area | worldedit.selection.outset |
//inset |
— | Inset the selection area | worldedit.selection.inset |
//size |
— | Get information about the selection | worldedit.selection.size |
//count |
— | Counts the number of a certain type of block | worldedit.analysis.count |
//distr |
— | Get the distribution of blocks in the selection | worldedit.analysis.distr |
//sel |
;、//desel、//deselect |
Choose a region selector | (无) |
别名与说明均由源码 @Command(aliases=..., desc=...) 注解逐条提取(SelectionCommands.java),权限来自其上的 @CommandPermissions 注解。
功能
-
//pos1///pos2无参时取玩家所在方块坐标;//pos1 [x,y,z]形式取绝对坐标 -
//hpos1///hpos2取玩家准星所指方块坐标 -
//chunk把选区设为当前所在区块 -
//wand发放法杖物品,物品 id 取自配置项wand-item,默认ItemID.WOOD_AXE = 271(LocalConfiguration.java:69) -
//expand用法<amount> [reverse-amount] <direction>(SelectionCommands.java:284-289)。首个参数为特殊关键字vert/vertical时,选区纵向撑满天空到基岩(按world.getMaxY() + 1双向扩展,SelectionCommands.java:295-325),而非数值 -
//contract用法<amount> [reverse-amount] [direction](SelectionCommands.java:403-409) -
//shift用法<amount> [direction],平移而非缩放(SelectionCommands.java:492-500) -
//outset///inset标志hv(SelectionCommands.java:546-551、569-574):默认三轴同时缩放;-h只水平(跳过 ±Y),-v只垂直(跳过 ±X/±Z),实现见getChangesForEachDir(SelectionCommands.java:588-605) -
//size报告选区三轴边长、总方块数 -
//count///distr统计选区内方块构成,不修改世界 -
//sel切换选区模式,源码SelectionCommands.java:774-823共接受 7 种模式(convex/hull/polyhedron三个名字共用同一实现):模式 选择器类 交互提示(源码原文) cuboidCuboidRegionSelector左键点 1,右键点 2 extendExtendingCuboidRegionSelector左键起点,右键延伸 polyPolygonal2DRegionSelector左/右键加点 ellipsoidEllipsoidRegionSelector左键中心,右键延伸 sphereSphereRegionSelector左键中心,右键设半径 cylCylinderRegionSelector左键中心,右键延伸 convex/hull/polyhedronConvexPolyhedralRegionSelector左键首顶点,右键加点 参数不匹配时打印可选模式列表后返回(
SelectionCommands.java:806-823)。追加-d标志可把该模式设为个人默认(SelectionCommands.java:825-840)。 -
poly与convex模式受顶点数上限约束:上限由ActorSelectorLimits.getPolygonVertexLimit()/getPolyhedronVertexLimit()(extension/platform/permission/ActorSelectorLimits.java:41、60)计算,读取配置default-max-polygon-points(默认 -1)、max-polygon-points(默认 20)及对应的 polyhedron 两项,取二者较小值;拥有OverridePermissions.NO_LIMITS时绕过(ActorSelectorLimits.java:44-49、63-68)
交互
选区状态保存在每个玩家自己的 LocalSession 中(WorldEdit.getInstance().getSessionManager().get(player),见 ForgeWorldEdit.java:312-317),因此 //pos1 只有设置者本人可见。