区域指令

基本信息

属性 值
来源类 com.sk89q.worldedit.command.RegionCommands
文件 src/main/java/com/sk89q/worldedit/command/RegionCommands.java
注册位置 CommandManager.java:145(根节点直接注册)
命令数 21(//set 另计,不在本类)
文件行数 580(wc -l)

命令表

指令 别名 说明 权限节点
//line — Draws a line segment between cuboid selection corners worldedit.region.line
//curve — Draws a spline through selected points worldedit.region.curve
//replace //re、//rep Replace all blocks in the selection with another worldedit.region.replace
//overlay — Set a block on top of blocks in the region worldedit.region.overlay
//center //middle Set the center block(s) worldedit.region.center
//naturalize — 3 layers of dirt on top then rock below worldedit.region.naturalize
//walls — Build the four sides of the selection worldedit.region.walls
//faces //outline Build the walls, ceiling, and floor of a selection worldedit.region.faces
//smooth — Smooth the elevation in the selection worldedit.region.smooth
//move — Move the contents of the selection worldedit.region.move
//stack — Repeat the contents of the selection worldedit.region.stack
//regen — Regenerates the contents of the selection worldedit.regen
//deform — Deforms a selected region with an expression worldedit.region.deform
//hollow — Hollows out the object contained in this selection worldedit.region.hollow
//forest — Make a forest within the region worldedit.region.forest
//flora — Make flora within the region worldedit.region.flora
//fixlighting — Fix lighting in a region or around you worldedit.light.fix
//getlighting — Get the emitted and sky light at your position worldedit.light.fix
//removelight //removelighting Remove lighting in a region or around you worldedit.light.remove
//setblocklight //setlight Set block lighting in a selection worldedit.light.set
//setskylight — Set sky lighting in a selection worldedit.light.set

//set(非 @Command 注册)

//set 是 WorldEdit 最核心的填充命令,但它不由 @Command 注解注册,而是在命令图中显式构造:

CommandManager.java:152-157
.register(adapt(
    new SelectionCommand(
        new ApplyCommand(new ReplaceParser(), "Set all blocks within selection"),
        "worldedit.region.set")),
    "/set")

别名硬编码为 "/set",故实际输入为 //set。权限节点 worldedit.region.set。内部委托给 ApplyCommand + ReplaceParser,因此支持全部 //replace 的方块表达式语法。

数值与限制

限制 配置项 默认值 作用
最大改动方块数 max-changed-blocks -1(不限) 超出抛 MaxChangedBlocksException
默认改动上限 default-max-changed-blocks -1 每次操作初始化的计数上限
禁用方块 disallowed-blocks 32 个 id 配置命中时该方块不可被写入

配置读取见 worldedit.properties 配置项;掩码与方块表达式的运行时约束见 编辑会话与历史。

交互

  • 所有指令作用于当前玩家的选区;未设置选区时抛 IncompleteRegionException
  • //regen 重新生成地形而非简单恢复原方块,会受当前世界生成器影响
  • //move / //stack 需要同时指定粘贴位置(额外坐标参数)
  • //forest / //flora 密度参数可带百分比

相关条目