Picker Dollies
本模组允许你快速、轻松地移动方块或整个建筑。灵感来源于同名 Factorio 模组 以及 Axiom 的建筑工具。使用一个可配置的法杖物品,此模组提供了一系列操作,用于移动、复制或以其他方式修改方块。
开发此模组的动机在于 Axiom 建筑工具与 Sable 之间的不兼容性,同时也希望提供一种简单的建筑工具实现方案,无需安装完整的 Axiom 及其带来的限制(例如有限的多人游戏功能和缺失的 NeoForge 支持)。
操作
- 移动 (Move): 移动、旋转或翻转结构
- 克隆 (Clone): 创建结构的副本
- 填充 (Fill): 用指定方块填充选区
- 堆叠 (Stack): 创建多个具有可配置间距和偏移量的结构副本
显著特性
- 镜像与旋转
- 支持实体方块 (Tile Entities)
- 持久剪贴板: 跨世界和服务器同步,即使重启游戏也能保持
- Sable 兼容性: 不仅便于修改子层级上的结构,还能在子层级之间、从子层级到外部或从外部到子层级移动/复制方块
额外功能
- 快速放置与破坏: 仅需两次点击即可填充或清空大片区域
- 创造模式飞行穿墙 (Noclip): 允许创造模式玩家在飞行时穿透方块,如同处于旁观者模式一般
指南
本模组不会添加任何物品,而是使用指定的法杖物品(可在客户端设置中配置),该物品将调出模组界面。作为对 World Edit 的致敬,默认的法杖物品是木斧。
所有按键绑定同样可配置,因此本指南将使用默认设置。屏幕上始终显示所有可能的操作及其对应的按键绑定。
选区

要开始使用此模组,请在方块上使用 左键 开始选区。点击额外的方块会将选区扩展以包含它们。你可以使用 右键 取消选区。选区将以青色方框可视化显示。
要选择想要使用的操作,请按住 X 并滚动鼠标滚轮。要激活所选操作,请遵循具体说明。
由于滚动操作被模组占用,在活动选区/操作期间选择不同的快捷栏槽位需要使用数字键或将法杖放入副手。
移动操作
有两种移动结构的方法:使用鼠标滚轮,或在按住 中键 的同时拖动鼠标。
使用鼠标滚轮

移动轴由相机角度决定,当前轴由准星旁的轴指示器显示。向下滚动将使结构靠近玩家,向上滚动则相反。
拖动鼠标

将光标置于移动边界盒的一侧,并按住 中键。在此状态下移动光标将使结构跟随移动。移动被限制在你最初指向的边界盒面的平面内。
在此期间你也可以移动,结构将跟随你在移动平面内的玩家移动。

要将结构移动较远距离或在子层级/维度之间移动,请在结构外部的方块上点击 中键。结构将被移至接触该方块的位置。
确认或取消移动
按下 左键 将完成移动并移除原始方块。按下 右键 将中止操作,不会对世界进行任何更改。
镜像与旋转

你可以通过按 Home 键水平镜像你的结构。翻转轴由相机角度决定。
你可以通过按 Page Up 键旋转结构。结构始终绕其垂直轴旋转 90°。
克隆操作

克隆操作的控件与移动操作相同,显著区别在于应用操作时不会移除原始方块。相反,结构的副本将被“盖印”到世界中。该操作不会自动中止(可配置),使你能够轻松连续盖印多个副本。
与移动操作不同,待克隆的结构会在操作开始时立即快照,而操作活动期间的进一步更改不会影响其结果。
使用剪贴板

当操作开始或按下 Ctrl + C 时,当前选区将被复制到剪贴板。你也可以使用 Ctrl + X,这将同时清空选区。
在手持 法杖 且没有活跃选区或操作的情况下,随时按下 Ctrl + V 将启动 克隆操作,加载剪贴板中的结构并将其放置在你的光标位置。你可以使用常规控件来调整结构的位置并将其印入你的世界中。每次使用操作时,剪贴板也会同步更新。
剪贴板在世界和服务器之间是持久的,并且在游戏重启后依然存在。结构体保存在游戏根目录下的 picker_dollies_clipboard.nbt 文件中,并在启动时加载。
你可以通过以下客户端命令与剪贴板交互:
/picker clipboard: 打印剪贴板中是否有内容
/picker clipboard clear: 清空剪贴板(磁盘上的结构文件仍将保留)
/picker clipboard load: 从磁盘重新加载剪贴板
/picker clipboard save: 覆盖磁盘上的结构文件
填充操作

看向一个方块并按下 鼠标中键。该方块将用于填充选区的体积。
堆叠操作

此操作非常复杂,且仍存在一些问题。使用此操作,你可以多次复制结构,并调整间距和偏移量。要指定结构复制的方向和次数,你可以使用鼠标滚轮,或者按住 鼠标中键 拖拽,其行为类似于 调整选区操作。

调整间距和偏移量

按住 X 可以调整生成结构之间的间隙或偏移量。
调整选区

按下 左 Shift 可以调整选区,移动和调整其大小,无需支撑方块,甚至可以直接穿透墙壁。
调整选区大小
按住 X 可以调整选区的大小。滚动时,你会根据相机角度确定的轴,移动包围盒远离你那一侧的面。

拖拽时,你会在你所选面的平面内,移动最接近光标的边缘。
快速放置与破坏
将 法杖物品 放在副手栏,你可以快速填充或清除大片区域。通过放置一个方块,你可以用该方块填充整个区域;或者通过破坏一个方块,你可以摧毁整个区域。

与其他操作不同,快速放置不会覆盖现有方块(可替换的方块除外,如草)。放置的方块将保留原始放置方块的状态(例如旋转、半砖的顶部/底部)。
在破坏时,被摧毁的区域会保存到剪贴板中,以便在出错时可以恢复。
可用形状如下:
- 传统模式: 以目标方块为终点填充一个区域
- 直线: 沿任意基本轴填充一条直线
- 墙壁: 在 X 或 Z 平面内厚度为 1 个方块的墙
- 地板: 在 Y 平面内厚度为 1 个方块的地板
- 立方体: 以相机前方空中的某点为终点填充一个区域
创造模式飞行穿墙

此功能默认禁用,可以在服务器设置中启用。激活后,所有创造模式玩家在飞行时将像旁观者一样穿透方块。
详情
结构
本模组利用 Minecraft 的 StructureTemplate API 运行,这与 结构方块 或 Create 蓝图所使用的相同。作为 Minecraft 的标准组成部分,这应能确保与其他模组的最大兼容性。
为了创建结构的预览,当你激活操作时,服务器会创建一个结构模板并发送给客户端。客户端也使用此结构模板进行剪贴板操作。
在粘贴时,为了实现世界间结构的传输,客户端会将结构模板发送给服务器。这受限于数据包大小限制,但为此目的使用了压缩技术,因此用户不太可能遇到任何问题。
由于直接发送结构模板,这里存在一个安全考量。对于从服务器到客户端的发送,客户端将接收所选区域的所有世界数据,包括容器内的内容。
对于从客户端到服务器的发送,客户端可以发送任意类型的结构,甚至那些正常情况下不应被创建的结构。此外,虽然整个网络数据包的大小是有限的,但结构模板的未压缩大小没有限制。
建议仅在多人游戏中,且你信任所有参与玩家的情况下使用此模组。
模组快捷键
为了捕获鼠标和滚轮事件并避免与标准 Minecraft 行为冲突,此模组直接监听 NeoForge 的 InputEvent,并在匹配到快捷键时取消这些事件。此行为在手持 法杖 时生效。
不幸的是,键盘事件无法被取消,因此与其他基于键盘的快捷键冲突是无法避免的。
Sable 集成
此模组使用 Sable Companion 库来理解子层级(sublevels)。当对子层级进行选择或操作时,该库用于生成一个 Matrix4d,然后将所有输入转换到子层级的局部空间,并将所有可视化结果转换回世界空间。
这意味着通过滚动进行移动始终与相机视图保持一致,即使子层级被旋转也是如此。你可以在子层级内创建一个选择,并观察准星旁边的轴指示器显示子层级的轴而非世界空间的轴,以此观察这一行为。
创造模式飞行穿墙
为了启用穿透方块的行为,模组在执行玩家实体 tick 函数期间,临时将玩家的游戏模式覆盖为旁观者模式。由于此修改仅应用于特定的时间窗口,它除了影响物理效果外,不会影响其他任何内容。
此修改同时在客户端和服务端进行。在服务端,ServerPlayer 的 ServerPlayerGameMode 对象将被修改,将其 gameModeForPlayer 字段设置为 GameType.SPECTATOR。在客户端,与玩家 UUID 关联的 PlayerInfo 将被修改,设置其 gameMode 字段。
被修改的玩家实体会存储在一个集合中。在 tick 结束后,这些更改会通过将相应字段重置为 GameMode.CREATIVE 来撤销。
Picker Dollies
This mod allows you to move blocks or entire builds quickly and easily. Inspired by the Factorio mod of the same name and Axiom build tools. Using a configurable wand item, this this mod allows you to utilise a set of operations which move, duplicate or otherwise modify blocks.
The motivation for this work is the incompatibility between Axiom build tools and Sable, but also a desire to have a simple implementation of a selection of build tools which do not require an entire Axiom installation and the limitations that come with it, such as limited multiplayer functionality and missing NeoForge support.
Operations
- Move: Move, rotate, or flip a structure
- Clone: Create a copy of a structure
- Fill: Fill your selection with a desired block
- Stack: Create multiple copies of a structure with configurable spacing and offsets
Notable features
- Mirroring and rotation
- Support for tile entities
- Persistent Clipboard: Synchronised across worlds and servers, even through game restarts
- Sable compatibility: Not only enabling easy modification of structures on sublevels, but also moving/coping blocks from, into, and between sublevels
Extra functionality
- Quick place and break: Fill or clear large areas with only two clicks
- Creative flight noclip: Allows creative players to phase thought blocks during flight as if they were in spectator
Guide
This mod does not add any items, instead it uses a designated wand item (configurable in client settings), which will bring out the mod interface. As a nod to World Edit, the default wand item is the wooden axe.
All keybindings are likewise configurable, so the defaults will be used in this guide. All possible actions are always displayed on the screen, along with their respective keybindings.
Selection

To start using this mod, start a selection by using Left Click on a block. Clicking on additional blocks will expand the selection to encompass them. You can discard a selection using Right Click. The selection is visualised using a cyan box.
To select an operation you wish to use, hold down X and scroll. To activate the selected operation, follow the individual instructions.
As the action of scrolling is utilised by the mod, selecting a different hotbar slot during an active selection/operation requires the use of number keys or putting the wand into the offhand.
Move Operation
There are two ways of moving of a structure: using the scroll wheel or dragging the mouse while holding down Middle Button.
Using a scroll wheel

The axis of movement is determined by the camera angle, the current axis is indicated by the axis indicator by the crosshair. Scrolling down will bring the structure towards the player and scrolling up will do the opposite.
Dragging the mouse

Point your cursor over a side of the movement bounding box and hold down the Middle Button. Moving your cursor in this state will move the structure to follow. Movement is restricted to the plane of the face of the bounding box you have originally pointed at.
You can also moving during this time, the structure will follow your player's movement in the movement plane.

To move a structure a larger distance or between sublevels/dimensions, click the Middle Button outside your structure and onto an external block. The structure will be brought over to touch the block.
Confirming or cancelling the movement
Pressing Left Button will finish the movement and remove the original blocks. Pressing Right Button will abort the operation, not any change to the world.
Mirroring and rotation

You can horizontally mirror your structure by pressing the Home button. The axis of the flip is determined via your camera angle.
You can rotate your structure by pressing the Page Up button. The structure is always rotated 90° on its vertical axis.
Clone Operation

The controls of the clone operation are identical with the Move Operation, with the notable difference of not removing the original blocks when the operation is applied. Instead a copy of the structure will be stamped into the world. The operation will not automatically abort (configurable), allowing you to easily stamp multiple copies in a row.
Unlike the Move Operation the structure to be cloned is snapshotted the moment the operation starts and further changes while the operation is active do not affect its results.
Using the clipboard

When an operation starts or upon pressing Ctrl + C, the current selection will be put into your clipboard. You can also use Ctrl + X, which will additionally empty the selection.
Pressing Ctrl + V at any moment while holding the wand and not having a selection/operation active will start the Clone Operation, with the structure in your clipboard loaded, at your cursor. You can use the normal controls to adjust the positioning of the structure and the stamp it into your world. The clipboard is also updated every time you use an operation.
The clipboard is persistent between world and servers, and remains after game restarts. The structure is saved to the picker_dollies_clipboard.nbt file in the root of your game folder and loaded at startup.
You can interact with the clipboard using these client side commands:
/picker clipboard: Prints whether you have something in your clipboard
/picker clipboard clear: Clears the clipboard (the structure file will remain on your disk)
/picker clipboard load: Reloads the clipboard from disk
/picker clipboard save: Overwrites the structure file on disk
Fill Operation

Click the Middle Button while looking at a block. This block will be used to fill the volume of your selection.
Stack operation

This operation is very complex and has still some UX problems. Using this operation, you can duplicate a structure many times with adjustable spacing and offsets. To specify in which directions, and how many times, the structure will be duplicated, you can either use your scrollwhell or drag using the Middle Button and behaves similarly to the Adjust Selection Operation.

Adjusting the spacing and offsets

You can adjust the gaps or offsets between created structures by holding X.
Adjusting the selection

By pressing Left Shift, you can adjust you selection, moving and resizing it without the need for supporting blocks or even through walls.
Resizing the selection
You can resize the selection by holding X. When scrolling, you will move the face of the bounding box opposite of you in the axis as determined by your camera angle.

When dragging, you will move the edge closest to your cursor in the plane of the face your have selected.
Quick place and break
By putting the wand item in your offhand you can quickly fill or clear large areas. By placing a block, you can fill a whole area with that block or, by breaking a block, you can destroy a whole area.

Unlike other operations, quick place will not overwrite existing blocks (with the exception of replaceable blocks, like grass). The placed block will have the state (e.g. rotation, slab top/bottom) of the originally placed block.
When breaking, the destroyed area will be saved in your clipboard, so you can restore it in case of a mistake.
The following shapes are available:
- Legacy: fills an area with the end point being a targeted block
- Line: fills a straight line in any cardinal axis
- Wall: 1 block thick in either the X or Z plane
- Floor: 1 block thick in the Y plane
- Cube: fills an area with the end point being a point in the air in front of the camera
Creative flight noclip

This feature is disable by default and can be enabled in the server settings. When active, all creative players will phase through block when flying, as if they were in spectator.
Details
Structures
This mod operates by utilizing Minecraft's StructureTemplate API, the same as used by structure blocks or by Create schematics. It, being a standard part of Minecraft, should ensure the widest compatibility with other mods.
To create the preview of your structure, the server creates a structure template the moment you activate an operation and sends it to the client. The client also uses this structure template for its clipboard.
When pasting, to allow the transfer of structures between worlds, the client sends the structure template to the server. This is subject to packet size limitations, but compression is used for this purpose, so a user is unlikely to encounter any problems.
Because of this direct sending of structure templates, there is a security consideration. For the sending of server to client, the client will receive all world data of the region they have selected, including the contents of containers.
For the sending of client to server, the client can send any kind of structure, even those which shouldn't be creatable normally. Additionally, while the size of the entire network packet is limited, there is no limit to the uncompressed size of the structure template.
It is recommended to only use this mod in multiplayer when you trust all involved players.
Mod keybindings
To capture mouse and scrollwhell events and avoid conflicts with standard Minecraft behaviour, this mod listens directly on NeoForge's InputEvents and cancels them if they match a keybinding. This behaviour is active while the wand is held.
Unfortunately, keyboard events cannot be cancelled, so conflicts with other key-based keybindings are not avoidable.
Sable integration
This mod uses the Sable Companion library to understand sublevels. When a selection or an operation is used on a sublevel, this library is used to generate a Matrix4d, which is then used to transform all inputs into the local space of the sublevel, and transform all visualisation back into world space.
This means that moving by scrolling is always accurate to the camera view, even when the sublevel is rotated. You can observe this behaviour by creating a selection inside a sublevel and watching as the axis indicator next to the crosshair shows the axes of the sublevel instead of the world space ones.
Creative flight noclip
To enable the behaviour of phasing through blocks, the mod temporarily overrides the players's gamemode to spectator during the execution of the player entity's tick function. As this modification is only applied for that specific time window, it doesn't affect anything else except for physics.
This modification is done both on the client and the server. On the server side, the ServerPlayer's ServerPlayerGameMode object will be modified, setting its gameModeForPlayer field to GameType.SPECTATOR. On the client side, the PlayerInfo associated with the player's UUID will be modified, setting its gameMode field.
Modified entities are stored in a collection. Upon the conclusion of the tick, these changes are reverted by setting the respective fields back to GameMode.CREATIVE.
评论 0
登录后参与评分
还没有评论,来抢沙发吧