Nodeflow
A library for graph based programming interfaces in minecraft on the fabric modloader
截图
介绍
Nodeflow
Nodeflow is a library for graph based programming interfaces in minecraft on the fabric modloader.
Getting Started
Add a dependency on the library from jitpack. You can also use the modrinth maven,
but you might end having to manually add a dependency on mixin extras then.
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.mattidragon:nodeflow:$nodeflow_version'
}
To get started you will want to create a GraphEnvironment. Most mods will only ever need one, but if the available nodes change, feel free to create one every time.
public static final GraphEnvironment ENVIRONMENT = GraphEnvironment.builder()
// Adds context that nodes need to execute. Stays same during each evaluation
.addContextTypes(ContextType.SERVER_WORLD, ContextType.BLOCK_POS, ContextType.SERVER)
// Datatypes that are allowed to be used. Exists for nodes that can act on any data type to know which ones are allowed
.addDataTypes(DataType.BOOLEAN, DataType.NUMBER, DataType.STRING)
// Adds groups of nodes at a time. They are also used for grouping in the editor.
.addNodeGroups(new TagNodeGroup(NodeGroup.MATH), new TagNodeGroup(NodeGroup.ADVANCED_MATH), new TagNodeGroup(NodeGroup.LOGIC), new TagNodeGroup(ModNodeTypes.REDSTONE_GROUP))
// Adds single nodes. They will be placed in a misc group.
.addNodeTypes(NodeType.TIME)
.build();
Using this environment you can create a EditorScreen, although you usually don’t have any use for the base class.
If you are using a block entity for holding your code you can make it implement GraphProvidingBlockEntity in addition to extending BlockEntity.
This interface already implements ExtendedScreenHandlerFactory so all you have to do is open the screen from the block entity.
Nodeflow will handle syncing the graph on change.
If you aren’t storing the graph in a block you can create a subclass of EditorScreen and handle syncing yourself (or not if you are fully client sided).
Proper javadocs and a wiki might come in the future.
常见问题
Nodeflow 支持哪些 Minecraft 版本?
Nodeflow 支持 Minecraft Java 版 1.20.2–26.1.2,共 7 个版本,可用的加载器:Fabric / Quilt。下载时注意选择和你游戏版本一致的文件。
Nodeflow 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric / Quilt,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:客户端 / 服务端。
MattiDragon 的其他作品
查看全部 →Extended Drawers
添加储物抽屉等内容
Extended Drawers
Adds drawers and more
Fabricae Ex Nihilo
Fabricate From Nothing
Fabricae Ex Nihilo
Fabricate From Nothing
评论
登录后评论和评分