From 69f469f533d8022c1ac9975337ae61253a8bcb61 Mon Sep 17 00:00:00 2001 From: MrlingXD <90316914+wling-art@users.noreply.github.com> Date: Sun, 14 Dec 2025 22:06:48 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E2=9C=A8=20=E5=AE=9E=E7=8E=B0=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=A0=91=20=E4=BB=BF=E7=85=A7=20https://github.com/Pa?= =?UTF-8?q?perMC/docs/blob/5fef1d92b5d7a4744800cfdda2a13ce596451022/src/co?= =?UTF-8?q?mponents/config/ConfigurationStructureDiagram.tsx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...mina-plugins.md => levilamina-plugins.mdx} | 11 +- ...-structure.md => server-dir-structure.mdx} | 36 +- .../start/basic/server-file-structure.md | 106 --- .../start/basic/server-file-structure.mdx | 89 ++ .../upgrade/extended/{fix.md => fix.mdx} | 11 +- .../process/plugin/more/plugin-build/first.md | 181 ---- .../plugin/more/plugin-build/first.mdx | 130 +++ ...-structure.md => server-dir-structure.mdx} | 75 +- docs-java/start/basic/what-is-datapack.md | 209 ----- docs-java/start/basic/what-is-datapack.mdx | 53 ++ ...istribution.md => client-distribution.mdx} | 12 +- .../{configuration.md => configuration.mdx} | 18 +- package.json | 1 + pnpm-lock.yaml | 13 + src/components/StructureExplorer.tsx | 160 ++++ src/css/base/theme.css | 10 + src/css/structure_explorer.css | 169 ++++ src/data/structures/bdsServerStructure.ts | 124 +++ src/data/structures/datapackStructure.ts | 854 ++++++++++++++++++ .../structures/geyserExtensionStructure.ts | 34 + src/data/structures/gradleProjectStructure.ts | 166 ++++ src/data/structures/hmclModpackStructure.ts | 32 + src/data/structures/index.ts | 11 + .../structures/levilamnaPluginStructure.ts | 28 + src/data/structures/mavenProjectStructure.ts | 123 +++ src/data/structures/nukitServerStructure.ts | 104 +++ src/data/structures/serverDirStructureData.ts | 222 +++++ src/data/structures/viaproxyStructure.ts | 61 ++ src/types/ExplorerNode.ts | 8 + tsconfig.json | 1 + 30 files changed, 2442 insertions(+), 610 deletions(-) rename docs-bedrock/bds/process/levilamina/{levilamina-plugins.md => levilamina-plugins.mdx} (83%) rename docs-bedrock/bds/start/basic/{server-dir-structure.md => server-dir-structure.mdx} (78%) delete mode 100644 docs-bedrock/nukkit/start/basic/server-file-structure.md create mode 100644 docs-bedrock/nukkit/start/basic/server-file-structure.mdx rename docs-java/process/mobile-player/geyser/upgrade/extended/{fix.md => fix.mdx} (96%) delete mode 100644 docs-java/process/plugin/more/plugin-build/first.md create mode 100644 docs-java/process/plugin/more/plugin-build/first.mdx rename docs-java/start/basic/{server-dir-structure.md => server-dir-structure.mdx} (62%) delete mode 100644 docs-java/start/basic/what-is-datapack.md create mode 100644 docs-java/start/basic/what-is-datapack.mdx rename docs/advance/management/player-management/{client-distribution.md => client-distribution.mdx} (98%) rename docs/advance/viaproxy/{configuration.md => configuration.mdx} (92%) create mode 100644 src/components/StructureExplorer.tsx create mode 100644 src/css/structure_explorer.css create mode 100644 src/data/structures/bdsServerStructure.ts create mode 100644 src/data/structures/datapackStructure.ts create mode 100644 src/data/structures/geyserExtensionStructure.ts create mode 100644 src/data/structures/gradleProjectStructure.ts create mode 100644 src/data/structures/hmclModpackStructure.ts create mode 100644 src/data/structures/index.ts create mode 100644 src/data/structures/levilamnaPluginStructure.ts create mode 100644 src/data/structures/mavenProjectStructure.ts create mode 100644 src/data/structures/nukitServerStructure.ts create mode 100644 src/data/structures/serverDirStructureData.ts create mode 100644 src/data/structures/viaproxyStructure.ts create mode 100644 src/types/ExplorerNode.ts diff --git a/docs-bedrock/bds/process/levilamina/levilamina-plugins.md b/docs-bedrock/bds/process/levilamina/levilamina-plugins.mdx similarity index 83% rename from docs-bedrock/bds/process/levilamina/levilamina-plugins.md rename to docs-bedrock/bds/process/levilamina/levilamina-plugins.mdx index 382edaeec..3a16bb1e7 100644 --- a/docs-bedrock/bds/process/levilamina/levilamina-plugins.md +++ b/docs-bedrock/bds/process/levilamina/levilamina-plugins.mdx @@ -3,19 +3,16 @@ title: 插件安装教程 sidebar_position: 1 --- +import StructureExplorer from "@site/src/components/StructureExplorer"; +import { levilamnaPluginStructure } from "@site/src/data/structures"; + # 插件安装教程 ## 插件的结构 LeviLamina 的插件是以文件夹的格式存在的。通常插件文件夹中包含以下内容: - -```c -插件文件夹 -├─manifest.json // 插件元数据文件,该文件必须存在并格式正确才能被 LeviLamina 识别 -├─(插件配置文件和数据库)... // 插件生成的配置文件和数据库等,大多数插件的配置文件名叫 config.json,并以一个文件夹或一个 .db 或 .json 后缀文件作为数据库 -├─(插件代码或二进制文件)... // 插件源代码,通常是 .js、.lua、.dll 后缀的文件。不要删除,修改或重命名文件,否则可能导致插件无法运行! -``` + 通常情况下,你不需要手动修改 `manifest.json` 这个文件,因为插件作者会将它事先配置好。如果有特殊插件需要手动配置这个文件,该插件文档应该会给出相应教程。 diff --git a/docs-bedrock/bds/start/basic/server-dir-structure.md b/docs-bedrock/bds/start/basic/server-dir-structure.mdx similarity index 78% rename from docs-bedrock/bds/start/basic/server-dir-structure.md rename to docs-bedrock/bds/start/basic/server-dir-structure.mdx index 6e449ae1b..e794aa591 100644 --- a/docs-bedrock/bds/start/basic/server-dir-structure.md +++ b/docs-bedrock/bds/start/basic/server-dir-structure.mdx @@ -3,42 +3,20 @@ title: 服务端结构 sidebar_position: 1 --- +import StructureExplorer from "@site/src/components/StructureExplorer"; +import { bdsServerStructure } from "@site/src/data/structures"; + # 服务端结构 我们先来简单看一眼 BDS **开服后** 的文件夹结构: - -```c -BDS服务端文件夹 -├─behavior_packs // 安装新行为包的文件夹 -├─config // 没啥用 -├─definitions // 貌似是生成群系的内容 -├─development_behavior_packs // 为开发者提供安装新行为包的文件夹 -├─development_resource_packs // 为开发者提供安装新资源包的文件夹 -├─development_skin_packs // 为开发者提供安装新皮肤包的文件夹 -├─resource_packs // 安装新资源包的文件夹 -├─world-templates // 世界模板 -├─worlds // 主世界文件夹 -│ └─Bedrock level // 世界存档 -│ ├─db // 存档数据文件夹 -│ ├─level_dat // 存档设定 -│ ├─level.dat_old // 存档设定 (旧) -│ └─level_name.txt // 存档名称 -├─allowlist.json // 白名单文件 -├─bedrock_server.exe // 服务端启动程序 -├─bedrock_server.pdb // 程序数据库文件 -├─bedrock_server_how_to.html // 如何使用 BDS 服务器的官方指南 (没多大用处,看看就行) -├─permissions.json // 管理员 (OP) 玩家相关数据 -├─release-notes.txt // 服务端发行版本详情 -├─server.properties // 配置文件 -└─valid_known_packs.json // 已知的附加包 -``` - - +::: */} ## 根目录下的一些文件 diff --git a/docs-bedrock/nukkit/start/basic/server-file-structure.md b/docs-bedrock/nukkit/start/basic/server-file-structure.md deleted file mode 100644 index c986cca55..000000000 --- a/docs-bedrock/nukkit/start/basic/server-file-structure.md +++ /dev/null @@ -1,106 +0,0 @@ ---- -title: 服务端结构 -sidebar_position: 1 ---- - -# 服务端结构 - -我们先来简单看一眼 Nukkit **开服后** 的文件夹结构(大致结构是这样,部分分支会因为加了不同的功能结构会不一样): - - -```c -Nukkit Server/ -├── nukkit-1.0-SNAPSHOT.jar //服务器核心 -├── start.bat // Windows 运行脚本 -├── start.sh // Linux 运行脚本 -├── start.command // macOS 运行脚本 -├── server.properties // 服务端配置文件 -├── permissions.yml // 用于设置玩家权限的 -├── banned-players.txt // 存储被封禁的玩家名单的 -├── banned-ips.txt // 存储被封禁的 IP 地址 -├── ops.txt // 用于设置管理员(OP)的 -├── worlds/ // 主世界文件夹 -│ ├── world/ // 世界存档 -│ │ ├── level.dat // 存档设定 -│ │ ├── region/ // 存储世界区块数据 -│ │ └── entities/ // 存储世界中的实体数据 -├── plugins/ // 插件存放文件夹 -├── logs/ // 服务器日志存放 -├── whitelist.txt // 存储允许加入服务器的玩家名单 -└── rcon_password.txt // 存储 RCON(远程控制)功能的密码 -``` - - - -## 根目录下的一些文件 - ---- - -- `nukkit-1.0-SNAPSHOT.jar` - - 这是 Nukkit 的核心程序文件,用于启动和运行服务端。 - ---- - -- `start.bat / start.sh / start.command` - - 启动服务器的脚本文件,分别对应 Windows、Linux 和 macOS 系统,用于启动和运行《我的世界》基岩版服务器。 - - - 你可以改名叫任何名字 (只要以 `.bat / .sh / .command` 结尾就行),但不建议你这么做,可能会导致成为后续操作报错的因素。例如: - 1. 若你使用 **面板** 开服,需要在对应的 **启动路径** 中修改服务端启动程序的文件名 - 2. 若你使用 **启用脚本** 开服,需要在脚本对应位置的 **启动命令** 中修改 **启动程序的文件名** 为 **该服务端启动程序的文件名** - ---- - -- `server.properties` - - 这是服务器的主要配置文件,用于设置服务器的各种参数,如服务器名称、端口号、最大玩家数、游戏模式等。 - ---- - -- `permissions.yml` - - 用于设置玩家权限的文件,可以定义不同用户组的权限。 - ---- - -- `banned-players.txt 和 banned-ips.txt` - - 分别用于存储被封禁的玩家名单和 IP 地址。 - ---- - -- `worlds` - - 这是存储主世界文件夹的地方。每个世界都有自己的子文件夹,其中包含该世界的所有数据,如地形、建筑、玩家进度等。 - - `world` - - 包含特定世界的存档数据。 - - `level_dat` - - 世界的基本信息文件。 - - `region 文件夹` - - 存储世界区块数据。 - - `entities 文件夹` - - 存储世界中的实体数据。 - ---- - -- `plugins 文件夹` - - 用于存放所有插件的 .jar 文件。插件可以扩展服务器的功能,例如添加新的命令、游戏规则或事件处理。 - ---- - -- `whitelist.txt` - - 白名单文件,列出了允许进入服务器的玩家列表。 - - (如果你在 `server.properties` 中开启了白名单,你就可以在该文件中添加和管理谁被允许或不被允许进入服务器)。 - ---- - -- `logs 文件夹` - - 存储服务器运行时生成的日志文件,用于记录服务器的运行状态和玩家行为。 - ---- - -- `rcon_password.txt` - - 用于存储 RCON(远程控制)功能的密码。 - ---- - -至此,大部分的以 Nukkit 为基础的服务器核心服务端的结构已经大致呈现在你眼前。 diff --git a/docs-bedrock/nukkit/start/basic/server-file-structure.mdx b/docs-bedrock/nukkit/start/basic/server-file-structure.mdx new file mode 100644 index 000000000..b5176ad10 --- /dev/null +++ b/docs-bedrock/nukkit/start/basic/server-file-structure.mdx @@ -0,0 +1,89 @@ +--- +title: 服务端结构 +sidebar_position: 1 +--- + +import StructureExplorer from "@site/src/components/StructureExplorer"; +import { nukitServerStructure } from "@site/src/data/structures"; + +# 服务端结构 + +我们先来简单看一眼 Nukkit **开服后** 的文件夹结构(大致结构是这样,部分分支会因为加了不同的功能结构会不一样): + + + +{/* :::info + +对于世界文件夹的详细说明,请前往 **[世界文件架构](what-is-world.md)** + +::: */} + +## 根目录下的一些文件 + +--- + +- `nukkit-1.0-SNAPSHOT.jar` + - 这是 Nukkit 的核心程序文件,用于启动和运行服务端。 + +--- + +- `start.bat / start.sh / start.command` + + - 启动服务器的脚本文件,分别对应 Windows、Linux 和 macOS 系统,用于启动和运行《我的世界》基岩版服务器。 + + - 你可以改名叫任何名字 (只要以 `.bat / .sh / .command` 结尾就行),但不建议你这么做,可能会导致成为后续操作报错的因素。例如: + 1. 若你使用 **面板** 开服,需要在对应的 **启动路径** 中修改服务端启动程序的文件名 + 2. 若你使用 **启用脚本** 开服,需要在脚本对应位置的 **启动命令** 中修改 **启动程序的文件名** 为 **该服务端启动程序的文件名** + +--- + +- `server.properties` + - 这是服务器的主要配置文件,用于设置服务器的各种参数,如服务器名称、端口号、最大玩家数、游戏模式等。 + +--- + +- `permissions.yml` + - 用于设置玩家权限的文件,可以定义不同用户组的权限。 + +--- + +- `banned-players.txt 和 banned-ips.txt` + - 分别用于存储被封禁的玩家名单和 IP 地址。 + +--- + +- `worlds` + - 这是存储主世界文件夹的地方。每个世界都有自己的子文件夹,其中包含该世界的所有数据,如地形、建筑、玩家进度等。 + - `world` + - 包含特定世界的存档数据。 + - `level_dat` + - 世界的基本信息文件。 + - `region 文件夹` + - 存储世界区块数据。 + - `entities 文件夹` + - 存储世界中的实体数据。 + +--- + +- `plugins 文件夹` + - 用于存放所有插件的 .jar 文件。插件可以扩展服务器的功能,例如添加新的命令、游戏规则或事件处理。 + +--- + +- `whitelist.txt` + - 白名单文件,列出了允许进入服务器的玩家列表。 + - (如果你在 `server.properties` 中开启了白名单,你就可以在该文件中添加和管理谁被允许或不被允许进入服务器)。 + +--- + +- `logs 文件夹` + - 存储服务器运行时生成的日志文件,用于记录服务器的运行状态和玩家行为。 + +--- + +- `rcon_password.txt` + - 用于存储 RCON(远程控制)功能的密码。 + +--- + +至此,大部分的以 Nukkit 为基础的服务器核心服务端的结构已经大致呈现在你眼前。 diff --git a/docs-java/process/mobile-player/geyser/upgrade/extended/fix.md b/docs-java/process/mobile-player/geyser/upgrade/extended/fix.mdx similarity index 96% rename from docs-java/process/mobile-player/geyser/upgrade/extended/fix.md rename to docs-java/process/mobile-player/geyser/upgrade/extended/fix.mdx index 42f58dfa7..98e89898c 100644 --- a/docs-java/process/mobile-player/geyser/upgrade/extended/fix.md +++ b/docs-java/process/mobile-player/geyser/upgrade/extended/fix.mdx @@ -3,6 +3,9 @@ title: 游戏机制 sidebar_position: 2 --- +import StructureExplorer from "@site/src/components/StructureExplorer"; +import { geyserExtensionStructure } from "@site/src/data/structures"; + # 游戏机制 目前,你服务器的基岩版玩家可能会遇到一些问题 @@ -158,13 +161,7 @@ Broadcaster 通过模拟 Xbox Live 客户端,将你的 Geyser/基岩版服务 2. **安装扩展** - ```text - 服务器根目录/ - ├── plugins/ - │ └── Geyser-Spigot/ - │ └── extensions/ - │ └── MCXboxBroadcastExtension.jar - ``` + 3. **重启服务器** - 重启服务器以加载扩展 diff --git a/docs-java/process/plugin/more/plugin-build/first.md b/docs-java/process/plugin/more/plugin-build/first.md deleted file mode 100644 index ef69dbb8e..000000000 --- a/docs-java/process/plugin/more/plugin-build/first.md +++ /dev/null @@ -1,181 +0,0 @@ ---- -title: 概述 -sidebar_position: 2 ---- - -# 概述 - -## 什么是构建? - -构建就是将源代码转换成可以运行的插件(jar 文件)的过程。就像把散落的零件组装成一个完整的机器一样。 - -## 选择合适的构建方式 - -根据你的情况,可以选择以下三种方式之一: - -1. **使用 IDEA(推荐)** - - 适合:新手,不熟悉命令行的用户 - - 优点:图形界面,操作直观 - - 缺点:需要安装 IDEA - -2. **使用终端** - - 适合:熟悉命令行的用户,服务器环境 - - 优点:轻量级,适合自动化 - - 缺点:需要记忆命令 - -3. **使用 GitHub Actions** - - 适合:需要自动化发布的项目 - - 优点:全自动化,不需要本地构建 - - 缺点:需要了解 GitHub 相关知识 - -## 选择构建工具 - -项目可能使用以下两种构建工具之一: - -1. **Maven** - - 特点:配置简单,学习曲线平缓 - - 适合:新手,小型项目 - - 配置文件:`pom.xml` - -2. **Gradle** - - 特点:功能强大,配置灵活 - - 适合:大型项目,需要复杂构建逻辑 - - 配置文件:`build.gradle` 或 `build.gradle.kts` - -## 识别项目类型 - -### 如何识别? - -在项目根目录下查看: - -1. **如果看到 `pom.xml`** - - 这是 Maven 项目 - - 构建产物在 `target` 目录 - - 使用 `mvn` 命令构建 - -2. **如果看到 `build.gradle` 或 `build.gradle.kts`** - - 这是 Gradle 项目 - - 构建产物在 `build/libs` 目录 - - 使用 `gradle` 命令构建 - -3. **如果看到 `gradlew` 或 `gradlew.bat`** - - 这是带有 Gradle Wrapper 的 Gradle 项目 - - 特点: - - 不需要安装 Gradle - - 自动下载正确版本 - - 所有人使用相同版本 - -### 项目结构说明 - -#### Maven 项目结构 - - -```yaml -项目根目录 -├── src/ # 源代码目录 -│ ├── main/ # 主要代码目录 -│ │ ├── java/ # Java 源代码 -│ │ │ └── com/ -│ │ │ └── example/ -│ │ │ └── plugin/ -│ │ │ ├── Main.java # 插件主类 -│ │ │ ├── commands/ # 命令类 -│ │ │ ├── listeners/ # 监听器类 -│ │ │ └── utils/ # 工具类 -│ │ └── resources/ # 资源文件目录 -│ │ ├── plugin.yml # 插件配置文件 -│ │ ├── config.yml # 插件默认配置 -│ │ └── messages/ # 语言文件 -│ └── test/ # 测试代码目录 -│ ├── java/ # 测试源代码 -│ └── resources/ # 测试资源 -├── target/ # 构建输出目录 -├── pom.xml # Maven 项目配置文件 -└── README.md # 项目说明文件 -``` - -#### Gradle 项目结构 - - -```yaml -项目根目录 -├── src/ # 源代码目录 -│ ├── main/ # 主要代码目录 -│ │ ├── java/ # Java 源代码 -│ │ │ └── com/ -│ │ │ └── example/ -│ │ │ └── plugin/ -│ │ │ ├── Main.java # 插件主类 -│ │ │ ├── commands/ # 命令类 -│ │ │ ├── listeners/ # 监听器类 -│ │ │ └── utils/ # 工具类 -│ │ ├── kotlin/ # Kotlin 源代码(如果使用) -│ │ └── resources/ # 资源文件目录 -│ │ ├── plugin.yml # 插件配置文件 -│ │ ├── config.yml # 插件默认配置 -│ │ └── messages/ # 语言文件 -│ └── test/ # 测试代码目录 -│ ├── java/ # 测试源代码 -│ ├── kotlin/ # Kotlin 测试代码 -│ └── resources/ # 测试资源 -├── build/ # 构建输出目录 -│ └── libs/ # 构建产物(jar 文件) -├── gradle/ # Gradle 包装器目录 -│ └── wrapper/ -├── build.gradle # Gradle 构建脚本 -├── settings.gradle # Gradle 设置文件 -├── gradlew # Gradle 包装器脚本 (Unix) -├── gradlew.bat # Gradle 包装器脚本 (Windows) -└── README.md # 项目说明文件 -``` - -### 重要文件说明 - -#### 1. 配置文件 - -- **plugin.yml**:插件的核心配置文件 - - ```yaml - name: MyPlugin # 插件名称 - version: 1.0.0 # 插件版本 - main: com.example.plugin.Main # 主类路径 - api-version: "1.19" # API 版本 - commands: # 命令配置 - mycmd: - description: 示例命令 - usage: /mycmd <参数> - ``` - -- **config.yml**:插件的默认配置文件 - - ```yaml - settings: - debug: false - language: zh_CN - features: - feature1: true - feature2: false - ``` - -#### 2. 构建配置文件 - -- **Maven (pom.xml)**: - - ```xml - - - io.papermc.paper - paper-api - 1.19.4-R0.1-SNAPSHOT - provided - - - ``` - -- **Gradle (build.gradle)**: - - ```groovy - dependencies { - compileOnly 'io.papermc.paper:paper-api:1.19.4-R0.1-SNAPSHOT' - } - ``` diff --git a/docs-java/process/plugin/more/plugin-build/first.mdx b/docs-java/process/plugin/more/plugin-build/first.mdx new file mode 100644 index 000000000..790677855 --- /dev/null +++ b/docs-java/process/plugin/more/plugin-build/first.mdx @@ -0,0 +1,130 @@ +--- +title: 概述 +sidebar_position: 2 +--- + +import StructureExplorer from "@site/src/components/StructureExplorer"; +import { mavenProjectStructure, gradleProjectStructure } from "@site/src/data/structures"; + +# 概述 + +## 什么是构建? + +构建就是将源代码转换成可以运行的插件(jar 文件)的过程。就像把散落的零件组装成一个完整的机器一样。 + +## 选择合适的构建方式 + +根据你的情况,可以选择以下三种方式之一: + +1. **使用 IDEA(推荐)** + - 适合:新手,不熟悉命令行的用户 + - 优点:图形界面,操作直观 + - 缺点:需要安装 IDEA + +2. **使用终端** + - 适合:熟悉命令行的用户,服务器环境 + - 优点:轻量级,适合自动化 + - 缺点:需要记忆命令 + +3. **使用 GitHub Actions** + - 适合:需要自动化发布的项目 + - 优点:全自动化,不需要本地构建 + - 缺点:需要了解 GitHub 相关知识 + +## 选择构建工具 + +项目可能使用以下两种构建工具之一: + +1. **Maven** + - 特点:配置简单,学习曲线平缓 + - 适合:新手,小型项目 + - 配置文件:`pom.xml` + +2. **Gradle** + - 特点:功能强大,配置灵活 + - 适合:大型项目,需要复杂构建逻辑 + - 配置文件:`build.gradle` 或 `build.gradle.kts` + +## 识别项目类型 + +### 如何识别? + +在项目根目录下查看: + +1. **如果看到 `pom.xml`** + - 这是 Maven 项目 + - 构建产物在 `target` 目录 + - 使用 `mvn` 命令构建 + +2. **如果看到 `build.gradle` 或 `build.gradle.kts`** + - 这是 Gradle 项目 + - 构建产物在 `build/libs` 目录 + - 使用 `gradle` 命令构建 + +3. **如果看到 `gradlew` 或 `gradlew.bat`** + - 这是带有 Gradle Wrapper 的 Gradle 项目 + - 特点: + - 不需要安装 Gradle + - 自动下载正确版本 + - 所有人使用相同版本 + +### 项目结构说明 + +#### Maven 项目结构 + + + +#### Gradle 项目结构 + + + +### 重要文件说明 + +#### 1. 配置文件 + +- **plugin.yml**:插件的核心配置文件 + + ```yaml + name: MyPlugin # 插件名称 + version: 1.0.0 # 插件版本 + main: com.example.plugin.Main # 主类路径 + api-version: "1.19" # API 版本 + commands: # 命令配置 + mycmd: + description: 示例命令 + usage: /mycmd <参数> + ``` + +- **config.yml**:插件的默认配置文件 + + ```yaml + settings: + debug: false + language: zh_CN + features: + feature1: true + feature2: false + ``` + +#### 2. 构建配置文件 + +- **Maven (pom.xml)**: + + ```xml + + + io.papermc.paper + paper-api + 1.19.4-R0.1-SNAPSHOT + provided + + + ``` + +- **Gradle (build.gradle)**: + + ```groovy + dependencies { + compileOnly 'io.papermc.paper:paper-api:1.19.4-R0.1-SNAPSHOT' + } + ``` diff --git a/docs-java/start/basic/server-dir-structure.md b/docs-java/start/basic/server-dir-structure.mdx similarity index 62% rename from docs-java/start/basic/server-dir-structure.md rename to docs-java/start/basic/server-dir-structure.mdx index 4d568766f..9ec91e4c1 100644 --- a/docs-java/start/basic/server-dir-structure.md +++ b/docs-java/start/basic/server-dir-structure.mdx @@ -3,43 +3,20 @@ title: 服务端结构 sidebar_position: 3 --- +import StructureExplorer from "@site/src/components/StructureExplorer"; +import { serverDirStructureData } from "@site/src/data/structures/serverDirStructureData"; + # 服务端结构 我们先来简单看一眼 插件端 的文件夹结构 (以 Purpur 为例): - -```c -├─assets // 储存 Minecraft 音效贴图等重要文件,不要乱动 -├─cache // 缓存文件夹,一般放置 Minecraft 原版服务器 -├─config // Paper fork 服务器特有的配置文件,用于放置 Paper 的配置文件 -├─crash-reports // 存放服务器崩溃的完整报告 -├─libraries // 存放服务器及部分插件的依赖库 -├─logs // 存放服务端日志的文件夹 -├─plugins // 存放插件的文件夹 -├─versions // 存放对应版本需要的依赖 jar -├─world // 主世界文件夹 -│ ├─advancements // 成就文件夹 -│ ├─data // 世界数据文件夹 -│ ├─datapacks // 数据包 -│ │ └─bukkit -│ ├─entities // 实体数据 -│ ├─playerdata // 玩家数据 -│ ├─poi // 兴趣点数据 -│ ├─region // 区块数据 -│ └─stats // 统计信息 -├─world_nether // 地狱世界文件夹 -│ └─DIM-1 -│ ├─data -│ ├─entities -│ ├─poi -│ └─region -└─world_the_end // 末地世界文件夹 - └─DIM1 - ├─data - ├─entities - ├─poi - └─region -``` +:::tip + +将鼠标悬停在 **ⓘ** 图标上查看详细说明! + +::: + + 对于类似 Catserver 的混合服务器,文件夹结构是类似的,基本就多了 `/mods` 文件夹,少了 Bukkit 的下游服务器特有的配置 (如 `purpur.yml` 等)。 @@ -51,67 +28,67 @@ sidebar_position: 3 ## 根目录下的一些文件 -- `.console_history` +- `.console_history` 存放了控制台 (又叫后台) 曾经使用过的指令,方便你使用键盘中的 ↑ 键快捷查找曾使用的指令,也可用于查看后台异常。 -- `banned-ips.json` +- `banned-ips.json` 以 JSON 格式存放的被 ban IP 玩家的 UUID 及游戏名称等相关信息,一旦玩家被 banip,此 IP 将无法再进入服务器。 -- `banned-players.json` +- `banned-players.json` 以 JSON 格式存放了被 ban 玩家的 UUID 及游戏名称等相关信息,离线服 ban 玩家后换 ID 即可进入服务器,而正版服无法通过改名重新进入服务器。 -- `bukkit.yml` +- `bukkit.yml` 由 Bukkit 派生得到的服务端都有的文件。保存着 Bukkit 所提供的最基本的设置选项。 -- `commands.yml` +- `commands.yml` 它提供了一种快速而简单的方法来强制服务器使用 Mojang 提供的命令 (而不是 Bukkit 中内置的命令) 而不产生冲突。 -- `eula.txt` +- `eula.txt` 在首次开服的时候,我们需要同意 EULA 协议。 -- `help.yml` +- `help.yml` 一些插件的帮助信息会出现在这里面,一般不需要进行什么修改。 -- `ops.json` +- `ops.json` 以 JSON 格式存放了 OP 玩家的 UUID 及游戏名称等相关信息。 -- `purpur.jar` +- `purpur.jar` 你可以改名叫任何名字 (只要以 `.jar` 结尾,且在启动脚本中对应修改) -- `purpur.yml` +- `purpur.yml` Purpur 服务器特有的配置文件,极其详细的配置项,功能非常丰富,几乎可以替代数款插件。 -- `permissions.yml` +- `permissions.yml` 是默认的权限定义 YAML 文件,在启动时自动生成。它的主要功能是将权限节点组合到一个文件中,以便权限插件 (以及使用权限的插件) 可以在整个系统中使用它。 -- [`server.properties`](https://minecraft-zh.gamepedia.com/Server.properties) +- [`server.properties`](https://minecraft-zh.gamepedia.com/Server.properties) 服务端的一些基本设置就在里面,如设置端口,设置游戏难度,设置游戏模式 (生存、创造等) 等。 -- `spigot.yml` +- `spigot.yml` Spigot 服务器都有的配置文件。 -- `usercache.json` +- `usercache.json` 储存着用名字及 UUID 信息的缓存文件。 -- `version_history` +- `version_history` 一些 Minecraft 和服务端核心的版本信息,一般记录着曾经使用过的版本。 -- `whitelist.json` +- `whitelist.json` 白名单列表。(如果你在[`server.properties`](https://minecraft-zh.gamepedia.com/Server.properties)中开启了白名单,你就可以在该文件中添加和管理谁被允许或不被允许进入服务器。) diff --git a/docs-java/start/basic/what-is-datapack.md b/docs-java/start/basic/what-is-datapack.md deleted file mode 100644 index f976a646b..000000000 --- a/docs-java/start/basic/what-is-datapack.md +++ /dev/null @@ -1,209 +0,0 @@ ---- -title: 什么是数据包? -sidebar_position: 6 ---- - -# 什么是数据包? - -数据包是从 Minecraft 逻辑结构层面修改我的世界,他可以添加或覆盖游戏中几乎一切的元素。一定程度下可以代替 mod,但它并不会改变原版的内容。 - -其功能可用于覆盖或添加新的函数、进度、战利品表、物品修饰器、配方、结构、标签、维度、世界生成等 - -# 数据包的存放位置 - -数据包是存放于我的世界存档目录下 `world/datapacks` 它既可以是文件夹亦可以是压缩包。当你加入时数据包将为该世界启用。 - -# 数据包注意事项 - -数据包是存在加载顺序的,在数据包各个功能同一个分类下不同的加载顺序会导致不同的结果也就是不同的覆盖产生。 - -这个顺序存储在 `world/level.dat` 。您可以通过单人创建存档时调整数据包的位置决定数据包的加载顺序 - -您可以通过 `/datapack` 查看已经加载或未加载的数据包 - -# 相关资源下载 - -**常见数据包的下载**: - -| 名称 | 介绍 | -| ----------------------------------------------------------------------- | ------------------------------------------------------------ | -| [PlanetMinecraft](https://www.planetminecraft.com/data-packs/) | 比较老牌的我的世界资源网站了,东西比较全 | -| [Modrinth](https://modrinth.com/datapacks) | 新兴的我的世界资源平台,东西比较全 | -| [9Minecraft](https://www.9minecraft.net/category/minecraft-data-packs/) | 比较老牌的我的世界资源网站了,界面不太符合中国习惯,不太推荐 | - -**数据包工具及扩展资源**: - -| 名称 | 介绍 | -| ------------------------------------------------------------- | ----------------------------------- | -| [Datapack Upgrader](https://misode.github.io/upgrader/) | 自动升级数据包版本,未测试 | -| [Datapack Map](https://map.jacobsjo.eu/) | 查看世界生成数据包对应种子的地图 | -| [Datapack Maker](https://misode.github.io/) | 数据包生成器,适用于大部分环境 | -| [vanilla tweaks](https://vanillatweaks.net/picker/datapacks/) | 常用数据包的结合体,可以集成下载 | -| [MCCreator](https://mcreator.net/about) | 生成/制作初级数据包的不二之选,推荐 | - -# 数据包结构 - - -```c -数据包名 -├─pack.mcmeta // 用于识别数据包及存储数据包信息。 -├─pack.png // 数据包的图片 (可选)。 -├─data -│ ├─advancements -│ │ └─特定进度名.json -│ │ ├─display // 进度的显示信息 -│ │ │ ├─title // 进度标题 -│ │ │ ├─description // 进度描述 -│ │ │ ├─icon // 进度图标 -│ │ ├─criteria // 进度达成条件 -│ │ │ └─特定条件名.json -│ │ │ ├─trigger // 触发条件类型 -│ │ │ └─conditions // 具体的条件参数 -│ ├─loot_tables -│ │ └─特定物品或实体的战利品表.json -│ │ ├─pools // 战利品池列表 -│ │ │ └─特定战利品池.json -│ │ │ ├─rolls // 战利品生成次数 -│ │ │ ├─entries // 战利品条目 -│ │ │ │ └─特定条目.json -│ │ │ │ ├─type // 条目类型,如 item、loot_table 等 -│ │ │ │ ├─name // 物品或战利品表名称 -│ │ │ │ └─functions // 可选的函数列表,用于修改战利品 -│ │ │ │ └─特定函数.json -│ │ │ │ ├─function // 函数类型,如 set_nbt、enchant_with_levels 等 -│ │ │ │ └─arguments // 函数参数 -│ ├─recipes -│ │ └─特定合成配方.json -│ │ ├─type // 合成配方类型,如 crafting_shaped、crafting_shapeless 等 -│ │ ├─group // 合成组名 (可选) -│ │ ├─ingredients // 合成所需的材料列表 -│ │ │ └─特定材料.json -│ │ │ ├─item // 物品名称 -│ │ │ └─count // 物品数量 (可选) -│ │ └─result // 合成结果 -│ │ ├─item // 合成后的物品名称 -│ │ └─count // 合成后的物品数量 (可选) -│ ├─tags -│ │ ├─blocks -│ │ │ └─特定方块标签.json -│ │ │ ├─replace // 是否替换已有标签 (可选) -│ │ │ └─values // 方块名称列表 -│ │ ├─fluids -│ │ │ └─特定流体标签.json -│ │ │ ├─replace // 是否替换已有标签 (可选) -│ │ │ └─values // 流体名称列表 -│ │ ├─items -│ │ │ └─特定物品标签.json -│ │ │ ├─replace // 是否替换已有标签 (可选) -│ │ │ └─values // 物品名称列表 -│ │ ├─entity_types -│ │ │ └─特定实体类型标签.json -│ │ │ ├─replace // 是否替换已有标签 (可选) -│ │ │ └─values // 实体类型名称列表 -│ │ ├─functions -│ │ │ └─特定函数标签.json -│ │ │ ├─replace // 是否替换已有标签 (可选) -│ │ │ └─values // 函数名称列表 -│ │ ├─predicates -│ │ │ └─特定谓词标签.json -│ │ │ ├─replace // 是否替换已有标签 (可选) -│ │ │ └─values // 谓词名称列表 -│ │ ├─damage_types -│ │ │ └─特定伤害类型标签.json -│ │ │ ├─replace // 是否替换已有标签 (可选) -│ │ │ └─values // 伤害类型名称列表 -│ │ ├─enchantments -│ │ │ └─特定附魔标签.json -│ │ │ ├─replace // 是否替换已有标签 (可选) -│ │ │ └─values // 附魔名称列表 -│ │ ├─game_events -│ │ │ └─特定游戏事件标签.json -│ │ │ ├─replace // 是否替换已有标签 (可选) -│ │ │ └─values // 游戏事件名称列表 -│ │ └─其他可能的标签类型 -│ │ └─特定标签.json -│ │ ├─replace // 是否替换已有标签 (可选) -│ │ └─values // 对应名称列表 -│ ├─functions -│ │ └─特定函数文件.mcfunction -│ │ ├─各种命令语句 // 可以是游戏中的各种命令,用于实现特定的逻辑 -│ ├─predicates -│ │ └─特定谓词.json -│ │ ├─condition // 谓词条件 -│ │ │ ├─特定条件类型.json -│ │ │ │ └─参数 // 根据条件类型而定 -│ │ └─result // 谓词结果,通常是布尔值 -│ ├─dimension_types -│ │ └─特定维度类型.json -│ │ ├─effects // 维度效果列表 -│ │ │ └─特定效果.json -│ │ │ ├─特定效果类型 // 如 fog_color、ambient_light 等 -│ │ │ └─值 // 根据效果类型而定 -│ │ └─parameters // 维度类型参数 -│ │ └─特定参数.json -│ │ ├─名称 // 参数名称 -│ │ └─值 // 参数值 -│ ├─worldgen -│ │ ├─biome -│ │ │ └─特定生物群系.json -│ │ │ ├─features // 生物群系特征列表 -│ │ │ │ └─特定特征.json -│ │ │ │ ├─特定特征类型 // 如 lake、flower 等 -│ │ │ │ └─参数 // 根据特征类型而定 -│ │ │ ├─properties // 生物群系属性 -│ │ │ │ └─特定属性.json -│ │ │ │ ├─名称 // 属性名称 -│ │ │ │ └─值 // 属性值 -│ │ ├─configured_carver -│ │ │ └─特定雕刻器.json -│ │ │ ├─type // 雕刻器类型 -│ │ │ ├─biomes // 适用的生物群系列表 -│ │ │ └─parameters // 雕刻器参数 -│ │ │ └─特定参数.json -│ │ │ ├─名称 // 参数名称 -│ │ │ └─值 // 参数值 -│ │ ├─configured_feature -│ │ │ └─特定配置特征.json -│ │ │ ├─type // 特征类型 -│ │ │ ├─placement // 放置规则 -│ │ │ │ └─特定放置规则.json -│ │ │ │ ├─规则类型 // 如 height_range、on_ground 等 -│ │ │ │ └─参数 // 根据规则类型而定 -│ │ │ └─parameters // 特征参数 -│ │ │ └─特定参数.json -│ │ │ ├─名称 // 参数名称 -│ │ │ └─值 // 参数值 -│ │ ├─configured_structure_feature -│ │ │ └─特定配置结构特征.json -│ │ │ ├─type // 结构特征类型 -│ │ │ ├─placement // 放置规则 -│ │ │ │ └─特定放置规则.json -│ │ │ │ ├─规则类型 // 如 surface_rule、biome_filter 等 -│ │ │ │ └─参数 // 根据规则类型而定 -│ │ │ └─parameters // 结构特征参数 -│ │ │ └─特定参数.json -│ │ │ ├─名称 // 参数名称 -│ │ │ └─值 // 参数值 -│ │ ├─noise -│ │ │ └─特定噪声设置.json -│ │ │ ├─noise_type // 噪声类型 -│ │ │ ├─parameters // 噪声参数 -│ │ │ │ └─特定参数.json -│ │ │ │ ├─名称 // 参数名称 -│ │ │ │ └─值 // 参数值 -│ │ └─processor_list -│ │ └─特定处理器列表.json -│ │ ├─processors // 处理器列表 -│ │ │ └─特定处理器.json -│ │ │ ├─type // 处理器类型 -│ │ │ └─parameters // 处理器参数 -│ │ │ └─特定参数.json -│ │ │ ├─名称 // 参数名称 -│ │ │ └─值 // 参数值 -│ └─其他可能的子文件夹,具体取决于数据包的功能需求。 - -``` - -# 数据包的编写 - -太多了,详情请参阅 [Minecraft Wiki](https://zh.minecraft.wiki/w/%E6%95%B0%E6%8D%AE%E5%8C%85) diff --git a/docs-java/start/basic/what-is-datapack.mdx b/docs-java/start/basic/what-is-datapack.mdx new file mode 100644 index 000000000..8918aab09 --- /dev/null +++ b/docs-java/start/basic/what-is-datapack.mdx @@ -0,0 +1,53 @@ +--- +title: 什么是数据包? +sidebar_position: 6 +--- + +import StructureExplorer from "@site/src/components/StructureExplorer"; +import { datapackStructure } from "@site/src/data/structures"; + +# 什么是数据包? + +数据包是从 Minecraft 逻辑结构层面修改我的世界,他可以添加或覆盖游戏中几乎一切的元素。一定程度下可以代替 mod,但它并不会改变原版的内容。 + +其功能可用于覆盖或添加新的函数、进度、战利品表、物品修饰器、配方、结构、标签、维度、世界生成等 + +# 数据包的存放位置 + +数据包是存放于我的世界存档目录下 `world/datapacks` 它既可以是文件夹亦可以是压缩包。当你加入时数据包将为该世界启用。 + +# 数据包注意事项 + +数据包是存在加载顺序的,在数据包各个功能同一个分类下不同的加载顺序会导致不同的结果也就是不同的覆盖产生。 + +这个顺序存储在 `world/level.dat` 。您可以通过单人创建存档时调整数据包的位置决定数据包的加载顺序 + +您可以通过 `/datapack` 查看已经加载或未加载的数据包 + +# 相关资源下载 + +**常见数据包的下载**: + +| 名称 | 介绍 | +| ----------------------------------------------------------------------- | ------------------------------------------------------------ | +| [PlanetMinecraft](https://www.planetminecraft.com/data-packs/) | 比较老牌的我的世界资源网站了,东西比较全 | +| [Modrinth](https://modrinth.com/datapacks) | 新兴的我的世界资源平台,东西比较全 | +| [9Minecraft](https://www.9minecraft.net/category/minecraft-data-packs/) | 比较老牌的我的世界资源网站了,界面不太符合中国习惯,不太推荐 | + +**数据包工具及扩展资源**: + +| 名称 | 介绍 | +| ------------------------------------------------------------- | ----------------------------------- | +| [Datapack Upgrader](https://misode.github.io/upgrader/) | 自动升级数据包版本,未测试 | +| [Datapack Map](https://map.jacobsjo.eu/) | 查看世界生成数据包对应种子的地图 | +| [Datapack Maker](https://misode.github.io/) | 数据包生成器,适用于大部分环境 | +| [vanilla tweaks](https://vanillatweaks.net/picker/datapacks/) | 常用数据包的结合体,可以集成下载 | +| [MCCreator](https://mcreator.net/about) | 生成/制作初级数据包的不二之选,推荐 | + +# 数据包结构 + + + +# 数据包的编写 + +太多了,详情请参阅 [Minecraft Wiki](https://zh.minecraft.wiki/w/%E6%95%B0%E6%8D%AE%E5%8C%85) diff --git a/docs/advance/management/player-management/client-distribution.md b/docs/advance/management/player-management/client-distribution.mdx similarity index 98% rename from docs/advance/management/player-management/client-distribution.md rename to docs/advance/management/player-management/client-distribution.mdx index 0cd2d1853..9e691c822 100644 --- a/docs/advance/management/player-management/client-distribution.md +++ b/docs/advance/management/player-management/client-distribution.mdx @@ -40,14 +40,10 @@ sidebar_position: 6 2. **解压至整合包目录,以 HMCL 为例,结构如下:** - ```plain text - MyModpack/ - ├── java/ - │ └── bin/ - ├── HMCL.exe - ├── hmcl.json - └── .minecraft/ - ``` +import StructureExplorer from "@site/src/components/StructureExplorer"; +import { hmclModpackStructure } from "@site/src/data/structures"; + + 3. **调整启动器设置:** 以 HMCL 为例,前往 **版本管理** ,确保启用了 **启用版本特定游戏设置(不影响其他游戏版本)** ,**游戏 Java** 选择 **指定 Java 版本** ,在此选项同一行的右侧输入框中填写以下内容: diff --git a/docs/advance/viaproxy/configuration.md b/docs/advance/viaproxy/configuration.mdx similarity index 92% rename from docs/advance/viaproxy/configuration.md rename to docs/advance/viaproxy/configuration.mdx index 3587df728..e78408a05 100644 --- a/docs/advance/viaproxy/configuration.md +++ b/docs/advance/viaproxy/configuration.mdx @@ -3,6 +3,9 @@ title: 配置详解 sidebar_position: 3 --- +import StructureExplorer from "@site/src/components/StructureExplorer"; +import { viaproxyStructure } from "@site/src/data/structures"; + # 配置详解 本文档详细介绍 ViaProxy 的各种配置选项和参数设置。 @@ -11,20 +14,7 @@ sidebar_position: 3 ViaProxy 使用 YAML 格式的配置文件,主要包含以下几个部分: -```text -viaproxy/ -├── viaproxy.yml # 主配置文件 -├── ViaLoader/ # 协议转换配置 -│ ├── viaversion.yml -│ ├── viabackwards.yml -│ ├── viarewind.yml -│ ├── vialegacy.yml -│ ├── viabedrock.yml -│ └── viaaprilfools.yml -├── plugins/ # 插件目录 -├── logs/ # 日志目录 -└── saves.json # 服务器保存数据 -``` + ## 主配置文件 (viaproxy.yml) diff --git a/package.json b/package.json index 2aa17a79f..6573d0361 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "@docusaurus/theme-search-algolia": "^3.9.2", "@giscus/react": "^3.1.0", "@gracefullight/docusaurus-plugin-microsoft-clarity": "^1.0.0", + "@iconify/react": "^6.0.2", "@mdx-js/react": "^3.1.1", "antd": "^6.1.0", "clsx": "^2.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1af315707..93a4451d5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -53,6 +53,9 @@ importers: '@gracefullight/docusaurus-plugin-microsoft-clarity': specifier: ^1.0.0 version: 1.0.0(@swc/core@1.15.4)(react-dom@19.2.3(react@19.2.3))(react@19.2.3) + '@iconify/react': + specifier: ^6.0.2 + version: 6.0.2(react@19.2.3) '@mdx-js/react': specifier: ^3.1.1 version: 3.1.1(@types/react@19.2.7)(react@19.2.3) @@ -1466,6 +1469,11 @@ packages: '@hapi/topo@5.1.0': resolution: {integrity: sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==} + '@iconify/react@6.0.2': + resolution: {integrity: sha512-SMmC2sactfpJD427WJEDN6PMyznTFMhByK9yLW0gOTtnjzzbsi/Ke/XqsumsavFPwNiXs8jSiYeZTmLCLwO+Fg==} + peerDependencies: + react: '>=16' + '@iconify/types@2.0.0': resolution: {integrity: sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg==} @@ -11789,6 +11797,11 @@ snapshots: dependencies: '@hapi/hoek': 9.3.0 + '@iconify/react@6.0.2(react@19.2.3)': + dependencies: + '@iconify/types': 2.0.0 + react: 19.2.3 + '@iconify/types@2.0.0': {} '@iconify/utils@3.1.0': diff --git a/src/components/StructureExplorer.tsx b/src/components/StructureExplorer.tsx new file mode 100644 index 000000000..bce597602 --- /dev/null +++ b/src/components/StructureExplorer.tsx @@ -0,0 +1,160 @@ +import Link from "@docusaurus/Link"; +import { Icon } from "@iconify/react"; +import "@site/src/css/structure_explorer.css"; +import clsx from "clsx"; +import React, { JSX, useState } from "react"; + +const folderIcon = "mdi:folder"; +const fileIcon = "mdi:file"; + +interface ExplorerNode { + name: string; + type: "folder" | "file"; + children?: ExplorerNode[]; + description?: string; + url?: string; + external?: boolean; +} + +interface ConfigurationStructureDiagramProps { + data?: ExplorerNode[]; +} + +interface TreeLineProps { + isLast: boolean; + isRoot: boolean; +} + +const TreeLine = ({ isLast, isRoot }: TreeLineProps): JSX.Element => { + if (isRoot) { + return ; + } + return {isLast ? "└── " : "├── "}; +}; + +interface PrefixLineProps { + levels: boolean[]; +} + +const PrefixLine = ({ levels }: PrefixLineProps): JSX.Element => { + if (levels.length === 0) { + return ; + } + + return ( + <> + {levels.map((isLast, index) => ( + + {isLast ? " " : "│ "} + + ))} + + ); +}; + +export default function ConfigurationStructureDiagram({ + data = [] +}: ConfigurationStructureDiagramProps = {}): JSX.Element { + const [popupNode, setPopupNode] = useState(null); + + const renderNode = (node: ExplorerNode, level: number = 0, isLast: boolean = true, ancestors: boolean[] = []) => { + const isFolder = node.type === "folder"; + const hasDescription = "description" in node; + const hasUrl = "url" in node; + const isExternal = node.external; + + const handleNodeOpening = (event: React.MouseEvent) => { + event.stopPropagation(); + setPopupNode(node); + }; + + const newAncestors = [...ancestors]; + if (level > 0) { + newAncestors[level - 1] = isLast; + } + + return ( +
0 ? "config-explorer-node" : "config-explorer-node-noflex"} + onMouseLeave={() => { + setPopupNode(null); + }} + > +
+ {level > 0 && } + {level > 0 && } + +
+ {hasUrl ? ( + + + {node.name} + + ) : ( + + + {node.name} + + )} + {hasDescription && ( +
+ + ⓘ + +
+
+ 简介: +
+ {node.description} +
+
+
+ )} +
+
+ + {isFolder && + node.children && + node.children.map((child, index) => ( +
+ {renderNode(child, level + 1, index === node.children!.length - 1, newAncestors)} +
+ ))} +
+ ); + }; + + return ( +
+
{data.map((item) => renderNode(item))}
+
+ ); +} diff --git a/src/css/base/theme.css b/src/css/base/theme.css index 4b8497d1b..d0dd3b32c 100644 --- a/src/css/base/theme.css +++ b/src/css/base/theme.css @@ -511,6 +511,16 @@ button[class*="colorModeToggle"]:active::after { } } +[data-theme="dark"] { + --config-node-highlight-text-color: white; + --config-node-popup-background-color: #1c1e21; +} + +[data-theme="light"] { + --config-node-highlight-text-color: black; + --config-node-popup-background-color: white; +} + /* 尊重用户减少动画偏好 */ @media (prefers-reduced-motion: reduce) { *, diff --git a/src/css/structure_explorer.css b/src/css/structure_explorer.css new file mode 100644 index 000000000..36909d671 --- /dev/null +++ b/src/css/structure_explorer.css @@ -0,0 +1,169 @@ +/* Outer Container */ +.config-explorer-code-outer-container { + overflow: visible; + display: flex; + flex-direction: column; +} + +/* File Node */ +.config-explorer-file-node { + display: flex; + align-items: center; + border-radius: 10px; + width: fit-content; + flex-shrink: 0; + white-space: nowrap; + cursor: default; +} + +.config-explorer-file-node-with-link { + font-weight: bold; +} + +.config-explorer-file-node-with-link:hover { + background-color: rgba(0, 0, 0, 0.1); + cursor: pointer; + text-decoration: none; +} + +/* File Folder Node */ +.config-explorer-file-folder-node { + display: flex; + align-items: center; + width: fit-content; + color: var(--config-node-highlight-text-color); +} + +.config-explorer-file-folder-node:hover { + cursor: default; + text-decoration: none; + color: var(--config-node-highlight-text-color); +} + +/* File Folder Node with Link */ +.config-explorer-file-folder-node-with-link { + font-weight: bold; + color: var(--ifm-link-color); +} + +.config-explorer-file-folder-node-with-link:hover { + background-color: rgba(0, 0, 0, 0.1); + cursor: pointer; + text-decoration: none; + color: var(--ifm-link-color); +} + +/* Popup Window Container */ +.config-explorer-popup-window-container { + position: relative; + display: inline-block; + vertical-align: middle; +} + +/* Popup Window */ +.config-explorer-popup-window { + background-color: var(--config-node-popup-background-color); + padding: 10px; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5); + border-radius: 5px; + margin-left: 5px; + margin-top: -5px; + width: max-content; + min-width: 200px; + max-width: 500px; + z-index: 20; + white-space: normal; + position: absolute; + left: 20px; + top: -10px; +} + +.config-explorer-popup-window-open-tag { + z-index: 5; + margin-left: 3px; +} + +.config-explorer-popup-window-open-tag:hover { + font-weight: bold; + cursor: pointer; +} + +/* Indentation Arrow */ +.indentation-arrow { + font-size: 14px; + color: #bbbbbb; + margin: 0 8px 0 0; + display: inline-block; +} + +/* Tree Line Components */ +.tree-line { + font-size: 14px; + color: #bbbbbb; + display: inline-block; + font-family: monospace; + letter-spacing: 0; + line-height: 1; +} + +.prefix-line { + font-size: 14px; + color: #bbbbbb; + display: inline-block; + font-family: monospace; + letter-spacing: 0; + line-height: 1; +} + +/* Node Icon */ +.config-explorer-node-icon { + font-size: 23px; +} + +/* Node */ +.config-explorer-node { + align-items: flex-start; + position: relative; + display: flex; + flex-direction: column; + flex-shrink: 0; +} + +.config-explorer-node-header { + display: flex; + align-items: center; + margin: 0; + padding: 0; +} + +.config-explorer-node-content { + display: flex; + align-items: center; +} + +/* Node without Flex */ +.config-explorer-node-noflex { + align-items: flex-start; + position: relative; + display: flex; + flex-direction: column; + margin: 5px 0 5px 0; +} + +.config-node-contents-wrapper { + margin: 0 5px 0 0; + display: flex; + align-items: center; + font-size: 15px; +} + +.config-explorer-icon { + /* Make it go back to the original color */ + color: var(--config-node-highlight-text-color); + margin-right: 5px; +} + +/* Display None */ +.display--none { + display: none; +} diff --git a/src/data/structures/bdsServerStructure.ts b/src/data/structures/bdsServerStructure.ts new file mode 100644 index 000000000..b2351501c --- /dev/null +++ b/src/data/structures/bdsServerStructure.ts @@ -0,0 +1,124 @@ +import { ExplorerNode } from "@/types/ExplorerNode"; + +export const bdsServerStructure: ExplorerNode[] = [ + { + name: "BDS服务端文件夹", + type: "folder", + children: [ + { + name: "behavior_packs", + type: "folder", + description: "安装新行为包的文件夹", + }, + { + name: "config", + type: "folder", + description: "没啥用", + }, + { + name: "definitions", + type: "folder", + description: "貌似是生成群系的内容", + }, + { + name: "development_behavior_packs", + type: "folder", + description: "为开发者提供安装新行为包的文件夹", + }, + { + name: "development_resource_packs", + type: "folder", + description: "为开发者提供安装新资源包的文件夹", + }, + { + name: "development_skin_packs", + type: "folder", + description: "为开发者提供安装新皮肤包的文件夹", + }, + { + name: "resource_packs", + type: "folder", + description: "安装新资源包的文件夹", + }, + { + name: "world-templates", + type: "folder", + description: "世界模板", + }, + { + name: "worlds", + type: "folder", + description: "主世界文件夹", + children: [ + { + name: "Bedrock level", + type: "folder", + description: "世界存档", + children: [ + { + name: "db", + type: "folder", + description: "存档数据文件夹", + }, + { + name: "level_dat", + type: "file", + description: "存档设定", + }, + { + name: "level.dat_old", + type: "file", + description: "存档设定 (旧)", + }, + { + name: "level_name.txt", + type: "file", + description: "存档名称", + }, + ], + }, + ], + }, + { + name: "allowlist.json", + type: "file", + description: "白名单文件", + }, + { + name: "bedrock_server.exe", + type: "file", + description: "服务端启动程序", + }, + { + name: "bedrock_server.pdb", + type: "file", + description: "程序数据库文件", + }, + { + name: "bedrock_server_how_to.html", + type: "file", + description: "如何使用 BDS 服务器的官方指南", + }, + { + name: "permissions.json", + type: "file", + description: "管理员 (OP) 玩家相关数据", + }, + { + name: "release-notes.txt", + type: "file", + description: "服务端发行版本详情", + }, + { + name: "server.properties", + type: "file", + description: "配置文件", + }, + { + name: "valid_known_packs.json", + type: "file", + description: "已知的附加包", + }, + ], + }, +]; diff --git a/src/data/structures/datapackStructure.ts b/src/data/structures/datapackStructure.ts new file mode 100644 index 000000000..98d6dee96 --- /dev/null +++ b/src/data/structures/datapackStructure.ts @@ -0,0 +1,854 @@ +import { ExplorerNode } from "@/types/ExplorerNode"; + +export const datapackStructure: ExplorerNode[] = [ + { + name: "数据包名", + type: "folder", + children: [ + { + name: "pack.mcmeta", + type: "file", + description: "用于识别数据包及存储数据包信息", + }, + { + name: "pack.png", + type: "file", + description: "数据包的图片 (可选)", + }, + { + name: "data", + type: "folder", + children: [ + { + name: "advancements", + type: "folder", + children: [ + { + name: "特定进度名.json", + type: "file", + children: [ + { + name: "display", + type: "folder", + description: "进度的显示信息", + children: [ + { + name: "title", + type: "file", + description: "进度标题", + }, + { + name: "description", + type: "file", + description: "进度描述", + }, + { + name: "icon", + type: "file", + description: "进度图标", + }, + ], + }, + { + name: "criteria", + type: "folder", + description: "进度达成条件", + children: [ + { + name: "特定条件名.json", + type: "file", + children: [ + { + name: "trigger", + type: "file", + description: "触发条件类型", + }, + { + name: "conditions", + type: "file", + description: "具体的条件参数", + }, + ], + }, + ], + }, + ], + }, + ], + }, + { + name: "loot_tables", + type: "folder", + children: [ + { + name: "特定物品或实体的战利品表.json", + type: "file", + children: [ + { + name: "pools", + type: "folder", + description: "战利品池列表", + children: [ + { + name: "特定战利品池.json", + type: "file", + children: [ + { + name: "rolls", + type: "file", + description: "战利品生成次数", + }, + { + name: "entries", + type: "folder", + description: "战利品条目", + children: [ + { + name: "特定条目.json", + type: "file", + children: [ + { + name: "type", + type: "file", + description: + "条目类型,如 item、loot_table 等", + }, + { + name: "name", + type: "file", + description: + "物品或战利品表名称", + }, + { + name: "functions", + type: "folder", + description: + "可选的函数列表,用于修改战利品", + children: [ + { + name: "特定函数.json", + type: "file", + children: [ + { + name: "function", + type: "file", + description: + "函数类型,如 set_nbt、enchant_with_levels 等", + }, + { + name: "arguments", + type: "file", + description: + "函数参数", + }, + ], + }, + ], + }, + ], + }, + ], + }, + ], + }, + ], + }, + ], + }, + ], + }, + { + name: "recipes", + type: "folder", + children: [ + { + name: "特定合成配方.json", + type: "file", + children: [ + { + name: "type", + type: "file", + description: + "合成配方类型,如 crafting_shaped、crafting_shapeless 等", + }, + { + name: "group", + type: "file", + description: "合成组名 (可选)", + }, + { + name: "ingredients", + type: "folder", + description: "合成所需的材料列表", + children: [ + { + name: "特定材料.json", + type: "file", + children: [ + { + name: "item", + type: "file", + description: "物品名称", + }, + { + name: "count", + type: "file", + description: "物品数量 (可选)", + }, + ], + }, + ], + }, + { + name: "result", + type: "folder", + description: "合成结果", + children: [ + { + name: "item", + type: "file", + description: "合成后的物品名称", + }, + { + name: "count", + type: "file", + description: "合成后的物品数量 (可选)", + }, + ], + }, + ], + }, + ], + }, + { + name: "tags", + type: "folder", + children: [ + { + name: "blocks", + type: "folder", + children: [ + { + name: "特定方块标签.json", + type: "file", + children: [ + { + name: "replace", + type: "file", + description: "是否替换已有标签 (可选)", + }, + { + name: "values", + type: "file", + description: "方块名称列表", + }, + ], + }, + ], + }, + { + name: "fluids", + type: "folder", + children: [ + { + name: "特定流体标签.json", + type: "file", + children: [ + { + name: "replace", + type: "file", + description: "是否替换已有标签 (可选)", + }, + { + name: "values", + type: "file", + description: "流体名称列表", + }, + ], + }, + ], + }, + { + name: "items", + type: "folder", + children: [ + { + name: "特定物品标签.json", + type: "file", + children: [ + { + name: "replace", + type: "file", + description: "是否替换已有标签 (可选)", + }, + { + name: "values", + type: "file", + description: "物品名称列表", + }, + ], + }, + ], + }, + { + name: "entity_types", + type: "folder", + children: [ + { + name: "特定实体类型标签.json", + type: "file", + children: [ + { + name: "replace", + type: "file", + description: "是否替换已有标签 (可选)", + }, + { + name: "values", + type: "file", + description: "实体类型名称列表", + }, + ], + }, + ], + }, + { + name: "functions", + type: "folder", + children: [ + { + name: "特定函数标签.json", + type: "file", + children: [ + { + name: "replace", + type: "file", + description: "是否替换已有标签 (可选)", + }, + { + name: "values", + type: "file", + description: "函数名称列表", + }, + ], + }, + ], + }, + { + name: "predicates", + type: "folder", + children: [ + { + name: "特定谓词标签.json", + type: "file", + children: [ + { + name: "replace", + type: "file", + description: "是否替换已有标签 (可选)", + }, + { + name: "values", + type: "file", + description: "谓词名称列表", + }, + ], + }, + ], + }, + { + name: "damage_types", + type: "folder", + children: [ + { + name: "特定伤害类型标签.json", + type: "file", + children: [ + { + name: "replace", + type: "file", + description: "是否替换已有标签 (可选)", + }, + { + name: "values", + type: "file", + description: "伤害类型名称列表", + }, + ], + }, + ], + }, + { + name: "enchantments", + type: "folder", + children: [ + { + name: "特定附魔标签.json", + type: "file", + children: [ + { + name: "replace", + type: "file", + description: "是否替换已有标签 (可选)", + }, + { + name: "values", + type: "file", + description: "附魔名称列表", + }, + ], + }, + ], + }, + { + name: "game_events", + type: "folder", + children: [ + { + name: "特定游戏事件标签.json", + type: "file", + children: [ + { + name: "replace", + type: "file", + description: "是否替换已有标签 (可选)", + }, + { + name: "values", + type: "file", + description: "游戏事件名称列表", + }, + ], + }, + ], + }, + ], + }, + { + name: "functions", + type: "folder", + children: [ + { + name: "特定函数文件.mcfunction", + type: "file", + description: "可以是游戏中的各种命令,用于实现特定的逻辑", + }, + ], + }, + { + name: "predicates", + type: "folder", + children: [ + { + name: "特定谓词.json", + type: "file", + children: [ + { + name: "condition", + type: "file", + description: "谓词条件", + }, + { + name: "result", + type: "file", + description: "谓词结果,通常是布尔值", + }, + ], + }, + ], + }, + { + name: "dimension_types", + type: "folder", + children: [ + { + name: "特定维度类型.json", + type: "file", + children: [ + { + name: "effects", + type: "folder", + description: "维度效果列表", + children: [ + { + name: "特定效果.json", + type: "file", + children: [ + { + name: "特定效果类型", + type: "file", + description: "如 fog_color、ambient_light 等", + }, + { + name: "值", + type: "file", + description: "根据效果类型而定", + }, + ], + }, + ], + }, + { + name: "parameters", + type: "folder", + description: "维度类型参数", + children: [ + { + name: "特定参数.json", + type: "file", + children: [ + { + name: "名称", + type: "file", + description: "参数名称", + }, + { + name: "值", + type: "file", + description: "参数值", + }, + ], + }, + ], + }, + ], + }, + ], + }, + { + name: "worldgen", + type: "folder", + children: [ + { + name: "biome", + type: "folder", + children: [ + { + name: "特定生物群系.json", + type: "file", + children: [ + { + name: "features", + type: "folder", + description: "生物群系特征列表", + children: [ + { + name: "特定特征.json", + type: "file", + children: [ + { + name: "特定特征类型", + type: "file", + description: "如 lake、flower 等", + }, + { + name: "参数", + type: "file", + description: "根据特征类型而定", + }, + ], + }, + ], + }, + { + name: "properties", + type: "folder", + description: "生物群系属性", + children: [ + { + name: "特定属性.json", + type: "file", + children: [ + { + name: "名称", + type: "file", + description: "属性名称", + }, + { + name: "值", + type: "file", + description: "属性值", + }, + ], + }, + ], + }, + ], + }, + ], + }, + { + name: "configured_carver", + type: "folder", + children: [ + { + name: "特定雕刻器.json", + type: "file", + children: [ + { + name: "type", + type: "file", + description: "雕刻器类型", + }, + { + name: "biomes", + type: "file", + description: "适用的生物群系列表", + }, + { + name: "parameters", + type: "folder", + description: "雕刻器参数", + children: [ + { + name: "特定参数.json", + type: "file", + children: [ + { + name: "名称", + type: "file", + description: "参数名称", + }, + { + name: "值", + type: "file", + description: "参数值", + }, + ], + }, + ], + }, + ], + }, + ], + }, + { + name: "configured_feature", + type: "folder", + children: [ + { + name: "特定配置特征.json", + type: "file", + children: [ + { + name: "type", + type: "file", + description: "特征类型", + }, + { + name: "placement", + type: "folder", + description: "放置规则", + children: [ + { + name: "特定放置规则.json", + type: "file", + children: [ + { + name: "规则类型", + type: "file", + description: + "如 height_range、on_ground 等", + }, + { + name: "参数", + type: "file", + description: "根据规则类型而定", + }, + ], + }, + ], + }, + { + name: "parameters", + type: "folder", + description: "特征参数", + children: [ + { + name: "特定参数.json", + type: "file", + children: [ + { + name: "名称", + type: "file", + description: "参数名称", + }, + { + name: "值", + type: "file", + description: "参数值", + }, + ], + }, + ], + }, + ], + }, + ], + }, + { + name: "configured_structure_feature", + type: "folder", + children: [ + { + name: "特定配置结构特征.json", + type: "file", + children: [ + { + name: "type", + type: "file", + description: "结构特征类型", + }, + { + name: "placement", + type: "folder", + description: "放置规则", + children: [ + { + name: "特定放置规则.json", + type: "file", + children: [ + { + name: "规则类型", + type: "file", + description: + "如 surface_rule、biome_filter 等", + }, + { + name: "参数", + type: "file", + description: "根据规则类型而定", + }, + ], + }, + ], + }, + { + name: "parameters", + type: "folder", + description: "结构特征参数", + children: [ + { + name: "特定参数.json", + type: "file", + children: [ + { + name: "名称", + type: "file", + description: "参数名称", + }, + { + name: "值", + type: "file", + description: "参数值", + }, + ], + }, + ], + }, + ], + }, + ], + }, + { + name: "noise", + type: "folder", + children: [ + { + name: "特定噪声设置.json", + type: "file", + children: [ + { + name: "noise_type", + type: "file", + description: "噪声类型", + }, + { + name: "parameters", + type: "folder", + description: "噪声参数", + children: [ + { + name: "特定参数.json", + type: "file", + children: [ + { + name: "名称", + type: "file", + description: "参数名称", + }, + { + name: "值", + type: "file", + description: "参数值", + }, + ], + }, + ], + }, + ], + }, + ], + }, + { + name: "processor_list", + type: "folder", + children: [ + { + name: "特定处理器列表.json", + type: "file", + children: [ + { + name: "processors", + type: "folder", + description: "处理器列表", + children: [ + { + name: "特定处理器.json", + type: "file", + children: [ + { + name: "type", + type: "file", + description: "处理器类型", + }, + { + name: "parameters", + type: "folder", + description: "处理器参数", + children: [ + { + name: "特定参数.json", + type: "file", + children: [ + { + name: "名称", + type: "file", + description: + "参数名称", + }, + { + name: "值", + type: "file", + description: + "参数值", + }, + ], + }, + ], + }, + ], + }, + ], + }, + ], + }, + ], + }, + ], + }, + ], + }, + ], + }, +]; diff --git a/src/data/structures/geyserExtensionStructure.ts b/src/data/structures/geyserExtensionStructure.ts new file mode 100644 index 000000000..3b6e24f7d --- /dev/null +++ b/src/data/structures/geyserExtensionStructure.ts @@ -0,0 +1,34 @@ +import { ExplorerNode } from "@/types/ExplorerNode"; + +export const geyserExtensionStructure: ExplorerNode[] = [ + { + name: "服务器根目录/", + type: "folder", + children: [ + { + name: "plugins/", + type: "folder", + children: [ + { + name: "Geyser-Spigot/", + type: "folder", + children: [ + { + name: "extensions/", + type: "folder", + description: "Geyser 扩展文件夹", + children: [ + { + name: "MCXboxBroadcastExtension.jar", + type: "file", + description: "Xbox 直播扩展", + }, + ], + }, + ], + }, + ], + }, + ], + }, +]; diff --git a/src/data/structures/gradleProjectStructure.ts b/src/data/structures/gradleProjectStructure.ts new file mode 100644 index 000000000..846eb38aa --- /dev/null +++ b/src/data/structures/gradleProjectStructure.ts @@ -0,0 +1,166 @@ +import { ExplorerNode } from "@/types/ExplorerNode"; + +export const gradleProjectStructure: ExplorerNode[] = [ + { + name: "项目根目录", + type: "folder", + children: [ + { + name: "src/", + type: "folder", + description: "源代码目录", + children: [ + { + name: "main/", + type: "folder", + description: "主要代码目录", + children: [ + { + name: "java/", + type: "folder", + description: "Java 源代码", + children: [ + { + name: "com/", + type: "folder", + children: [ + { + name: "example/", + type: "folder", + children: [ + { + name: "plugin/", + type: "folder", + children: [ + { + name: "Main.java", + type: "file", + description: "插件主类", + }, + { + name: "commands/", + type: "folder", + description: "命令类", + }, + { + name: "listeners/", + type: "folder", + description: "监听器类", + }, + { + name: "utils/", + type: "folder", + description: "工具类", + }, + ], + }, + ], + }, + ], + }, + ], + }, + { + name: "kotlin/", + type: "folder", + description: "Kotlin 源代码(如果使用)", + }, + { + name: "resources/", + type: "folder", + description: "资源文件目录", + children: [ + { + name: "plugin.yml", + type: "file", + description: "插件配置文件", + }, + { + name: "config.yml", + type: "file", + description: "插件默认配置", + }, + { + name: "messages/", + type: "folder", + description: "语言文件", + }, + ], + }, + ], + }, + { + name: "test/", + type: "folder", + description: "测试代码目录", + children: [ + { + name: "java/", + type: "folder", + description: "测试源代码", + }, + { + name: "kotlin/", + type: "folder", + description: "Kotlin 测试代码", + }, + { + name: "resources/", + type: "folder", + description: "测试资源", + }, + ], + }, + ], + }, + { + name: "build/", + type: "folder", + description: "构建输出目录", + children: [ + { + name: "libs/", + type: "folder", + description: "构建产物(jar 文件)", + }, + ], + }, + { + name: "gradle/", + type: "folder", + description: "Gradle 包装器目录", + children: [ + { + name: "wrapper/", + type: "folder", + }, + ], + }, + { + name: "build.gradle", + type: "file", + description: "Gradle 构建脚本", + }, + { + name: "settings.gradle", + type: "file", + description: "Gradle 设置文件", + }, + { + name: "gradlew", + type: "file", + description: "Gradle 包装器脚本 (Unix)", + }, + { + name: "gradlew.bat", + type: "file", + description: "Gradle 包装器脚本 (Windows)", + }, + { + name: "README.md", + type: "file", + description: "项目说明文件", + }, + ], + }, +]; diff --git a/src/data/structures/hmclModpackStructure.ts b/src/data/structures/hmclModpackStructure.ts new file mode 100644 index 000000000..8097426e2 --- /dev/null +++ b/src/data/structures/hmclModpackStructure.ts @@ -0,0 +1,32 @@ +import { ExplorerNode } from "@/types/ExplorerNode"; + +export const hmclModpackStructure: ExplorerNode[] = [ + { + name: "MyModpack/", + type: "folder", + children: [ + { + name: "java/", + type: "folder", + children: [ + { + name: "bin/", + type: "folder", + }, + ], + }, + { + name: "HMCL.exe", + type: "file", + }, + { + name: "hmcl.json", + type: "file", + }, + { + name: ".minecraft/", + type: "folder", + }, + ], + }, +]; diff --git a/src/data/structures/index.ts b/src/data/structures/index.ts new file mode 100644 index 000000000..5de040bc8 --- /dev/null +++ b/src/data/structures/index.ts @@ -0,0 +1,11 @@ +export { bdsServerStructure } from "./bdsServerStructure"; +export { datapackStructure } from "./datapackStructure"; +export { geyserExtensionStructure } from "./geyserExtensionStructure"; +export { gradleProjectStructure } from "./gradleProjectStructure"; +export { hmclModpackStructure } from "./hmclModpackStructure"; +export { levilamnaPluginStructure } from "./levilamnaPluginStructure"; +export { mavenProjectStructure } from "./mavenProjectStructure"; +export { nukitServerStructure } from "./nukitServerStructure"; +export { serverDirStructureData } from "./serverDirStructureData"; +export { viaproxyStructure } from "./viaproxyStructure"; + diff --git a/src/data/structures/levilamnaPluginStructure.ts b/src/data/structures/levilamnaPluginStructure.ts new file mode 100644 index 000000000..475e77678 --- /dev/null +++ b/src/data/structures/levilamnaPluginStructure.ts @@ -0,0 +1,28 @@ +import { ExplorerNode } from "@/types/ExplorerNode"; + +export const levilamnaPluginStructure: ExplorerNode[] = [ + { + name: "插件文件夹", + type: "folder", + children: [ + { + name: "manifest.json", + type: "file", + description: + "插件元数据文件,该文件必须存在并格式正确才能被 LeviLamina 识别", + }, + { + name: "(插件配置文件和数据库)...", + type: "folder", + description: + "插件生成的配置文件和数据库等,大多数插件的配置文件名叫 config.json,并以一个文件夹或一个 .db 或 .json 后缀文件作为数据库", + }, + { + name: "(插件代码或二进制文件)...", + type: "folder", + description: + "插件源代码,通常是 .js、.lua、.dll 后缀的文件。不要删除,修改或重命名文件,否则可能导致插件无法运行!", + }, + ], + }, +]; diff --git a/src/data/structures/mavenProjectStructure.ts b/src/data/structures/mavenProjectStructure.ts new file mode 100644 index 000000000..7b348f348 --- /dev/null +++ b/src/data/structures/mavenProjectStructure.ts @@ -0,0 +1,123 @@ +import { ExplorerNode } from "@/types/ExplorerNode"; + +export const mavenProjectStructure: ExplorerNode[] = [ + { + name: "项目根目录", + type: "folder", + children: [ + { + name: "src/", + type: "folder", + description: "源代码目录", + children: [ + { + name: "main/", + type: "folder", + description: "主要代码目录", + children: [ + { + name: "java/", + type: "folder", + description: "Java 源代码", + children: [ + { + name: "com/", + type: "folder", + children: [ + { + name: "example/", + type: "folder", + children: [ + { + name: "plugin/", + type: "folder", + children: [ + { + name: "Main.java", + type: "file", + description: "插件主类", + }, + { + name: "commands/", + type: "folder", + description: "命令类", + }, + { + name: "listeners/", + type: "folder", + description: "监听器类", + }, + { + name: "utils/", + type: "folder", + description: "工具类", + }, + ], + }, + ], + }, + ], + }, + ], + }, + { + name: "resources/", + type: "folder", + description: "资源文件目录", + children: [ + { + name: "plugin.yml", + type: "file", + description: "插件配置文件", + }, + { + name: "config.yml", + type: "file", + description: "插件默认配置", + }, + { + name: "messages/", + type: "folder", + description: "语言文件", + }, + ], + }, + ], + }, + { + name: "test/", + type: "folder", + description: "测试代码目录", + children: [ + { + name: "java/", + type: "folder", + description: "测试源代码", + }, + { + name: "resources/", + type: "folder", + description: "测试资源", + }, + ], + }, + ], + }, + { + name: "target/", + type: "folder", + description: "构建输出目录", + }, + { + name: "pom.xml", + type: "file", + description: "Maven 项目配置文件", + }, + { + name: "README.md", + type: "file", + description: "项目说明文件", + }, + ], + }, +]; diff --git a/src/data/structures/nukitServerStructure.ts b/src/data/structures/nukitServerStructure.ts new file mode 100644 index 000000000..ae205b9d2 --- /dev/null +++ b/src/data/structures/nukitServerStructure.ts @@ -0,0 +1,104 @@ +import { ExplorerNode } from "@/types/ExplorerNode"; + +export const nukitServerStructure: ExplorerNode[] = [ + { + name: "Nukkit Server/", + type: "folder", + children: [ + { + name: "nukkit-1.0-SNAPSHOT.jar", + type: "file", + description: "服务器核心", + }, + { + name: "start.bat", + type: "file", + description: "Windows 运行脚本", + }, + { + name: "start.sh", + type: "file", + description: "Linux 运行脚本", + }, + { + name: "start.command", + type: "file", + description: "macOS 运行脚本", + }, + { + name: "server.properties", + type: "file", + description: "服务端配置文件", + }, + { + name: "permissions.yml", + type: "file", + description: "用于设置玩家权限的", + }, + { + name: "banned-players.txt", + type: "file", + description: "存储被封禁的玩家名单的", + }, + { + name: "banned-ips.txt", + type: "file", + description: "存储被封禁的 IP 地址", + }, + { + name: "ops.txt", + type: "file", + description: "用于设置管理员(OP)的", + }, + { + name: "worlds/", + type: "folder", + description: "主世界文件夹", + children: [ + { + name: "world/", + type: "folder", + description: "世界存档", + children: [ + { + name: "level.dat", + type: "file", + description: "存档设定", + }, + { + name: "region/", + type: "folder", + description: "存储世界区块数据", + }, + { + name: "entities/", + type: "folder", + description: "存储世界中的实体数据", + }, + ], + }, + ], + }, + { + name: "plugins/", + type: "folder", + description: "插件存放文件夹", + }, + { + name: "logs/", + type: "folder", + description: "服务器日志存放", + }, + { + name: "whitelist.txt", + type: "file", + description: "存储允许加入服务器的玩家名单", + }, + { + name: "rcon_password.txt", + type: "file", + description: "存储 RCON(远程控制)功能的密码", + }, + ], + }, +]; diff --git a/src/data/structures/serverDirStructureData.ts b/src/data/structures/serverDirStructureData.ts new file mode 100644 index 000000000..b3707ea19 --- /dev/null +++ b/src/data/structures/serverDirStructureData.ts @@ -0,0 +1,222 @@ +import { ExplorerNode } from "@/types/ExplorerNode"; + +export const serverDirStructureData: ExplorerNode[] = [ + { + name: "assets", + type: "folder", + description: "储存 Minecraft 音效贴图等重要文件,不要乱动" + }, + { + name: "cache", + type: "folder", + description: "缓存文件夹,一般放置 Minecraft 原版服务器" + }, + { + name: "config", + type: "folder", + description: "Paper fork 服务器特有的配置文件,用于放置 Paper 的配置文件" + }, + { + name: "crash-reports", + type: "folder", + description: "存放服务器崩溃的完整报告" + }, + { + name: "libraries", + type: "folder", + description: "存放服务器及部分插件的依赖库" + }, + { + name: "logs", + type: "folder", + description: "存放服务端日志的文件夹" + }, + { + name: "plugins", + type: "folder", + description: "存放插件的文件夹" + }, + { + name: "versions", + type: "folder", + description: "存放对应版本需要的依赖 jar" + }, + { + name: "world", + type: "folder", + description: "主世界文件夹", + children: [ + { + name: "advancements", + type: "folder", + description: "成就文件夹" + }, + { + name: "data", + type: "folder", + description: "世界数据文件夹" + }, + { + name: "datapacks", + type: "folder", + description: "数据包", + children: [ + { + name: "bukkit", + type: "folder" + } + ] + }, + { + name: "entities", + type: "folder", + description: "实体数据" + }, + { + name: "playerdata", + type: "folder", + description: "玩家数据" + }, + { + name: "poi", + type: "folder", + description: "兴趣点数据" + }, + { + name: "region", + type: "folder", + description: "区块数据" + }, + { + name: "stats", + type: "folder", + description: "统计信息" + } + ] + }, + { + name: "world_nether", + type: "folder", + description: "地狱世界文件夹", + children: [ + { + name: "DIM-1", + type: "folder", + children: [ + { name: "data", type: "folder" }, + { name: "entities", type: "folder" }, + { name: "poi", type: "folder" }, + { name: "region", type: "folder" } + ] + } + ] + }, + { + name: "world_the_end", + type: "folder", + description: "末地世界文件夹", + children: [ + { + name: "DIM1", + type: "folder", + children: [ + { name: "data", type: "folder" }, + { name: "entities", type: "folder" }, + { name: "poi", type: "folder" }, + { + name: "region", + type: "folder" + } + ] + } + ] + }, + { + name: ".console_history", + type: "file", + description: + "存放了控制台 (又叫后台) 曾经使用过的指令,方便你使用键盘中的 ↑ 键快捷查找曾使用的指令,也可用于查看后台异常。" + }, + { + name: "banned-ips.json", + type: "file", + description: + "以 JSON 格式存放的被 ban IP 玩家的 UUID 及游戏名称等相关信息,一旦玩家被 banip,此 IP 将无法再进入服务器。" + }, + { + name: "banned-players.json", + type: "file", + description: + "以 JSON 格式存放了被 ban 玩家的 UUID 及游戏名称等相关信息,离线服 ban 玩家后换 ID 即可进入服务器,而正版服无法通过改名重新进入服务器。" + }, + { + name: "bukkit.yml", + type: "file", + description: "由 Bukkit 派生得到的服务端都有的文件。保存着 Bukkit 所提供的最基本的设置选项。" + }, + { + name: "commands.yml", + type: "file", + description: + "它提供了一种快速而简单的方法来强制服务器使用 Mojang 提供的命令 (而不是 Bukkit 中内置的命令) 而不产生冲突。" + }, + { + name: "eula.txt", + type: "file", + description: "在首次开服的时候,我们需要同意 EULA 协议。" + }, + { + name: "help.yml", + type: "file", + description: "一些插件的帮助信息会出现在这里面,一般不需要进行什么修改。" + }, + { + name: "ops.json", + type: "file", + description: "以 JSON 格式存放了 OP 玩家的 UUID 及游戏名称等相关信息。" + }, + { + name: "purpur.jar", + type: "file", + description: "你可以改名叫任何名字 (只要以 `.jar` 结尾,且在启动脚本中对应修改)" + }, + { + name: "purpur.yml", + type: "file", + description: "Purpur 服务器特有的配置文件,极其详细的配置项,功能非常丰富,几乎可以替代数款插件。" + }, + { + name: "permissions.yml", + type: "file", + description: + "是默认的权限定义 YAML 文件,在启动时自动生成。它的主要功能是将权限节点组合到一个文件中,以便权限插件 (以及使用权限的插件) 可以在整个系统中使用它。" + }, + { + name: "server.properties", + type: "file", + description: "服务端的一些基本设置就在里面,如设置端口,设置游戏难度,设置游戏模式 (生存、创造等) 等。", + url: "https://minecraft-zh.gamepedia.com/Server.properties", + external: true + }, + { + name: "spigot.yml", + type: "file", + description: "Spigot 服务器都有的配置文件。" + }, + { + name: "usercache.json", + type: "file", + description: "储存着用名字及 UUID 信息的缓存文件。" + }, + { + name: "version_history", + type: "file", + description: "一些 Minecraft 和服务端核心的版本信息,一般记录着曾经使用过的版本。" + }, + { + name: "whitelist.json", + type: "file", + description: + "白名单列表。(如果你在 server.properties 中开启了白名单,你就可以在该文件中添加和管理谁被允许或不被允许进入服务器。)" + } +]; diff --git a/src/data/structures/viaproxyStructure.ts b/src/data/structures/viaproxyStructure.ts new file mode 100644 index 000000000..edce8c4b5 --- /dev/null +++ b/src/data/structures/viaproxyStructure.ts @@ -0,0 +1,61 @@ +import { ExplorerNode } from "@/types/ExplorerNode"; + +export const viaproxyStructure: ExplorerNode[] = [ + { + name: "viaproxy/", + type: "folder", + children: [ + { + name: "viaproxy.yml", + type: "file", + description: "主配置文件", + }, + { + name: "ViaLoader/", + type: "folder", + description: "协议转换配置", + children: [ + { + name: "viaversion.yml", + type: "file", + }, + { + name: "viabackwards.yml", + type: "file", + }, + { + name: "viarewind.yml", + type: "file", + }, + { + name: "vialegacy.yml", + type: "file", + }, + { + name: "viabedrock.yml", + type: "file", + }, + { + name: "viaaprilfools.yml", + type: "file", + }, + ], + }, + { + name: "plugins/", + type: "folder", + description: "插件目录", + }, + { + name: "logs/", + type: "folder", + description: "日志目录", + }, + { + name: "saves.json", + type: "file", + description: "服务器保存数据", + }, + ], + }, +]; diff --git a/src/types/ExplorerNode.ts b/src/types/ExplorerNode.ts new file mode 100644 index 000000000..d7de84a6b --- /dev/null +++ b/src/types/ExplorerNode.ts @@ -0,0 +1,8 @@ +export interface ExplorerNode { + name: string; + type: "folder" | "file"; + children?: ExplorerNode[]; + description?: string; + url?: string; + external?: boolean; +} diff --git a/tsconfig.json b/tsconfig.json index 0cd5024c9..df7b65199 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "@docusaurus/tsconfig", "compilerOptions": { + "baseUrl": "./", "allowSyntheticDefaultImports": true, "resolveJsonModule": true, "strict": true, From 4233a9e1f949426a3c9f35e1e8185a13cfa41170 Mon Sep 17 00:00:00 2001 From: MrlingXD <90316914+wling-art@users.noreply.github.com> Date: Mon, 15 Dec 2025 00:14:48 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E2=9C=A8=20=E5=AE=8C=E5=96=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/StructureExplorer.tsx | 37 ++++++------ src/css/structure_explorer.css | 8 --- src/data/structures/datapackStructure.ts | 74 ++++++++++++------------ src/types/ExplorerNode.ts | 31 +++++++++- 4 files changed, 84 insertions(+), 66 deletions(-) diff --git a/src/components/StructureExplorer.tsx b/src/components/StructureExplorer.tsx index bce597602..2b3f3dc31 100644 --- a/src/components/StructureExplorer.tsx +++ b/src/components/StructureExplorer.tsx @@ -1,3 +1,4 @@ +import { ExplorerNode } from "@/types/ExplorerNode"; import Link from "@docusaurus/Link"; import { Icon } from "@iconify/react"; import "@site/src/css/structure_explorer.css"; @@ -6,17 +7,9 @@ import React, { JSX, useState } from "react"; const folderIcon = "mdi:folder"; const fileIcon = "mdi:file"; +const structureIcon = "mdi:braces"; -interface ExplorerNode { - name: string; - type: "folder" | "file"; - children?: ExplorerNode[]; - description?: string; - url?: string; - external?: boolean; -} - -interface ConfigurationStructureDiagramProps { +interface StructureExplorerProps { data?: ExplorerNode[]; } @@ -54,11 +47,13 @@ const PrefixLine = ({ levels }: PrefixLineProps): JSX.Element => { export default function ConfigurationStructureDiagram({ data = [] -}: ConfigurationStructureDiagramProps = {}): JSX.Element { +}: StructureExplorerProps = {}): JSX.Element { const [popupNode, setPopupNode] = useState(null); const renderNode = (node: ExplorerNode, level: number = 0, isLast: boolean = true, ancestors: boolean[] = []) => { const isFolder = node.type === "folder"; + const isStructure = node.type === "structure"; + const hasChildren = node.type === "folder" || node.type === "structure"; const hasDescription = "description" in node; const hasUrl = "url" in node; const isExternal = node.external; @@ -89,15 +84,15 @@ export default function ConfigurationStructureDiagram({ {hasUrl ? ( {node.name} @@ -105,12 +100,12 @@ export default function ConfigurationStructureDiagram({ ) : ( {node.name} @@ -141,7 +136,7 @@ export default function ConfigurationStructureDiagram({ - {isFolder && + {hasChildren && node.children && node.children.map((child, index) => (
@@ -154,7 +149,11 @@ export default function ConfigurationStructureDiagram({ return (
-
{data.map((item) => renderNode(item))}
+
+                {data.map((item) => (
+                    
{renderNode(item)}
+ ))} +
); } diff --git a/src/css/structure_explorer.css b/src/css/structure_explorer.css index 36909d671..d07c13547 100644 --- a/src/css/structure_explorer.css +++ b/src/css/structure_explorer.css @@ -88,14 +88,6 @@ cursor: pointer; } -/* Indentation Arrow */ -.indentation-arrow { - font-size: 14px; - color: #bbbbbb; - margin: 0 8px 0 0; - display: inline-block; -} - /* Tree Line Components */ .tree-line { font-size: 14px; diff --git a/src/data/structures/datapackStructure.ts b/src/data/structures/datapackStructure.ts index 98d6dee96..53b287990 100644 --- a/src/data/structures/datapackStructure.ts +++ b/src/data/structures/datapackStructure.ts @@ -25,7 +25,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定进度名.json", - type: "file", + type: "structure", children: [ { name: "display", @@ -56,7 +56,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定条件名.json", - type: "file", + type: "structure", children: [ { name: "trigger", @@ -82,7 +82,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定物品或实体的战利品表.json", - type: "file", + type: "structure", children: [ { name: "pools", @@ -91,7 +91,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定战利品池.json", - type: "file", + type: "structure", children: [ { name: "rolls", @@ -105,7 +105,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定条目.json", - type: "file", + type: "structure", children: [ { name: "type", @@ -127,7 +127,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定函数.json", - type: "file", + type: "structure", children: [ { name: "function", @@ -163,7 +163,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定合成配方.json", - type: "file", + type: "structure", children: [ { name: "type", @@ -183,7 +183,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定材料.json", - type: "file", + type: "structure", children: [ { name: "item", @@ -230,7 +230,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定方块标签.json", - type: "file", + type: "structure", children: [ { name: "replace", @@ -252,7 +252,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定流体标签.json", - type: "file", + type: "structure", children: [ { name: "replace", @@ -274,7 +274,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定物品标签.json", - type: "file", + type: "structure", children: [ { name: "replace", @@ -296,7 +296,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定实体类型标签.json", - type: "file", + type: "structure", children: [ { name: "replace", @@ -318,7 +318,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定函数标签.json", - type: "file", + type: "structure", children: [ { name: "replace", @@ -340,7 +340,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定谓词标签.json", - type: "file", + type: "structure", children: [ { name: "replace", @@ -362,7 +362,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定伤害类型标签.json", - type: "file", + type: "structure", children: [ { name: "replace", @@ -384,7 +384,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定附魔标签.json", - type: "file", + type: "structure", children: [ { name: "replace", @@ -406,7 +406,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定游戏事件标签.json", - type: "file", + type: "structure", children: [ { name: "replace", @@ -441,7 +441,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定谓词.json", - type: "file", + type: "structure", children: [ { name: "condition", @@ -463,7 +463,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定维度类型.json", - type: "file", + type: "structure", children: [ { name: "effects", @@ -472,7 +472,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定效果.json", - type: "file", + type: "structure", children: [ { name: "特定效果类型", @@ -495,7 +495,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定参数.json", - type: "file", + type: "structure", children: [ { name: "名称", @@ -525,7 +525,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定生物群系.json", - type: "file", + type: "structure", children: [ { name: "features", @@ -534,7 +534,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定特征.json", - type: "file", + type: "structure", children: [ { name: "特定特征类型", @@ -557,7 +557,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定属性.json", - type: "file", + type: "structure", children: [ { name: "名称", @@ -583,7 +583,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定雕刻器.json", - type: "file", + type: "structure", children: [ { name: "type", @@ -602,7 +602,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定参数.json", - type: "file", + type: "structure", children: [ { name: "名称", @@ -628,7 +628,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定配置特征.json", - type: "file", + type: "structure", children: [ { name: "type", @@ -642,7 +642,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定放置规则.json", - type: "file", + type: "structure", children: [ { name: "规则类型", @@ -666,7 +666,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定参数.json", - type: "file", + type: "structure", children: [ { name: "名称", @@ -692,7 +692,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定配置结构特征.json", - type: "file", + type: "structure", children: [ { name: "type", @@ -706,7 +706,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定放置规则.json", - type: "file", + type: "structure", children: [ { name: "规则类型", @@ -730,7 +730,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定参数.json", - type: "file", + type: "structure", children: [ { name: "名称", @@ -756,7 +756,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定噪声设置.json", - type: "file", + type: "structure", children: [ { name: "noise_type", @@ -770,7 +770,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定参数.json", - type: "file", + type: "structure", children: [ { name: "名称", @@ -796,7 +796,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定处理器列表.json", - type: "file", + type: "structure", children: [ { name: "processors", @@ -805,7 +805,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定处理器.json", - type: "file", + type: "structure", children: [ { name: "type", @@ -819,7 +819,7 @@ export const datapackStructure: ExplorerNode[] = [ children: [ { name: "特定参数.json", - type: "file", + type: "structure", children: [ { name: "名称", diff --git a/src/types/ExplorerNode.ts b/src/types/ExplorerNode.ts index d7de84a6b..98969b810 100644 --- a/src/types/ExplorerNode.ts +++ b/src/types/ExplorerNode.ts @@ -1,8 +1,35 @@ -export interface ExplorerNode { +export type ExplorerNode = FolderNode | FileNode | StructureNode; + +/** + * 文件夹节点 + */ +export interface FolderNode { name: string; - type: "folder" | "file"; + type: "folder"; children?: ExplorerNode[]; description?: string; url?: string; external?: boolean; } + +/** + * 文件节点 + */ +export interface FileNode { + name: string; + type: "file"; + description?: string; + url?: string; + external?: boolean; +} + +/** + * 结构节点 + */ +export interface StructureNode { + name: string; + type: "structure"; + children?: ExplorerNode[]; + external?: boolean; + description?: string; +} \ No newline at end of file From 79889ed9332c2b00b757e237dabdc8dea5d5776e Mon Sep 17 00:00:00 2001 From: MrlingXD <90316914+wling-art@users.noreply.github.com> Date: Mon, 15 Dec 2025 00:15:53 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E2=9C=A8=20=E5=AE=8C=E5=96=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/StructureExplorer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/StructureExplorer.tsx b/src/components/StructureExplorer.tsx index 2b3f3dc31..e3c5d0fbc 100644 --- a/src/components/StructureExplorer.tsx +++ b/src/components/StructureExplorer.tsx @@ -7,7 +7,7 @@ import React, { JSX, useState } from "react"; const folderIcon = "mdi:folder"; const fileIcon = "mdi:file"; -const structureIcon = "mdi:braces"; +const structureIcon = "mdi:file"; interface StructureExplorerProps { data?: ExplorerNode[]; From 1d9c1c6424c426f1f473e9406899d9c7ae116cad Mon Sep 17 00:00:00 2001 From: MrlingXD <90316914+wling-art@users.noreply.github.com> Date: Mon, 15 Dec 2025 00:17:48 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=F0=9F=8E=A8=20=E4=BB=A3=E7=A0=81=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/StructureExplorer.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/StructureExplorer.tsx b/src/components/StructureExplorer.tsx index e3c5d0fbc..dad886a53 100644 --- a/src/components/StructureExplorer.tsx +++ b/src/components/StructureExplorer.tsx @@ -45,9 +45,7 @@ const PrefixLine = ({ levels }: PrefixLineProps): JSX.Element => { ); }; -export default function ConfigurationStructureDiagram({ - data = [] -}: StructureExplorerProps = {}): JSX.Element { +export default function ConfigurationStructureDiagram({ data = [] }: StructureExplorerProps = {}): JSX.Element { const [popupNode, setPopupNode] = useState(null); const renderNode = (node: ExplorerNode, level: number = 0, isLast: boolean = true, ancestors: boolean[] = []) => { From ec1f807364f59d81a8cdb9c0d3dc39730853489f Mon Sep 17 00:00:00 2001 From: MrlingXD <90316914+wling-art@users.noreply.github.com> Date: Mon, 15 Dec 2025 01:05:57 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E2=9C=A8=20=E5=8F=AF=E5=B1=95=E5=BC=80?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0=20&=20=E4=BD=BF=E7=94=A8=20twcss=20=E7=AE=80?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../start/basic/server-dir-structure.mdx | 72 --------- src/components/StructureExplorer.tsx | 71 ++++++--- src/css/structure_explorer.css | 148 ++++++------------ 3 files changed, 98 insertions(+), 193 deletions(-) diff --git a/docs-java/start/basic/server-dir-structure.mdx b/docs-java/start/basic/server-dir-structure.mdx index 9ec91e4c1..a23b9ca8d 100644 --- a/docs-java/start/basic/server-dir-structure.mdx +++ b/docs-java/start/basic/server-dir-structure.mdx @@ -10,12 +10,6 @@ import { serverDirStructureData } from "@site/src/data/structures/serverDirStruc 我们先来简单看一眼 插件端 的文件夹结构 (以 Purpur 为例): -:::tip - -将鼠标悬停在 **ⓘ** 图标上查看详细说明! - -::: - 对于类似 Catserver 的混合服务器,文件夹结构是类似的,基本就多了 `/mods` 文件夹,少了 Bukkit 的下游服务器特有的配置 (如 `purpur.yml` 等)。 @@ -26,72 +20,6 @@ import { serverDirStructureData } from "@site/src/data/structures/serverDirStruc ::: -## 根目录下的一些文件 - -- `.console_history` - -存放了控制台 (又叫后台) 曾经使用过的指令,方便你使用键盘中的 ↑ 键快捷查找曾使用的指令,也可用于查看后台异常。 - -- `banned-ips.json` - -以 JSON 格式存放的被 ban IP 玩家的 UUID 及游戏名称等相关信息,一旦玩家被 banip,此 IP 将无法再进入服务器。 - -- `banned-players.json` - -以 JSON 格式存放了被 ban 玩家的 UUID 及游戏名称等相关信息,离线服 ban 玩家后换 ID 即可进入服务器,而正版服无法通过改名重新进入服务器。 - -- `bukkit.yml` - -由 Bukkit 派生得到的服务端都有的文件。保存着 Bukkit 所提供的最基本的设置选项。 - -- `commands.yml` - -它提供了一种快速而简单的方法来强制服务器使用 Mojang 提供的命令 (而不是 Bukkit 中内置的命令) 而不产生冲突。 - -- `eula.txt` - -在首次开服的时候,我们需要同意 EULA 协议。 - -- `help.yml` - -一些插件的帮助信息会出现在这里面,一般不需要进行什么修改。 - -- `ops.json` - -以 JSON 格式存放了 OP 玩家的 UUID 及游戏名称等相关信息。 - -- `purpur.jar` - -你可以改名叫任何名字 (只要以 `.jar` 结尾,且在启动脚本中对应修改) - -- `purpur.yml` - -Purpur 服务器特有的配置文件,极其详细的配置项,功能非常丰富,几乎可以替代数款插件。 - -- `permissions.yml` - -是默认的权限定义 YAML 文件,在启动时自动生成。它的主要功能是将权限节点组合到一个文件中,以便权限插件 (以及使用权限的插件) 可以在整个系统中使用它。 - -- [`server.properties`](https://minecraft-zh.gamepedia.com/Server.properties) - -服务端的一些基本设置就在里面,如设置端口,设置游戏难度,设置游戏模式 (生存、创造等) 等。 - -- `spigot.yml` - -Spigot 服务器都有的配置文件。 - -- `usercache.json` - -储存着用名字及 UUID 信息的缓存文件。 - -- `version_history` - -一些 Minecraft 和服务端核心的版本信息,一般记录着曾经使用过的版本。 - -- `whitelist.json` - -白名单列表。(如果你在[`server.properties`](https://minecraft-zh.gamepedia.com/Server.properties)中开启了白名单,你就可以在该文件中添加和管理谁被允许或不被允许进入服务器。) - 至此,大部分的以 Bukkit 为基础的服务器核心服务端的结构已经大致呈现在你眼前。 :::tip diff --git a/src/components/StructureExplorer.tsx b/src/components/StructureExplorer.tsx index dad886a53..0fe3318b3 100644 --- a/src/components/StructureExplorer.tsx +++ b/src/components/StructureExplorer.tsx @@ -47,6 +47,7 @@ const PrefixLine = ({ levels }: PrefixLineProps): JSX.Element => { export default function ConfigurationStructureDiagram({ data = [] }: StructureExplorerProps = {}): JSX.Element { const [popupNode, setPopupNode] = useState(null); + const [showDescriptionBelow, setShowDescriptionBelow] = useState(false); const renderNode = (node: ExplorerNode, level: number = 0, isLast: boolean = true, ancestors: boolean[] = []) => { const isFolder = node.type === "folder"; @@ -109,31 +110,40 @@ export default function ConfigurationStructureDiagram({ data = [] }: StructureEx {node.name} )} - {hasDescription && ( -
- - ⓘ - -
-
+ - 简介: -
- {node.description} + ⓘ +
+
+
+ 简介: +
+ {node.description} +
-
- )} + ))}
+ {showDescriptionBelow && hasDescription && ( +
+ + {isLast ? " " : "│ "} +
{node.description}
+
+ )} + {hasChildren && node.children && node.children.map((child, index) => ( @@ -147,6 +157,29 @@ export default function ConfigurationStructureDiagram({ data = [] }: StructureEx return (
+
+ +
                 {data.map((item) => (
                     
{renderNode(item)}
diff --git a/src/css/structure_explorer.css b/src/css/structure_explorer.css index d07c13547..c22ac13b1 100644 --- a/src/css/structure_explorer.css +++ b/src/css/structure_explorer.css @@ -1,161 +1,105 @@ +@layer theme, base, components, utilities; + +@import "tailwindcss/theme.css" layer(theme); +@import "tailwindcss/utilities.css" layer(utilities); + /* Outer Container */ .config-explorer-code-outer-container { - overflow: visible; - display: flex; - flex-direction: column; + @apply overflow-visible flex flex-col; } /* File Node */ .config-explorer-file-node { - display: flex; - align-items: center; - border-radius: 10px; - width: fit-content; - flex-shrink: 0; - white-space: nowrap; - cursor: default; + @apply flex items-center rounded-[10px] w-fit shrink-0 whitespace-nowrap cursor-default; } -.config-explorer-file-node-with-link { - font-weight: bold; +.config-explorer-file-node-with-link, +.config-explorer-file-folder-node-with-link { + @apply font-bold; } -.config-explorer-file-node-with-link:hover { - background-color: rgba(0, 0, 0, 0.1); - cursor: pointer; - text-decoration: none; +.config-explorer-file-node-with-link:hover, +.config-explorer-file-folder-node-with-link:hover { + @apply bg-black/10 cursor-pointer no-underline; } /* File Folder Node */ .config-explorer-file-folder-node { - display: flex; - align-items: center; - width: fit-content; + @apply flex items-center w-fit cursor-default no-underline; color: var(--config-node-highlight-text-color); } -.config-explorer-file-folder-node:hover { - cursor: default; - text-decoration: none; - color: var(--config-node-highlight-text-color); -} - -/* File Folder Node with Link */ .config-explorer-file-folder-node-with-link { - font-weight: bold; - color: var(--ifm-link-color); -} - -.config-explorer-file-folder-node-with-link:hover { - background-color: rgba(0, 0, 0, 0.1); - cursor: pointer; - text-decoration: none; color: var(--ifm-link-color); } -/* Popup Window Container */ +/* Popup Window */ .config-explorer-popup-window-container { - position: relative; - display: inline-block; - vertical-align: middle; + @apply relative inline-block align-middle; } -/* Popup Window */ .config-explorer-popup-window { + @apply absolute p-2.5 rounded border-0 whitespace-normal z-20; background-color: var(--config-node-popup-background-color); - padding: 10px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5); - border-radius: 5px; - margin-left: 5px; - margin-top: -5px; - width: max-content; min-width: 200px; max-width: 500px; - z-index: 20; - white-space: normal; - position: absolute; + width: max-content; left: 20px; top: -10px; + margin-left: 5px; + margin-top: -5px; } .config-explorer-popup-window-open-tag { - z-index: 5; - margin-left: 3px; -} - -.config-explorer-popup-window-open-tag:hover { - font-weight: bold; - cursor: pointer; -} - -/* Tree Line Components */ -.tree-line { - font-size: 14px; - color: #bbbbbb; - display: inline-block; - font-family: monospace; - letter-spacing: 0; - line-height: 1; + @apply z-5 ml-0.75 cursor-pointer font-normal hover:font-bold; } +/* Tree Components */ +.tree-line, .prefix-line { - font-size: 14px; - color: #bbbbbb; - display: inline-block; - font-family: monospace; - letter-spacing: 0; - line-height: 1; + @apply text-sm text-slate-400 inline-block font-mono leading-none; } /* Node Icon */ .config-explorer-node-icon { - font-size: 23px; + @apply text-2xl mr-1.25; + color: var(--config-node-highlight-text-color); } -/* Node */ -.config-explorer-node { - align-items: flex-start; - position: relative; - display: flex; - flex-direction: column; - flex-shrink: 0; +/* Node Structure */ +.config-explorer-node, +.config-explorer-node-noflex { + @apply items-start relative flex flex-col shrink-0; +} + +.config-explorer-node-noflex { + @apply my-1.25; } .config-explorer-node-header { - display: flex; - align-items: center; - margin: 0; - padding: 0; + @apply flex items-center; } .config-explorer-node-content { - display: flex; - align-items: center; + @apply flex items-center; } -/* Node without Flex */ -.config-explorer-node-noflex { - align-items: flex-start; - position: relative; - display: flex; - flex-direction: column; - margin: 5px 0 5px 0; +.config-node-contents-wrapper { + @apply mx-1.25 flex items-center text-base; } -.config-node-contents-wrapper { - margin: 0 5px 0 0; - display: flex; - align-items: center; - font-size: 15px; +/* Description Below */ +.config-explorer-description-below { + @apply flex items-start my-0.5 py-0.5 text-xs leading-relaxed; } -.config-explorer-icon { - /* Make it go back to the original color */ - color: var(--config-node-highlight-text-color); - margin-right: 5px; +.config-explorer-description-text { + @apply text-gray-400 whitespace-normal wrap-break-word flex-1; + max-width: 600px; } -/* Display None */ +/* Utility */ .display--none { - display: none; + @apply hidden; } From 324651fac6bf2c3e5b4a618b3729c7a86f60b7ce Mon Sep 17 00:00:00 2001 From: MrlingXD <90316914+wling-art@users.noreply.github.com> Date: Mon, 15 Dec 2025 15:36:56 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E2=9C=A8=20=E7=BC=A9=E5=B0=8F=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E5=9B=BE=E6=A0=87=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/StructureExplorer.tsx | 4 ++-- src/css/structure_explorer.css | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/StructureExplorer.tsx b/src/components/StructureExplorer.tsx index 0fe3318b3..c75fa4591 100644 --- a/src/components/StructureExplorer.tsx +++ b/src/components/StructureExplorer.tsx @@ -92,7 +92,7 @@ export default function ConfigurationStructureDiagram({ data = [] }: StructureEx > {node.name} @@ -105,7 +105,7 @@ export default function ConfigurationStructureDiagram({ data = [] }: StructureEx > {node.name} diff --git a/src/css/structure_explorer.css b/src/css/structure_explorer.css index c22ac13b1..65452bead 100644 --- a/src/css/structure_explorer.css +++ b/src/css/structure_explorer.css @@ -63,7 +63,7 @@ /* Node Icon */ .config-explorer-node-icon { - @apply text-2xl mr-1.25; + @apply text-base mr-1.25; color: var(--config-node-highlight-text-color); } From f8ea0c63b4b987d49b430f4f32630e7f1ca31dec Mon Sep 17 00:00:00 2001 From: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com> Date: Mon, 15 Dec 2025 02:56:02 -0500 Subject: [PATCH 7/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B7=AE=E5=BC=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../start/basic/server-file-structure.mdx | 65 +++++++++---------- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/docs-bedrock/nukkit/start/basic/server-file-structure.mdx b/docs-bedrock/nukkit/start/basic/server-file-structure.mdx index b5176ad10..1f2142e3e 100644 --- a/docs-bedrock/nukkit/start/basic/server-file-structure.mdx +++ b/docs-bedrock/nukkit/start/basic/server-file-structure.mdx @@ -22,67 +22,66 @@ import { nukitServerStructure } from "@site/src/data/structures"; --- -- `nukkit-1.0-SNAPSHOT.jar` - - 这是 Nukkit 的核心程序文件,用于启动和运行服务端。 +- `nukkit-1.0-SNAPSHOT.jar` + - 这是 Nukkit 的核心程序文件,用于启动和运行服务端。 --- -- `start.bat / start.sh / start.command` +- `start.bat / start.sh / start.command` + - 启动服务器的脚本文件,分别对应 Windows、Linux 和 macOS 系统,用于启动和运行《我的世界》基岩版服务器。 - - 启动服务器的脚本文件,分别对应 Windows、Linux 和 macOS 系统,用于启动和运行《我的世界》基岩版服务器。 - - - 你可以改名叫任何名字 (只要以 `.bat / .sh / .command` 结尾就行),但不建议你这么做,可能会导致成为后续操作报错的因素。例如: - 1. 若你使用 **面板** 开服,需要在对应的 **启动路径** 中修改服务端启动程序的文件名 - 2. 若你使用 **启用脚本** 开服,需要在脚本对应位置的 **启动命令** 中修改 **启动程序的文件名** 为 **该服务端启动程序的文件名** + - 你可以改名叫任何名字 (只要以 `.bat / .sh / .command` 结尾就行),但不建议你这么做,可能会导致成为后续操作报错的因素。例如: + 1. 若你使用 **面板** 开服,需要在对应的 **启动路径** 中修改服务端启动程序的文件名 + 2. 若你使用 **启用脚本** 开服,需要在脚本对应位置的 **启动命令** 中修改 **启动程序的文件名** 为 **该服务端启动程序的文件名** --- -- `server.properties` - - 这是服务器的主要配置文件,用于设置服务器的各种参数,如服务器名称、端口号、最大玩家数、游戏模式等。 +- `server.properties` + - 这是服务器的主要配置文件,用于设置服务器的各种参数,如服务器名称、端口号、最大玩家数、游戏模式等。 --- -- `permissions.yml` - - 用于设置玩家权限的文件,可以定义不同用户组的权限。 +- `permissions.yml` + - 用于设置玩家权限的文件,可以定义不同用户组的权限。 --- -- `banned-players.txt 和 banned-ips.txt` - - 分别用于存储被封禁的玩家名单和 IP 地址。 +- `banned-players.txt 和 banned-ips.txt` + - 分别用于存储被封禁的玩家名单和 IP 地址。 --- -- `worlds` - - 这是存储主世界文件夹的地方。每个世界都有自己的子文件夹,其中包含该世界的所有数据,如地形、建筑、玩家进度等。 - - `world` - - 包含特定世界的存档数据。 - - `level_dat` - - 世界的基本信息文件。 - - `region 文件夹` - - 存储世界区块数据。 - - `entities 文件夹` - - 存储世界中的实体数据。 +- `worlds` + - 这是存储主世界文件夹的地方。每个世界都有自己的子文件夹,其中包含该世界的所有数据,如地形、建筑、玩家进度等。 + - `world` + - 包含特定世界的存档数据。 + - `level_dat` + - 世界的基本信息文件。 + - `region 文件夹` + - 存储世界区块数据。 + - `entities 文件夹` + - 存储世界中的实体数据。 --- -- `plugins 文件夹` - - 用于存放所有插件的 .jar 文件。插件可以扩展服务器的功能,例如添加新的命令、游戏规则或事件处理。 +- `plugins 文件夹` + - 用于存放所有插件的 .jar 文件。插件可以扩展服务器的功能,例如添加新的命令、游戏规则或事件处理。 --- -- `whitelist.txt` - - 白名单文件,列出了允许进入服务器的玩家列表。 - - (如果你在 `server.properties` 中开启了白名单,你就可以在该文件中添加和管理谁被允许或不被允许进入服务器)。 +- `whitelist.txt` + - 白名单文件,列出了允许进入服务器的玩家列表。 + - (如果你在 `server.properties` 中开启了白名单,你就可以在该文件中添加和管理谁被允许或不被允许进入服务器)。 --- -- `logs 文件夹` - - 存储服务器运行时生成的日志文件,用于记录服务器的运行状态和玩家行为。 +- `logs 文件夹` + - 存储服务器运行时生成的日志文件,用于记录服务器的运行状态和玩家行为。 --- -- `rcon_password.txt` - - 用于存储 RCON(远程控制)功能的密码。 +- `rcon_password.txt` + - 用于存储 RCON(远程控制)功能的密码。 ---