miaomiaodouyin-PlanetVeinBurier icon

PlanetVeinBurier

模组作者:妙妙在路上(抖音@妙妙在路上)。一键填埋星球矿脉,快捷键【Ctrl+Shift+M】,支持Nebula联机同步,未安装本模组的玩家也能看到矿脉变化。| Author: 妙妙在路上. One-key bury/restore planet ore veins [Ctrl+Shift+M]; synced via Nebula, visible to players without the mod.

Last updated a day ago
Total downloads 48
Total rating 0 
Categories Cheats
Dependency string miaomiaodouyin-PlanetVeinBurier-1.0.1
Dependants 0 other packages depend on this package

This mod requires the following mods to function

xiaoye97-BepInEx-5.4.17 icon
xiaoye97-BepInEx

BepInEx5.4.17 mod plugin framework, Mod框架

Preferred version: 5.4.17
nebula-NebulaMultiplayerMod-0.9.24 icon
nebula-NebulaMultiplayerMod

With this mod you will be able to play with your friends in the same game! Now supports combat mode in game version 0.10.35

Preferred version: 0.9.24
nebula-NebulaMultiplayerModApi-2.1.0 icon
nebula-NebulaMultiplayerModApi

API for other mods to work with the Nebula Multiplayer Mod. (Does NOT require Nebula)

Preferred version: 2.1.0

README

一键填埋行星矿脉 (Planet Vein Burier)

模组作者:妙妙在路上 | 抖音:@妙妙在路上

戴森球计划(Dyson Sphere Program)模组:一键填埋当前星球的全部矿脉,再按一次恢复矿脉。 底层完全复用游戏沙盒模式自带的"行星改造 / 掩埋矿脉 / 还原改造"原生逻辑,支持 Nebula 联机同步。

  • 快捷键:Ctrl + Shift + M
    • 第一次按:填埋矿脉 —— 整星地表改造并掩埋全部矿脉
    • 第二次按:恢复矿脉 —— 还原整星改造,矿脉重新挖出
  • 快捷键可在自动生成的 cfg 配置文件中修改
  • 联机广播拓扑:玩家 → 主机 → 其他玩家;未安装本模组的玩家也能同步看到矿脉被掩埋 / 挖出

English

Mod author: 妙妙在路上 (MiaoMiao on the Road) | Douyin (抖音): @妙妙在路上

A Dyson Sphere Program mod: bury all ore veins on the current planet with one key press, press again to restore them. It fully reuses the game's native sandbox "Planet Reform / Bury Veins / Revert" logic and supports Nebula multiplayer sync.

  • Hotkey: Ctrl + Shift + M
    • 1st press: Bury veins — reform the planet surface and bury every ore vein
    • 2nd press: Restore veins — revert the planet reform, veins are dug out again
  • The hotkey is configurable in the auto-generated cfg file (BepInEx/config/planetveinburier.cfg)
  • Multiplayer (Nebula): the action is broadcast automatically — player → host → other players. Players who do NOT have this mod installed still see the veins being buried / dug out, because the change travels through Nebula's native planet-reform sync.

English / Quick facts

Item Description
Author 妙妙在路上 — Douyin @妙妙在路上
Hotkey Ctrl + Shift + M (toggle: bury → restore)
How it works Native sandbox API: PlanetFactory.PlanetReformAll(type, color, bury: true) / PlanetReformRevert()
Cost Free, same as sandbox planet reform (no Foundation/Soil items consumed)
Multiplayer Nebula sync; vanilla-mod-less players see the change too
Requirements BepInEx 5.4.x; Nebula + NebulaAPI (multiplayer only)
Install Import PlanetVeinBurier-<version>.zip in r2modman via Import local mod, or upload to Thunderstore
Notifications The game's native top bubble pops on every toggle showing the current state and the next action (e.g. "press Ctrl+Shift+M again to restore"). Other players need no extra tip - Nebula sync shows them the change directly

功能特性

功能 说明
一键填埋 对当前行星调用游戏原生 PlanetFactory.PlanetReformAll(type, color, bury: true)(即沙盒"改造整星 + 掩埋矿脉")
一键恢复 再次按键调用原生 PlanetFactory.PlanetReformRevert()(即沙盒"还原整星改造",矿脉随之重新出现)
保持地面外观 默认自动读取行星当前的地面类型/颜色占比,填埋时沿用原外观(也可在 cfg 中强制指定)
快捷键 cfg 首次启动自动生成 BepInEx/config/planetveinburier.cfg,可改键、改地面样式、开关广播
Nebula 联机 客户端动作自动发给主机,主机落地后由 Nebula 原生同步 + 本模组转发给其他玩家
无模组玩家可见 掩埋/挖出走游戏原生"行星改造"同步通道(Nebula PlanetReformPacket),对方无需安装本模组也能看到变化
原版提示气泡 每次开关弹出游戏原版顶部气泡:当前状态 + 下一步操作(如"再按 Ctrl+Shift+M 恢复矿脉");未降落行星表面就按键时也会提醒
幂等安全 整星改造/还原与沙盒按钮一样可重复执行;联机去重窗口避免重复应用

💡 填埋机理与游戏沙盒一致:矿脉被整星地表覆盖(资源储量不变),"恢复"即还原整星改造把矿脉重新挖出。沙盒行星改造本身不消耗地基/土堆。


使用方法

单机

  1. 进入一颗行星,按 Ctrl + Shift + M → 全部矿脉被掩埋。
  2. 再按一次 Ctrl + Shift + M → 矿脉恢复原样。

联机(Nebula 多人模组)

  1. 所有玩家照常通过 Nebula 建房 / 加入。
  2. 任意玩家按 Ctrl + Shift + M:
    • 主机按键:Nebula 自动把"行星改造"同步给同星系所有玩家(含未装本模组的玩家);
    • 客户端按键:本模组先把动作包 VeinReformPacket 发给主机,主机在本机落地(Nebula 原生前缀随即向同星系所有客户端广播原生改造包),主机再把本模组动作包转发给该星系内其他玩家(排除发送者)。
  3. 装了本模组的玩家会额外收到屏幕提示:"某某 填埋了/恢复了 某某行星 的矿脉"。
  4. 未安装本模组的玩家通过 Nebula 原生同步同样会看到矿脉被掩埋 / 挖出。

配置文件(自动生成)

首次启动游戏后,BepInEx/config/planetveinburier.cfg 自动生成:

[快捷键]

## 在行星上按 Ctrl+Shift+M:第一次按=填埋全部矿脉,第二次按=恢复矿脉。可在本文件中改键。
# Setting type: KeyboardShortcut
# Default value: LeftControl + LeftShift + M
一键填埋/恢复矿脉 = LeftControl + LeftShift + M

[改造]

## -1=自动保持当前地面外观(推荐);0=原生地面;其他值=沙盒改造界面的地面类型编号
# Setting type: Int32
# Default value: -1
地面类型 = -1

## -1=自动保持当前地面颜色(推荐);>=0 为沙盒改造界面的颜色编号
# Setting type: Int32
# Default value: -1
地面颜色 = -1

[联机]

## 联机时,填埋/恢复动作自动广播:客户端先发给主机,主机再广播给其他玩家。
# Setting type: Boolean
# Default value: true
广播动作 = true

## 同一行星在此时间窗口内执行过的相同动作不会被重复应用(防止 Nebula 原生包与本模组包重复叠加)。
# Setting type: Int32
# Default value: 5
去重窗口(秒) = 5

[提示]

## 按快捷键开关矿脉(或收到联机动作)时,在屏幕上方显示气泡提示,包含当前状态与下一步操作。关闭后退回游戏原版顶部提示。
# Setting type: Boolean
# Default value: true
快捷键提示气泡 = true

## 气泡在屏幕上停留的时间(0.5~30 秒)。
# Setting type: Single
# Default value: 3
气泡显示时长(秒) = 3

改完保存 cfg,重启游戏即可生效(改键无需改代码)。


安装

前置要求

组件 版本
戴森球计划 0.10.x(沙盒行星改造版本)
BepInEx 5.4.21+
Nebula 多人模组(仅联机需要) 最新版
NebulaMultiplayerModApi(Nebula 自带,联机需要) 2.x

手动安装

  1. 把 PlanetVeinBurier.dll 放入游戏目录 BepInEx/plugins/。
  2. 启动游戏,首次运行会自动生成 cfg 文件。

管理器安装(r2modman / Thunderstore Mod Manager)

  1. 先运行 .\package.ps1 生成 dist\PlanetVeinBurier-<版本>.zip(详见下方"打包发布")。
  2. r2modman → 选择 Dyson Sphere Program → 配置文件 → 导入本地模组(Import local mod) → 选择该 zip。
  3. 或直接把 zip 上传到 Thunderstore 后在线订阅。

从源码构建

需要 .NET SDK(6.0+)与已安装的游戏。

# 自动探测游戏目录,编译并安装到 BepInEx/plugins
.\build.ps1

# 指定游戏目录
.\build.ps1 -GamePath "D:\Steam\steamapps\common\Dyson Sphere Program"

# 只编译不安装
.\build.ps1 -NoInstall

或手动:

dotnet build src/PlanetVeinBurier.csproj -c Release "-p:DSPGAME_PATH=C:\Program Files (x86)\Steam\steamapps\common\Dyson Sphere Program"
# 产物:src/bin/Release/PlanetVeinBurier.dll

打包发布(r2modman / Thunderstore)

.\package.ps1                    # 编译并生成 dist\PlanetVeinBurier-1.0.1.zip
.\package.ps1 -SkipBuild         # 用 src\bin\Release 里现成的 DLL 直接打包
.\package.ps1 -Version 1.0.1     # 临时覆盖版本号

生成的 zip 即 r2modman / Thunderstore 标准包,结构如下(plugins/ 下的 DLL 会被管理器解压到 BepInEx/plugins):

PlanetVeinBurier-1.0.1.zip
├─ manifest.json     # 包名/版本/描述/依赖
├─ icon.png          # 256x256 图标
├─ README.md         # 模组主页说明
├─ CHANGELOG.md      # 更新日志
└─ plugins/PlanetVeinBurier.dll

使用方式:

  • r2modman 本地导入:打开 r2modman → 选择 Dyson Sphere Program → 配置文件 → 导入本地模组(Import local mod) → 选择 zip → 启动游戏。
  • Thunderstore 在线发布:登录 thunderstore.io 并加入/创建团队 → 团队页 Upload → 选择 zip。发布前建议在 pack/manifest.json 里填上 website_url。

依赖版本(已锁定为当前 Thunderstore 最新):

依赖 版本
xiaoye97-BepInEx 5.4.17
nebula-NebulaMultiplayerMod 0.9.24
nebula-NebulaMultiplayerModApi 2.1.0

Nebula 更新后只需改 pack/manifest.json 中对应版本号重新打包。图标可用 tools\make-icon.ps1 重新生成。


工程结构

PlanetVeinBurier/
├─ build.ps1                          # 构建 + 自动安装脚本
├─ package.ps1                        # 打包 r2modman / Thunderstore 发布包(dist\*.zip)
├─ pack/                              # 发布包静态资源
│  ├─ manifest.json                   # 包名/版本/依赖(Thunderstore 格式)
│  ├─ icon.png                        # 256x256 图标
│  └─ CHANGELOG.md
├─ tools/
│  └─ make-icon.ps1                   # 重新生成 icon.png
├─ verification/                      # 离线编译校验工程(无游戏环境检查源码语法)
└─ src/
   ├─ PlanetVeinBurier.csproj         # 工程文件(引用游戏 DLL + BepInEx + NebulaAPI)
   ├─ Plugin.cs                       # BepInEx 插件入口:cfg 配置、快捷键轮询
   ├─ ReformObserverPatches.cs        # Harmony 后缀:观察本机每次整星改造/还原(含联机触发的)
   ├─ VeinReformTracker.cs            # 行星掩埋状态与去重窗口记录
   ├─ VeinReformService.cs            # 核心:填埋/恢复(原生沙盒 API)、地面样式解析、屏幕提示
   ├─ VeinReformPacket.cs             # 联机动作包(行星id、填埋/恢复、地面类型/颜色、星系id、玩家id/昵称)
   ├─ VeinReformPacketProcessor.cs    # 收包处理:主机落地+转发,客户端落地+提示
   └─ NebulaCompat.cs                 # Nebula 软依赖封装:注册包、广播与转发

技术实现说明

填埋 / 恢复 = 游戏沙盒原生功能

沙盒模式里的"改造整星(掩埋矿脉)/ 还原整星改造"最终调用的就是:

planet.factory.PlanetReformAll(type, color, bury: true);  // 填埋
planet.factory.PlanetReformRevert();                      // 恢复

本模组只是把这两个原生调用绑定到全局快捷键,并补齐联机同步,因此行为与沙盒完全一致、随存档保存、不消耗地基。

快捷键方向(第一次填埋 / 第二次恢复)

  • 优先使用本会话内记录的行星掩埋状态(VeinReformTracker);
  • 新读档的行星则根据 PlatformSystem.reformData 是否存在非零数据推断"是否已改造"。

联机同步协议

客户端A按键
  │ 本机执行 PlanetReformAll/Revert
  │ SendPacket(VeinReformPacket)            ← 只发给主机
  ▼
主机
  │ 收包:本机落地(去重窗口内已应用则跳过)
  │   └─ Nebula 原生 Harmony 前缀自动广播 PlanetReformPacket → 同星系全部客户端
  │      (未安装本模组的玩家在这里收到并应用 → 确认矿脉被掩埋/挖出)
  │ SendPacketToStarExclude(VeinReformPacket, 星系, 发送者) ← 转发给其他装了模组的玩家
  ▼
其他玩家:落地动作 + 屏幕提示(Nebula 原生包与本模组包重复时按去重窗口合并)

联机去重

Harmony 后缀记录本机每次 PlanetReformAll / PlanetReformRevert(无论由按键还是 Nebula 原生包触发)。 收到远端动作包时,若同一行星在"去重窗口"(默认 5 秒)内已执行过相同动作,只弹提示不重复应用,避免叠加执行。


注意事项 / FAQ

  • 会消耗地基吗? 不会。沙盒"行星改造"原生就免费;本模组与其行为一致。
  • 对方没装本模组能收到吗? 能。掩埋/挖出通过 Nebula 原生的行星改造同步通道传播,任何联机玩家(无论是否装本模组)都会看到;装了本模组的玩家还会收到额外的屏幕提示。
  • 为什么建议主机也安装本模组? 客户端发起的填埋需要主机收到动作包后落地并转发;若只有客户端安装,其动作仍能通过 Nebula 原生包到达主机,但其他客户端可能看不到(Nebula 原生不对客户端发起的整星改造做二次转发)。
  • 行星没加载时会立即变化吗? 不会强行加载。目标行星工厂未加载的玩家会在加载该行星时从主机同步到最新状态(掩埋状态属于工厂数据,随存档保存)。
  • 跨星系玩家? 装了本模组的玩家通过转发包立即同步;未装模组的玩家以主机数据为准(加载时同步)。
  • 行星已被我在沙盒里手动改造过怎么办? 本模组填埋时会自动沿用当前占比最高的地面样式;"恢复"会还原整星改造(含你手动做的整星改造)。只想局部铺地基的玩家不要与本功能混用即可。
  • 与"挖出矿脉"的关系? 游戏原生交互中,被掩埋矿脉可在沙盒还原后重新出现;本模组的"恢复"即整星还原,矿脉随之全部挖出。

依赖与致谢

  • 模组作者:妙妙在路上(抖音 @妙妙在路上)
  • BepInEx 5.x
  • Nebula Multiplayer Mod 与 NebulaAPI
  • 游戏 API 参考:PlanetFactory.PlanetReformAll / PlanetReformRevert / PlatformSystem(戴森球计划 0.10.x 沙盒系统)