适用于 Touhou Little Maid 的 NeoForge 1.21.1 插件。它添加了 Obey 任务,允许玩家使用可配置的物品作为指令媒介,向服务器发送权威的收集、采集、液体吸取、导航和交付命令。
本模块使用 AI 辅助开发。
功能
- 指挥一个或多个任务设置为 Obey 的已拥有女仆。
- 在可调的球形范围内收集单个方块或所有匹配的方块。
- 将匹配的方块分组为 26 邻域连通簇,并将整个簇分配给不同的女仆。
- 从每个女仆的背包中选择有效的工具,并在工具损坏时重新检查。
- 当方块无需工具即可掉落完整正常掉落物时,空手工作。
- 收割成熟的作物、草、花朵、浆果灌木、特殊的 TLM 作物以及兼容的基于年龄生长的作物。
- 重新种植被破坏的基于年龄生长的作物;南瓜和西瓜保持为普通方块目标。
- 使用空桶收集源头流体。
- 使用真实的方块硬度和工具速度,包括同步显示的破碎裂纹。
- 选择目标周围最短可达的安全工作位置。
- 当普通导航失败时,可选择破坏障碍物并建造实心方块桥梁。
- 仅将通过当前命令获取的物品交付到原版或模组化的 ItemHandler 容器。
- 支持专用服务器、多人游戏的所有权检查、按玩家的范围同步以及本地化消息。
依赖
| 组件 |
所需版本 |
| Minecraft |
1.21.1 |
| NeoForge |
21.1.248 或兼容的较新 21.1 构建 |
| Touhou Little Maid |
适用于 Minecraft 1.21.1 的 NeoForge 1.5.3 或兼容版本 |
| Java |
21 |
该模组和 Touhou Little Maid 必须安装在服务器和所有加入的客户端上。
安装
- 安装适用于 Minecraft 1.21.1 的 NeoForge。
- 将 Touhou Little Maid 和本模组的 JAR 文件放入
mods 文件夹。
- 启动游戏或服务器一次以生成配置文件。
- 在女仆 GUI 中将一个或多个已拥有女仆的任务设置为 Obey。
基本命令
默认的命令物品是一把木镐。可以在通用配置中将其替换为任何已注册的物品。
| 输入 |
结果 |
| 主手命令物品 + 左击方块 |
仅收集该方块。 |
| 主手命令物品 + 右击方块 |
收集选中球形范围内的匹配方块。 |
| 右击成熟的作物、草、花或浆果植物 |
使用适当的方法收割范围内所有符合条件的目标。 |
| 右击源头流体 |
用女仆背包中的空桶收集匹配的源方块。 |
| 对容器使用命令物品 |
将该容器绑定为附近已拥有的 Obey 女仆的交付目的地。 |
| 按住范围修饰键并滚动鼠标滚轮 |
增加或减少范围,并显示绿色粒子球体。 |
命令会影响点击位置 32 格内处于活跃状态且当前工作类型为 Obey 的已拥有女仆。服务器端冷却时间和最多 4,096 个目标上限可防止多人服务器因过度扫描而受影响。
范围和集群
默认范围为 8 格,允许的范围是 1–32 格。范围存储在逻辑服务器的每个玩家数据中,登录时同步,可以通过修饰键 + 滚轮或在女仆的 Obey 设置屏幕中更改。
通过面、边或角接触的匹配方块形成一个集群。整个集群按轮询方式分配给可用的女仆,而集群内部的目标则根据点击的方块使用确定性最近邻路径进行排序。这避免了分割对角线矿脉并减少不必要的折返。
工具、掉落物和耐久度
在分配工作之前,服务器会验证女仆是否有合适的工具,或者能否空手获得完整掉落物。女仆会从她的背包中装备匹配的工具,使用方块/工具速度计算挖掘时间,消耗耐久度,并在工具损坏时选择替代品。如果没有替代品,任务将以本地化消息停止。如果选定的工具不会产生掉落物,则不会破坏方块。
作物和流体
- 甜浆果灌木和结浆果的藤蔓在不破坏植株的情况下被收割。
- 成熟的基于年龄生长的作物被破坏以获取掉落物,并重置为最小年龄以代表重新种植。
- 当其他模组注册了处理器时,使用 Touhou Little Maid 的特殊作物处理器。
- 南瓜和西瓜被视为普通方块,不会被重新种植。
- 仅收集源流体,且女仆必须持有空桶。
导航、障碍物破坏和桥梁
对于每个目标,服务器评估交互距离内的安全站立位置,拒绝危险或被阻挡的位置,创建真实路径,并选择最短的可达路线。Touhou Little Maid 的正常移动控制器处理普通的一格跳跃。
当不存在路线或女仆卡住时,可选的回退行为可以破坏阻挡的脚部/头部方块或在目标方向放置桥梁。桥梁方块必须是完整的实心方块且不含方块实体,不能是沙或砾石等下落方块。当前 GUI 开关在活动任务期间会被重新读取,因此禁用桥梁建造会立即阻止后续放置。
交付容器和时机
通过将命令物品作用于箱子或任何暴露 NeoForge 的 ItemHandler 能力的模组化方块来绑定容器。每个女仆存储自己的容器位置和维度。
Obey GUI 提供以下交付触发器:
- 经过可配置的时间间隔后;
- 完成一个连通集群后;
- 收集完一整组后;
- 当女仆背包已满时。
无论这些可选触发器如何,当命令结束且有跟踪的命令物品需要交付时,总会访问绑定的容器。仅移动当前命令期间获得的物品;保留现有的女仆库存内容。
配置
通用/服务器配置
文件:config/littlemaidsomeinstructions-common.toml
command_item = "minecraft:wooden_pickaxe"
command_item 接受已注册的物品资源 ID,包括来自其他模组的物品。服务器端的值为权威值,并在玩家登录时同步给客户端。更改后需重启世界或专用服务器。
客户端配置与按键绑定
文件:config/littlemaidsomeinstructions-client.toml
range_modifier_default_key = "key.keyboard.left.control"
此值定义默认/重置的按键绑定,编辑后需要重启游戏才能生效。当前的按键绑定可以通过以下路径正常修改:
选项 → 控制设置 → 按键绑定 → Little Maid: Some Instructions → 范围调整修饰键
Minecraft 会将“控制设置”菜单中的覆盖配置保存至其正常的选项文件中。按下 重置 按钮将恢复为客户端配置中指定的默认值。
女仆专属的服从设置
| 设置项 |
含义 |
| 采集范围 |
复制至操控玩家当前命令范围的采集半径。 |
| 破坏障碍 |
允许定时销毁阻碍撤退移动的方块。 |
| 建造桥梁 |
允许从背包中放置完整的实心方块以跨越间隙。 |
| 定时投递 |
启用基于时间间隔的投递功能。 |
| 集群投递 |
在连接到的每个集群完成后进行投递。 |
| 满堆投递 |
当命令已收集满一整组物品后进行投递。 |
| 满背包投递 |
当背包所有槽位均无可用空间时进行投递。 |
| 投递间隔 |
在启用定时投递时为 5–600 秒。 |
多人游戏与安全模型
所有的目标发现、所有权检查、工具验证、路径决策、掉落物处理、世界变更以及容器交互均在逻辑服务端执行。客户端仅发送请求的范围值并显示粒子效果/消息。服务端会对范围值进行钳制,再次检查同步后的命令物品,并将接受的值返回给客户端。工作会话绑定于女仆 UUID、所有者 UUID 和维度,并在所有权、任务类型或玩家连接状态发生变化时终止。
A NeoForge 1.21.1 addon for Touhou Little Maid. It adds the Obey task, allowing players to issue server-authoritative collection, harvesting, fluid pickup, navigation, and delivery commands with a configurable command item.
##This module uses AI for assisted development.
Features
- Commands one or several owned maids whose task is set to Obey.
- Collects one block or all matching blocks inside an adjustable spherical range.
- Groups matching blocks into 26-neighbour connected clusters and distributes whole clusters between maids.
- Selects a valid tool from each maid's backpack and rechecks when that tool breaks.
- Works empty-handed when the block produces its complete normal drop without a tool.
- Harvests mature crops, grass, flowers, berry bushes, special TLM crops, and compatible age-based crops.
- Replants destructive age-based crops; pumpkins and melons remain ordinary block targets.
- Collects source fluids with empty buckets.
- Uses real block hardness and tool speed, including synchronized breaking cracks.
- Chooses the shortest reachable safe working position around a target.
- Optionally breaks obstacles and builds solid-block bridges when ordinary navigation fails.
- Delivers only items acquired by the current command to vanilla or modded ItemHandler containers.
- Supports dedicated servers, multiplayer ownership checks, per-player range synchronization, and localized messages.
Requirements
| Component |
Required version |
| Minecraft |
1.21.1 |
| NeoForge |
21.1.248 or a compatible newer 21.1 build |
| Touhou Little Maid |
1.5.3 NeoForge for Minecraft 1.21.1 or compatible |
| Java |
21 |
The mod and Touhou Little Maid must be installed on both the server and every joining client.
Installation
- Install NeoForge for Minecraft 1.21.1.
- Put Touhou Little Maid and this mod's JAR into the
mods folder.
- Start the game or server once to generate the configuration files.
- Set one or more owned maids' task to Obey in the maid GUI.
Basic commands
The default command item is a wooden pickaxe. It can be replaced with any registered item in the common config.
| Input |
Result |
| Main-hand command item + left-click a block |
Collect only that block. |
| Main-hand command item + right-click a block |
Collect matching blocks inside the selected spherical range. |
| Right-click a mature crop, grass, flower, or berry plant |
Harvest all matching eligible targets in range using the appropriate method. |
| Right-click a source fluid |
Collect matching source blocks with buckets from maid backpacks. |
| Use the command item on a container |
Bind that container as the delivery destination for nearby owned Obey maids. |
| Hold the range modifier and scroll |
Increase or decrease the range and display a green particle sphere. |
Commands affect living, owned maids within 32 blocks of the clicked position whose current work type is Obey. A server-side cooldown and a maximum of 4,096 targets protect multiplayer servers from excessive scans.
Range and clusters
The default range is 8 blocks and the allowed range is 1–32 blocks. Range is stored per player on the logical server, synchronized on login, and can be changed either with modifier + wheel or in a maid's Obey settings screen.
Matching blocks that touch by a face, edge, or corner form one cluster. Whole clusters are assigned round-robin to available maids, while targets inside a cluster are ordered from the clicked block using a deterministic nearest-neighbour route. This avoids splitting diagonal ore veins and reduces unnecessary backtracking.
Tools, drops, and durability
Before assigning work, the server verifies that the maid has a suitable tool or can obtain a complete drop with an empty hand. The maid equips a matching tool from her backpack, uses block/tool speed to calculate breaking time, consumes durability, and selects a replacement if the tool breaks. If no replacement exists, the task stops with a localized message. A block is not destroyed when the selected tool would produce no drops.
Crops and fluids
- Sweet berry bushes and berry-bearing vines are harvested without destroying the plant.
- Mature age-based crops are broken for drops and reset to their minimum age to represent replanting.
- Touhou Little Maid special crop handlers are used when another mod has registered one.
- Pumpkins and melons are treated as normal blocks and are not replanted.
- Only source fluids are collected, and the maid must have an empty bucket.
Navigation, obstacle breaking, and bridges
For every target, the server evaluates safe standing positions within interaction distance, rejects hazardous or obstructed positions, creates real paths, and selects the shortest reachable route. Touhou Little Maid's normal movement controller handles ordinary one-block jumps.
When no route exists or a maid remains stuck, optional fallback behavior can break the blocking foot/head block or place a bridge in the target direction. Bridge blocks must be full solid blocks without block entities and cannot be falling blocks such as sand or gravel. The current GUI switches are re-read during an active task, so disabling bridge building prevents later placements immediately.
Delivery containers and timing
Bind a chest or any modded block exposing NeoForge's ItemHandler capability by using the command item on it. Each maid stores her own container position and dimension.
The Obey GUI offers these delivery triggers:
- after a configurable time interval;
- after finishing one connected cluster;
- after collecting one full stack;
- when the maid backpack is full.
Regardless of those optional triggers, a bound container is always visited when the command finishes and there are tracked command items to deliver. Only items gained during the current command are moved; existing maid inventory contents are preserved.
Configuration
Common/server configuration
File: config/littlemaidsomeinstructions-common.toml
command_item = "minecraft:wooden_pickaxe"
command_item accepts a registered item resource ID, including items from other mods. The server value is authoritative and is synchronized to players when they log in. Restart the world or dedicated server after changing it.
Client configuration and key binding
File: config/littlemaidsomeinstructions-client.toml
range_modifier_default_key = "key.keyboard.left.control"
This value defines the default/reset binding and requires a game restart after editing. The active binding can be changed normally under:
Options → Controls → Key Binds → Little Maid: Some Instructions → Range adjustment modifier
Minecraft saves the Controls-menu override in its normal options file. Pressing Reset returns to the default specified by the client config.
Per-maid Obey settings
| Setting |
Meaning |
| Collection range |
Range copied to the controlling player's current command range. |
| Break obstacles |
Allows timed destruction of blocks obstructing fallback movement. |
| Build bridges |
Allows safe full solid blocks from the backpack to be placed across gaps. |
| Timed delivery |
Enables interval-based delivery. |
| Cluster delivery |
Delivers after each connected cluster. |
| Full-stack delivery |
Delivers after the command has collected a complete stack. |
| Full-backpack delivery |
Delivers when no backpack slot has usable space. |
| Delivery interval |
5–600 seconds when timed delivery is enabled. |
Multiplayer and security model
All target discovery, ownership checks, tool validation, path decisions, drops, world changes, and container transfers happen on the logical server. Clients only send a requested range and display particles/messages. The server clamps the range, checks the synchronized command item again, and sends the accepted value back. Work sessions are bound to maid UUID, owner UUID, and dimension and stop when ownership, task type, or player connection changes.
评论 0
登录后参与评分
还没有评论,来抢沙发吧