CC Synaxis Connector
CC Synaxis Connector 是一款 NeoForge 兼容模组,用于将 CC: Tweaked 计算机与 Synaxis Cimulink 植物端口连接起来。
它添加了桥接式电路板,使 Lua 程序、Synaxis 电路和 CSV 日志工作流程能够交换数值,而无需在连接的每一侧都编写自定义脚本。
亮点
- 连接 CC: Tweaked 外设和 Synaxis Cimulink 端口。
- 暴露具名的单向实数/布尔桥接信号。
- 使用超级集线器(Super Hub)电路板封装相邻的 CC 外设和 Synaxis 植物数值。
- 通过单个外设从 CC Lua 读取选定的 Synaxis 数值。
- 将 CC 获取器/设置器风格的外设方法写入 Synaxis 端口。
- 使用游戏内表格编辑器将 Synaxis 信号记录到 CSV 文件中。
- 支持英文和简体中文界面文本。
要求
本模组并非独立运行。需与 CC: Tweaked、Synaxis 以及 Synaxis 所需的依赖项一同安装。
测试目标版本:
- Minecraft
1.21.1
- NeoForge
21.1.226+
- CC: Tweaked
1.118.0+
- Synaxis
1.3.4+
- Sable
1.1.3+
- Sable Schematic API
0.2.6+
- LDLib2
2.2.17+
- Create
6.0.10+
- Flywheel
1.0.6+
生成的 jar 文件不包含 CC: Tweaked、Synaxis、Sable、Create 或其资源。你必须从其官方分发渠道获取这些模组。
方块
CC: Synaxis Bridge
Bridge 是一种小型 Cimulink 风格电路板,用于手动创建单向信号通道。
每个桥接通道具有以下属性:
- 唯一名称,例如
bridge_1
- 类型:
real(实数)或 boolean(布尔值)
- 方向:
cc_to_synaxis 或 synaxis_to_cc
- 可选的“保存最后数值”设置,用于处理缺失的 Synaxis 输入
使用方块界面创建和移除桥接通道。使用 Synaxis 布线工具连接生成的端口。CC 计算机可以将该方块作为名为 cc_synaxis_bridge 的外设进行访问。
CC: Synaxis Super Hub
Super Hub 是一种电路板,用于将附近的设备封装为另一侧桥接的端口。
它有两个界面页面:
- 提供给 Synaxis:选择封装的 CC 或 Synaxis 功能,并将其暴露为 Synaxis Cimulink 端口。
- 提供给 CC:选择封装的 CC 或 Synaxis 功能,并通过 Super Hub CC 外设暴露它们。
对于 CC 外设,类似获取器的方法如 getSpeed()、isRunning() 或 hasFuel() 被视为可读数值。类似设置器的方法如 setSpeed(value) 则在可能情况下变为可写输入。
对于 Synaxis,集线器通过 Synaxis 总线/植物端口风格的访问读取可用的植物数值,并将兼容的数值呈现给 CC 或 Synaxis 端口。
Log Output Assistant
Log Output Assistant 是一个 Synaxis 输入电路板,可将信号值写入 CSV 文件。
它支持最多 10 列。每列创建一个 Synaxis 输入端口,并可配置为 real 或 boolean。除非跳过空行,否则未激活的空输入将写入为 null。
主要选项:
- 日志名称 / 输出文件
- 行 ID:刻、行号或无
- 写入模式:每刻、数值变化时或每隔 N 刻
- 创建模式:立即、任何输入时或选定一个输入时
- 跳过或写入完全空的行
- 从安全输出文件夹导入现有 CSV 文件
CSV 文件写入当前存档下的以下目录中:
ccsconnector_outputs/
在服务器上,文件选择有意限制在此输出文件夹内。客户端导入流程也仅扫描客户端自身的 ccsconnector_outputs 文件夹,并将选定的 CSV 内容上传至服务器。
基本用法
- 放置其中一个连接器电路板。
- 手持空物品右键点击电路板以打开其界面。
- 配置你想要的桥接、集线器或日志列。
- 使用 Synaxis 布线工具连接可见的端口。
- 当需要 CC 访问时,在方块旁边附着或放置一台 CC 计算机。
- 使用 Lua 外设调用来读取或写入配置的数值。
CC Lua API
Bridge Peripheral
外设类型:
cc_synaxis_bridge
方法:
list()
schema()
info(name)
addBridge([name], type, direction)
removeBridge(name)
get(name)
set(name, value)
lastWriteTick(name)
getSaveLastValue(name)
setSaveLastValue(name, enabled)
toggleSaveLastValue(name)
示例:
local bridge = peripheral.find("cc_synaxis_bridge")
assert(bridge, "Bridge not found")
bridge.addBridge("target_speed", "real", "cc_to_synaxis")
local value = 0
while true do
bridge.set("target_speed", value)
value = value + 1
sleep(1)
end
Super Hub Peripheral
外设类型:
cc_synaxis_super_hub
方法:
list()
schema()
get(name)
getAll()
refresh()
lastUpdateTick(name)
listSynaxis()
getSynaxis(name)
getAllSynaxis()
synaxisLastUpdateTick(name)
listCcCandidates()
listExposedCc()
getCc(name)
getAllCc()
expose(...)
toggleExpose(...)
set(name, value)
write(name, value)
listProvidedToSynaxis()
暴露功能在 Super Hub 界面中配置。Lua 可以读取已配置的数值并写入已配置的可写条目,但它不会创建 UI 暴露行。expose 和 toggleExpose 条目是保留的兼容性方法,将引导玩家在界面中配置暴露功能。
示例:
local hub = peripheral.find("cc_synaxis_super_hub")
assert(hub, "Super Hub not found")
hub.refresh()
for name, value in pairs(hub.getAll()) do
print(name, value)
end
注意事项和限制
- 面向 Synaxis 的端口目前支持
real 和 boolean 数值。
- 文本/字符串数值不会作为 Synaxis 端口暴露,除非 Synaxis 提供了兼容的信号类型。
- 并非所有 CC 外设方法都可以在不带参数的情况下安全调用。Super Hub 专注于简单的获取器/设置器风格方法。
- CC 和 Synaxis 的更新速率可能不同。连接器方块会缓存数值,以便任一侧都能以自己的节奏进行读取。
- 使用正常的 Synaxis 工具配置 Synaxis 线路。手持空物品右键点击可打开连接器界面。
整合包权限
你可以在整合包中包含 CC Synaxis Connector,前提是必须按照各依赖项各自的许可证和权限获取并分发它们。
许可证
本仓库中的 MIT 许可证仅适用于本项目原始兼容层代码和资源资产。详见 LICENSE。
CC: Tweaked、Synaxis、Sable、LDLib、Create、Flywheel、NeoForge、Minecraft 及相关名称、API、商标、源代码、二进制文件、模型、纹理及文档均归其各自所有者所有,并继续受其上游条款约束。
CC Synaxis Connector 是一个独立开发、由 AI 辅助制作的兼容模组。它与 CC: Tweaked、Synaxis、Sable、LDLib、Create、NeoForge、Minecraft 或 Mojang/Microsoft 的作者无关,也未获得他们的认可或赞助。
有关依赖项和权利持有者的说明,请参阅 THIRD_PARTY_NOTICES.md。
开发说明
大多数依赖项通过 Gradle 从 Maven 解析。本地的 libs/ 目录仅用于当前无法从该项目公开 Maven 中解析的依赖项:
synaxis-1.3.4.jar
sable-schematic-api-0.2.6.jar
Git 会忽略 libs/*.jar,因此不应提交依赖 jar 包。
针对 CC:T 通用外设的兼容性回退机制隔离在 CcTweakedInternals 中,以便在非公开的 CC:T 访问易于审计或在上下游 API 变更时移除。
Synaxis 植物访问通过注册的 PlantEndpointProvider 端口和 PlantPortProviders.tryCreate 进行。
CC Synaxis Connector
CC Synaxis Connector is a NeoForge compatibility mod for connecting
CC: Tweaked computers with Synaxis Cimulink plant ports.
It adds bridge-style circuit boards that let Lua programs, Synaxis circuits, and
CSV logging workflows exchange values without requiring custom scripts on both
sides of every connection.
Highlights
- Connect CC: Tweaked peripherals and Synaxis Cimulink ports.
- Expose named one-way real/boolean bridge signals.
- Use a Super Hub board to wrap adjacent CC peripherals and Synaxis plant values.
- Read selected Synaxis values from CC Lua through a single peripheral.
- Write CC getter/setter-style peripheral methods into Synaxis ports.
- Record Synaxis signals to CSV files with an in-game table editor.
- Supports both English and Simplified Chinese UI text.
Requirements
This mod is not standalone. Install it together with CC: Tweaked, Synaxis, and
the dependencies required by Synaxis.
Tested target:
- Minecraft
1.21.1
- NeoForge
21.1.226+
- CC: Tweaked
1.118.0+
- Synaxis
1.3.4+
- Sable
1.1.3+
- Sable Schematic API
0.2.6+
- LDLib2
2.2.17+
- Create
6.0.10+
- Flywheel
1.0.6+
The generated jar does not include CC: Tweaked, Synaxis, Sable, Create, or their
assets. You must obtain those mods from their official distribution channels.
Blocks
CC: Synaxis Bridge
The Bridge is a small Cimulink-style board for manually created one-way signal
channels.
Each bridge channel has:
- a unique name, such as
bridge_1
- a type:
real or boolean
- a direction:
cc_to_synaxis or synaxis_to_cc
- an optional "save last value" setting for missing Synaxis input
Use the block UI to create and remove bridge channels. Use Synaxis wiring tools
to connect the generated ports. CC computers can access the block as a peripheral
named cc_synaxis_bridge.
CC: Synaxis Super Hub
The Super Hub is a board for wrapping nearby devices into ports for the other
side of the bridge.
It has two UI pages:
- Providing to Synaxis: select wrapped CC or Synaxis capabilities and expose
them as Synaxis Cimulink ports.
- Providing to CC: select wrapped CC or Synaxis capabilities and expose them
through the Super Hub CC peripheral.
For CC peripherals, getter-like methods such as getSpeed(), isRunning(), or
hasFuel() are treated as readable values. Setter-like methods such as
setSpeed(value) become writable inputs where possible.
For Synaxis, the hub reads available plant values through Synaxis bus/plant-port
style access and presents compatible values to CC or to Synaxis ports.
Log Output Assistant
The Log Output Assistant is a Synaxis input board that writes signal values to
CSV.
It supports up to 10 columns. Each column creates one Synaxis input port and can
be configured as real or boolean. Empty, never-activated inputs are written
as null unless empty rows are skipped.
Main options:
- log name / output file
- row id: tick, row number, or none
- write mode: every tick, on value change, or every N ticks
- create mode: immediately, on any input, or on one selected input
- skip or write fully empty rows
- import existing CSV files from the safe output folder
CSV files are written inside the current save under:
ccsconnector_outputs/
On servers, file selection is intentionally limited to this output folder. The
client import flow also only scans the client's own ccsconnector_outputs
folder and uploads the selected CSV content to the server.
Basic Usage
- Place one of the connector boards.
- Empty-hand right-click the board to open its UI.
- Configure the bridge, hub, or log columns you want.
- Use Synaxis wiring tools to connect the visible ports.
- Attach or place a CC computer next to the block when CC access is needed.
- Use Lua peripheral calls to read or write the configured values.
CC Lua API
Bridge Peripheral
Peripheral type:
cc_synaxis_bridge
Methods:
list()
schema()
info(name)
addBridge([name], type, direction)
removeBridge(name)
get(name)
set(name, value)
lastWriteTick(name)
getSaveLastValue(name)
setSaveLastValue(name, enabled)
toggleSaveLastValue(name)
Example:
local bridge = peripheral.find("cc_synaxis_bridge")
assert(bridge, "Bridge not found")
bridge.addBridge("target_speed", "real", "cc_to_synaxis")
local value = 0
while true do
bridge.set("target_speed", value)
value = value + 1
sleep(1)
end
Super Hub Peripheral
Peripheral type:
cc_synaxis_super_hub
Methods:
list()
schema()
get(name)
getAll()
refresh()
lastUpdateTick(name)
listSynaxis()
getSynaxis(name)
getAllSynaxis()
synaxisLastUpdateTick(name)
listCcCandidates()
listExposedCc()
getCc(name)
getAllCc()
expose(...)
toggleExpose(...)
set(name, value)
write(name, value)
listProvidedToSynaxis()
Exposure is configured in the Super Hub UI. Lua can read configured values and
write to configured writable entries, but it does not create UI exposure rows.
The expose and toggleExpose entries are reserved compatibility methods and
will direct players to configure exposure in the UI.
Example:
local hub = peripheral.find("cc_synaxis_super_hub")
assert(hub, "Super Hub not found")
hub.refresh()
for name, value in pairs(hub.getAll()) do
print(name, value)
end
Notes And Limitations
- Synaxis-facing ports currently support
real and boolean values.
- Text/string values are not exposed as Synaxis ports unless Synaxis provides a
compatible signal type.
- Not every CC peripheral method can be safely called without arguments. The
Super Hub focuses on simple getter/setter-style methods.
- CC and Synaxis may update at different rates. Connector blocks cache values so
either side can read at its own timing.
- Configure Synaxis wires with the normal Synaxis tools. Empty-hand right-click
opens connector UIs.
Modpack Permission
You may include CC Synaxis Connector in modpacks, provided that all required
dependencies are obtained and distributed according to their own licenses and
permissions.
License
This repository is licensed under the MIT License for this project's original
compatibility-layer code and assets only. See LICENSE.
CC: Tweaked, Synaxis, Sable, LDLib, Create, Flywheel, NeoForge, Minecraft, and
related names, APIs, trademarks, source code, binaries, models, textures, and
documentation belong to their respective owners and remain under their upstream
terms.
CC Synaxis Connector is an independently created, AI-assisted compatibility mod.
It is not affiliated with, endorsed by, or sponsored by the authors of CC:
Tweaked, Synaxis, Sable, LDLib, Create, NeoForge, Minecraft, or Mojang/Microsoft.
See THIRD_PARTY_NOTICES.md for dependency and
rights-holder notes.
Development Notes
Most dependencies are resolved from Maven by Gradle. The local libs/ directory
is only for dependencies that are not currently resolved from a public Maven in
this project:
synaxis-1.3.4.jar
sable-schematic-api-0.2.6.jar
libs/*.jar is ignored by Git, so dependency jars should not be committed.
Compatibility fallback for CC:T generic peripherals is isolated in
CcTweakedInternals to keep non-public CC:T access easy to audit or remove if
upstream APIs change.
Synaxis plant access goes through registered PlantEndpointProvider ports and
PlantPortProviders.tryCreate.
评论 0
登录后参与评分
还没有评论,来抢沙发吧