Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,20 @@ name: Build on Main Branch
on:
pull_request:
types: [ closed ]
branches: [ main, master ]
branches:
- master
- main
push:
branches:
- master
- main
workflow_dispatch:
jobs:
build:
if: |
github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.merged == true)
github.event_name == 'push'
|| (github.event_name == 'pull_request' && github.event.pull_request.merged == true)
|| github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploy Docs to GitHub Pages
on:
push:
branches:
- "**"
- "master"
paths:
- ".github/workflows/deploy-docs.yml"
- "docs/**"
Expand Down Expand Up @@ -175,7 +175,7 @@ jobs:
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>RegistryLib Wiki Versions</title>
<title>BreakdownKernel Wiki Versions</title>
<style>
:root {{
color-scheme: light;
Expand Down Expand Up @@ -289,9 +289,9 @@ jobs:
<main>
<section class="hero" aria-labelledby="page-title">
<div>
<p class="eyebrow">RegistryLib Wiki</p>
<p class="eyebrow">BreakdownKernel Wiki</p>
<h1 id="page-title">Version Directory</h1>
<p class="summary">Choose the wiki that matches the RegistryLib branch or release line you are using. Each entry shows when that version was last published.</p>
<p class="summary">Choose the wiki that matches the BreakdownKernel branch or release line you are using. Each entry shows when that version was last published.</p>
</div>
<p class="generated"><span>Directory refreshed</span><strong>{escape(generated)}</strong></p>
</section>
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.gradle
.kotlin
.idea
**/build/
!**/src/**/build/
Expand All @@ -25,3 +26,7 @@ src/generated/
/logs/

run

graphify-out/
**/*-debug.jar
**/*-sources.jar
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

43 changes: 43 additions & 0 deletions .graphifyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Graphify Ignore

# IDE & editor

**/.vscode/
**/.idea/
.project
.classpath

# Secrets

**/secrets/

# CI/CD

.github/

# Build & caches (covers both root and BreaLib submodule)

build/
.gradle/
.kotlin/
**/build/
**/.gradle/
**/.kotlin/

# Runtime data

run/
**/run/

# Generated code

src/generated/
**/src/generated/

# Docs & website (non-code, rendered to pages)

website/

# Graphify self-output

graphify-out/
1 change: 0 additions & 1 deletion BreaLib
Submodule BreaLib deleted from a9553a
16 changes: 14 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ allprojects {
group = 'net.phasetranscrystal'
}

version = mod_version
def buildDate = new Date()
def dynamicVersion = "${String.format('%ty', buildDate)}.${buildDate.month + 1}.${buildDate.date}"
ext.mod_version = dynamicVersion
version = dynamicVersion
group = mod_group_id

tasks.named('wrapper', Wrapper).configure {
Expand Down Expand Up @@ -71,7 +74,16 @@ publishing {
}
repositories {
maven {
url "file://${project.projectDir}/repo"
name = "reposilite"
// 根据版本类型选择 URL
def releasesRepoUrl = 'https://maven.nilarea.cn/releases'
def snapshotsRepoUrl = 'https://maven.nilarea.cn/snapshots'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
// 认证信息在此配置
credentials {
username = project.findProperty('reposiliteUsername')
password = project.findProperty('reposilitePassword')
}
}
}
}
Expand Down
31 changes: 27 additions & 4 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,32 @@
dependencies {
implementation "net.neoforged:neoforge:${neo_version}"

jarJar(api("dev:registrate:1.5.0-beta"))
jarJar(api(project(":BreaLib")))
implementation("dev:ldlib2-neoforge:26.1.0.0-alpha-26.0.0")
// Kt依赖
implementation('org.jetbrains.kotlin:kotlin-stdlib:2.3.0')
implementation("org.jetbrains.kotlin:kotlin-reflect:2.3.0")
// Jar内嵌
if (findProperty('devBuild') == "true") {
implementation("net.phasetranscrystal:brealib:${brealib_version}-debug")
implementation("net.phasetranscrystal:RegistryLib:${registry_lib_version}")
implementation("com.lowdragmc.ldlib2:ldlib2-neoforge-26.1:${ldlib2_version}")
} else {
jarJar(api("net.phasetranscrystal:brealib:${brealib_version}"))
jarJar(api("net.phasetranscrystal:RegistryLib:${registry_lib_version}"))
jarJar(api("com.lowdragmc.ldlib2:ldlib2-neoforge-26.1:${ldlib2_version}"))
}
// 编译时
compileOnly("dev.vfyjxf:taffy:1.1.4")// Source: https://mvnrepository.com/artifact/dev.vfyjxf/taffy
compileOnly("org.appliedenergistics:appliedenergistics2:${ae2_version}:api")
compileOnly("top.theillusivec4.curios:curios-neoforge:${curios_version}+26.1.2:api")
compileOnly("mezz.jei:jei-26.1.2-neoforge-api:${jei_version}")
//
implementation("curse.maven:jade-324717:8068368")
implementation("dev.toma.configuration:configuration-neoforge:${configuration_version}+26.1.2")
// 运行时
runtimeOnly("org.appliedenergistics:guideme:${guideme_version}")
runtimeOnly("org.appliedenergistics:appliedenergistics2:${ae2_version}")
runtimeOnly("top.theillusivec4.curios:curios-neoforge:${curios_version}+26.1.2")
runtimeOnly("mezz.jei:jei-26.1.2-neoforge:${jei_version}")
// runtimeOnly("icyllis.modernui:ModernUI-NeoForge:26.1.2-${modern_ui_version}")

// JUnit 5
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.0'
Expand Down
62 changes: 62 additions & 0 deletions docs/api-reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
sidebar_position: 6
---

# API 参考

BreakdownKernel 为 DLC 模组提供稳定的核心 API。以下为各模块公开接口速查。

## 模块总览

| 模块 | 包路径 | 用途 |
|---------|------------------------------|-----------------------------|
| 材料系统 | `breacore.api.material` | 材料定义、元素、属性、变体 |
| 机器系统 | `breacore.api.machine` | 机器定义、MetaMachine、特性 |
| DLC 扩展 | `breacore.api.addon` | @BreaAddon 注解、IBreaAddon 接口 |
| 注册系统 | `breacore.api.registry` | BreaRegistry、Registrate 扩展 |
| Perk 系统 | `breacore.api.perk` | 实体加成、属性修改器 |
| 事件分发 | `breacore.api.eventdispatch` | 实体事件分发器 |
| 能量系统 | `breacore.api.energy` | 相变能量(规划中) |
| 世界生成 | `breacore.api.worldgen` | 矿石/结构生成(规划中) |

## 核心常量

定义在 `BreaApi` 中:

| 常量 | 值 | 说明 |
|-----|-----------|---------------|
| `M` | 3,628,800 | 一单位材料的标准物质量 |
| `L` | 144 | 每材料单位的流体量(mB) |

## DLC 入口

```java

@BreaAddon("your_mod_id")
public class YourDLC implements IBreaAddon {
// getRegistrate() / initComplete() / addElement() / addMaterial() / addMaterialVariant()
}
```

## 材料 API

参见 [通用材料系统](material/index.md)。

核心类:`Material`、`Element`、`MaterialAttribute`、`MaterialVariant`、`RegisterCondition`、`RegisterAction`。

## 机器 API

参见 [机器与多方块系统](multiblock.md)。

核心类:`MachineDefinition`、`MetaMachine`、`MachineTrait`、`IMachineFeature`。

## 数据附件

通过 `IMachineBlockEntity` 的 `MultiManagedStorage` 实现方块实体的自定义数据同步,支持 `@DescSynced`(客户端同步)和
`@Persisted`(持久化)注解。

## 相关页面

- [快速开始](quick-start.md)
- [通用材料系统](material/index.md)
- [机器与多方块系统](multiblock.md)
36 changes: 27 additions & 9 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,23 @@ sidebar_position: 1
## 快速开始

```groovy
repositories {
maven { url = 'https://maven.nilarea.cn/releases' }
}
// build.gradle
dependencies {
implementation "com.phasetranscrystal:breakdownkernel:0.1.0"
implementation("net.phasetranscrystal:BreakdownKernal:0.1.0")
}
```

```java
// 定义一个材料
Material aluminium = new Material.Builder("aluminium")
.ingot() // 标记为锭材料
.fluid() // 标记为流体材料
.color(0x7db9d8)
.element(Element.AL)
.build();
.ingot() // 标记为锭材料
.fluid() // 标记为流体材料
.color(0x7db9d8)
.element(Element.AL)
.build();
```

材料注册后,会自动生成:
Expand All @@ -41,13 +44,28 @@ Material aluminium = new Material.Builder("aluminium")

## 模块

| 模块 | 说明 |
|------|------|
| 模块 | 说明 |
|-----------------------------|-------------------------------------------------------|
| [通用材料系统](material/index.md) | Material / MaterialAttribute / MaterialVariant 核心 API |
| BreaLib | 日志、环境检测、线程安全等基础工具库 |
| [机器与多方块系统](multiblock.md) | MachineDefinition / MetaMachine / MachineTrait |
| [相变能量系统](phase-energy.md) | 统一能量单位 PE,能量网络与传输 |
| [世界生成](world-gen.md) | 异步矿石/结构生成与 Biome Modifier |
| BreaLib | 日志、环境检测、线程安全等基础工具库 |

## 进行中任务

- [x] [通用材料系统](material/index.md)
- [x] [机器系统](multiblock.md)
- [ ] 配方系统
- [ ] [能量系统](phase-energy.md)
- [ ] [世界生成](world-gen.md)
- [ ] 多方块结构

## 文档导航

- [快速开始](quick-start.md) — DLC 开发环境搭建与入门
- [通用材料系统](material/index.md) — 材料定义与自动生成
- [机器与多方块系统](multiblock.md) — 机器定义与特性
- [相变能量系统](phase-energy.md) — 能量 API 设计
- [世界生成](world-gen.md) — 矿石与结构生成
- [API 参考](api-reference.md) — 接口速查
Loading
Loading