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
35 changes: 30 additions & 5 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ on:
paths:
- .github/workflows/build_docs.yml
- docs/**
- mkdocs.yml
- kit/**
- docs.config.ts
- vite.config.ts
- tsconfig.json
- package.json
- package-lock.json
branches:
- '**'
workflow_dispatch:
Expand All @@ -13,16 +18,29 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0 # full history for the "Last updated" dates

- uses: actions/setup-node@v7
with:
node-version: 24
cache: npm

- run: |
npm ci

- run: |
npm run typecheck

- run: |
pip install -r requirements.txt
npm run build

- run: |
mkdocs build
npm run linkcheck

- uses: actions/upload-pages-artifact@v5
with:
path: site/
path: dist/

deploy:
if: github.ref == 'refs/heads/develop' && github.event_name == 'push'
Expand All @@ -31,6 +49,13 @@ jobs:
permissions:
id-token: write
pages: write
concurrency:
group: pages
cancel-in-progress: false
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- uses: actions/deploy-pages@v5
- id: deployment
uses: actions/deploy-pages@v5
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -559,3 +559,7 @@ fabric.properties
/.vscode/
/bin/
/vsxmake2022

# Documentation site (levimc-kit)
/dist/
/.kit/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To access plugin development API hints and scaffolding toolkits, visit the [lega
2. Run the server, then the plugins will be migrated to LeviLamina plugin manifest automatically
3. To load them, you need to restart the server

For more information, please refer to [the documentation](https://docs.levimc.org/LegacyScriptEngine)
For more information, please refer to [the documentation](https://docs.levimc.org/LegacyScriptEngine/)

## Contributing

Expand Down
2 changes: 1 addition & 1 deletion README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
2. 运行服务器,然后插件将自动迁移到 LeviLamina 插件清单中
3. 重启服务器后,插件就会被加载

更多信息请参见[文档](https://docs.levimc.org/LegacyScriptEngine)
更多信息请参见[文档](https://docs.levimc.org/LegacyScriptEngine/)

## 贡献

Expand Down
126 changes: 126 additions & 0 deletions docs.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
// LegacyScriptEngine documentation — built with levimc-kit (see kit/README.md).
// Ported 1:1 from the former mkdocs.yml (MkDocs Material + mkdocs-static-i18n).
import { defineDocsConfig } from './kit/docs/node/config.ts';

export default defineDocsConfig({
base: '/LegacyScriptEngine/',
title: 'LegacyScriptEngine',
titleTemplate: ':title - :site',
logo: 'img/logo.png',
favicon: 'img/logo.png',
project: 'LegacyScriptEngine',
repo: 'https://github.com/LiteLDev/LegacyScriptEngine',
editLink: 'https://github.com/LiteLDev/LegacyScriptEngine/edit/develop/docs/:path',
contentDir: 'docs',
hostname: 'https://docs.levimc.org',
sitemap: { hostname: 'https://docs.levimc.org' },
lastUpdated: true,
i18n: {
mode: 'suffix',
defaultLocale: 'en',
locales: [
{ code: 'en', label: 'English', lang: 'en' },
{ code: 'zh', label: '中文', lang: 'zh' },
],
},
urlStyle: 'directory',
slug: 'pymdownx',
markdown: { compat: 'python-markdown' },
// MkDocs Material lists h2–h6 in "Table of contents"; the API entries of File, Basic, Command, DataBase
// and LanguageSupport are h5 headings, so keep the full depth instead of the kit default [2, 4].
outline: [2, 6],
sidebar: 'tabs',
// Same tree as mkdocs.yml. The API sub-groups use the `{ text, collapsed, items }` form because MkDocs Material
// (without navigation.expand) shows them collapsed, except the group that holds the current page; the kit
// would otherwise open every first-level sidebar group and push the current page out of view.
nav: [
{ Home: 'index.md' },
{ Tutorials: ['tutorials/create_your_first_plugin.md'] },
'faq.md',
{
APIs: [
'apis/README.md',
'apis/LanguageSupport.md',
{
text: 'DataAPI',
collapsed: true,
items: [
'apis/DataAPI/ConfigFile.md',
'apis/DataAPI/DataBase.md',
'apis/DataAPI/Economy.md',
'apis/DataAPI/OtherData.md',
'apis/DataAPI/PlayerData.md',
],
},
{
text: 'EventAPI',
collapsed: true,
items: [
'apis/EventAPI/Listen.md',
'apis/EventAPI/BlockEvents.md',
'apis/EventAPI/EconomicEvents.md',
'apis/EventAPI/EntityEvents.md',
'apis/EventAPI/OtherEvents.md',
'apis/EventAPI/PlayerEvents.md',
],
},
{
text: 'GameAPI',
collapsed: true,
items: [
'apis/GameAPI/Basic.md',
'apis/GameAPI/Block.md',
'apis/GameAPI/BlockEntity.md',
'apis/GameAPI/Command.md',
'apis/GameAPI/Container.md',
'apis/GameAPI/Device.md',
'apis/GameAPI/Entity.md',
'apis/GameAPI/GameUtils.md',
'apis/GameAPI/Item.md',
'apis/GameAPI/Packet.md',
'apis/GameAPI/Particle.md',
'apis/GameAPI/Player.md',
'apis/GameAPI/ScoreBoard.md',
'apis/GameAPI/Server.md',
],
},
{ text: 'GuiAPI', collapsed: true, items: ['apis/GuiAPI/Form.md', 'apis/GuiAPI/FormBuilder.md'] },
{
text: 'NbtAPI',
collapsed: true,
items: [
'apis/NbtAPI/NBT.md',
'apis/NbtAPI/NBTCompound.md',
'apis/NbtAPI/NBTList.md',
'apis/NbtAPI/NBTValue.md',
],
},
{
text: 'ScriptAPI',
collapsed: true,
items: [
'apis/ScriptAPI/Logger.md',
'apis/ScriptAPI/ScriptHelp.md',
'apis/ScriptAPI/i18n.md',
'apis/ScriptAPI/Ll.md',
'apis/ScriptAPI/VanillaI18n.md',
],
},
{
text: 'SystemAPI',
collapsed: true,
items: [
'apis/SystemAPI/File.md',
'apis/SystemAPI/FileSystem.md',
'apis/SystemAPI/Network.md',
'apis/SystemAPI/SystemCall.md',
'apis/SystemAPI/SystemInfo.md',
],
},
],
},
],
navTranslations: {
zh: { Home: '主页', Tutorials: '教程', APIs: '接口' },
},
});
6 changes: 3 additions & 3 deletions docs/apis/DataAPI/DataBase.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ SQL databases are suitable for handling large amounts of relational data using S

**Note:** Unless otherwise specified, the following APIs may throw exceptions. It is recommended to use exception handling blocks. For **JavaScript**, use `try ... catch` blocks; for **Lua**, use `pcall`. Generally, if no error is thrown, the call is successful.

> If you are a JavaScript plugin developer, you can also try using the [Yoyo](https://www.google.com/search?q=https://gitee.com/Y_oyo) LLDB Chained Operation Library (primarily for beginners who are unfamiliar with SQL syntax). Details: [Click here](https://gitee.com/Y_oyo/yoyo-mcbe-lite-xloader-item/blob/master/sql/yoyoSqlite.js%202.0.0.md)
> If you are a JavaScript plugin developer, you can also try using the [Yoyo](https://gitee.com/Y_oyo) LLDB Chained Operation Library (primarily for beginners who are unfamiliar with SQL syntax). Details: [Click here](https://gitee.com/Y_oyo/yoyo-mcbe-lite-xloader-item/blob/master/sql/yoyoSqlite.js%202.0.0.md)

### Open a SQL Database Session

Expand All @@ -116,7 +116,7 @@ To achieve cross-database compatibility, connecting to a database requires passi
* `type`: `String`
The database type, supports `"sqlite3"` and `"mysql"`.
* `params`: `Object`
[Connection Parameters](https://www.google.com/search?q=%23connection-parameters)
[Connection Parameters](#connection-parameters)


* **Returns:** The opened database session object.
Expand Down Expand Up @@ -359,7 +359,7 @@ stmt.bind(114514, 7); // Binds to h (index 7)

`stmt.fetchAll()`

* **Returns:** The full result set. (See [Execute SQL and Get Result Set](https://www.google.com/search?q=%23execute-sql-and-get-result-set)).
* **Returns:** The full result set. (See [Execute SQL and Get Result Set](#execute-sql-and-get-result-set)).
* **Return Type:** `Array<Array>`

`stmt.fetchAll(callback)`
Expand Down
2 changes: 1 addition & 1 deletion docs/apis/GameAPI/Block.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,4 +209,4 @@
- 返回值:是否成功生成
- 返回值类型:`Boolean`

粒子效果名称可以查阅[Minecraft Wiki](https://zh.minecraft.wiki/w/粒子#类型)得知,在传入参数的时候不要忘记命名空间前缀。类似于 `minecraft:heart_particle`
粒子效果名称可以查阅[Minecraft Wiki](https://zh.minecraft.wiki/w/基岩版粒子#类型)得知,在传入参数的时候不要忘记命名空间前缀。类似于 `minecraft:heart_particle`
26 changes: 13 additions & 13 deletions docs/apis/GameAPI/Player.md
Original file line number Diff line number Diff line change
Expand Up @@ -1415,7 +1415,7 @@ Reference: [mojang-gametest docs](https://learn.microsoft.com/en-us/minecraft/cr
- Return value: Whether the simulation operation was successful
- Return type: `Boolean`

Reference: [mojang-gametest docs](https://docs.microsoft.com/en-us/minecraft/creator/scriptapi/mojang-gametest/simulatedplayer#attack)
Reference: [mojang-gametest docs](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-gametest/simulatedplayer?view=minecraft-bedrock-experimental#attack)

#### Simulate Destroy

Expand All @@ -1434,7 +1434,7 @@ Reference: [mojang-gametest docs](https://docs.microsoft.com/en-us/minecraft/cre
- Return value: Whether the simulation operation was successful
- Return type: `Boolean`

Reference: [mojang-gametest docs](https://docs.microsoft.com/en-us/minecraft/creator/scriptapi/mojang-gametest/simulatedplayer#breakblock)
Reference: [mojang-gametest docs](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-gametest/simulatedplayer?view=minecraft-bedrock-experimental#breakblock)

#### Simulate Disconnect

Expand Down Expand Up @@ -1463,7 +1463,7 @@ Reference: [mojang-gametest docs](https://docs.microsoft.com/en-us/minecraft/cre
- Return value: Whether the simulation operation was successful
- Return type: `Boolean`

Reference: [mojang-gametest docs](https://docs.microsoft.com/en-us/minecraft/creator/scriptapi/mojang-gametest/simulatedplayer#interact)
Reference: [mojang-gametest docs](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-gametest/simulatedplayer?view=minecraft-bedrock-experimental#interact)

#### Simulate Jump

Expand All @@ -1472,7 +1472,7 @@ Reference: [mojang-gametest docs](https://docs.microsoft.com/en-us/minecraft/cre
- Return value: Whether the simulation operation was successful
- Return type: `Boolean`

Reference: [mojang-gametest docs](https://docs.microsoft.com/en-us/minecraft/creator/scriptapi/mojang-gametest/simulatedplayer#jump)
Reference: [mojang-gametest docs](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-gametest/simulatedplayer?view=minecraft-bedrock-experimental#jump)

#### Simulate Look At a Block or Entity

Expand All @@ -1498,7 +1498,7 @@ Reference: [mojang-gametest docs](https://docs.microsoft.com/en-us/minecraft/cre
- Return value: Whether the simulation operation was successful
- Return type: `Boolean`

Reference: [mojang-gametest docs](https://docs.microsoft.com/en-us/minecraft/creator/scriptapi/mojang-gametest/simulatedplayer#lookatblock)
Reference: [mojang-gametest docs](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-gametest/simulatedplayer?view=minecraft-bedrock-experimental#lookatblock)

#### Simulate Set Body Rotation

Expand Down Expand Up @@ -1553,7 +1553,7 @@ Reference: [mojang-gametest docs](https://learn.microsoft.com/en-us/minecraft/cr
- Return value: Whether the move request was successful
- Return type: `Boolean`

Reference: [mojang-gametest docs](https://docs.microsoft.com/en-us/minecraft/creator/scriptapi/mojang-gametest/simulatedplayer#movetolocation)
Reference: [mojang-gametest docs](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-gametest/simulatedplayer?view=minecraft-bedrock-experimental#movetolocation)
Note: If you need automatic pathfinding, consider using `Simulate Navigate Move`

#### Simulate Navigate Move
Expand All @@ -1574,7 +1574,7 @@ Note: If you need automatic pathfinding, consider using `Simulate Navigate Move`
,path:`Number[3][]`}
- Return type: `Object`

Reference: [mojang-gametest docs](https://docs.microsoft.com/en-us/minecraft/creator/scriptapi/mojang-gametest/simulatedplayer#navigatetoblock)
Reference: [mojang-gametest docs](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-gametest/simulatedplayer?view=minecraft-bedrock-experimental#navigatetoblock)
Return value example:

```json
Expand Down Expand Up @@ -1642,7 +1642,7 @@ path is not empty, the simulated player will move to the (-1,0,0) coordinate.
- Return value: Whether the simulation operation was successful
- Return type: `Boolean`

Reference: [mojang-gametest docs](https://docs.microsoft.com/en-us/minecraft/creator/scriptapi/mojang-gametest/simulatedplayer#navigatetolocations)
Reference: [mojang-gametest docs](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-gametest/simulatedplayer?view=minecraft-bedrock-experimental#navigatetolocations)

#### Simulate Use Item

Expand All @@ -1665,7 +1665,7 @@ Reference: [mojang-gametest docs](https://docs.microsoft.com/en-us/minecraft/cre
- Return value: Whether the simulation operation was successful
- Return type: `Boolean`

Reference: [mojang-gametest docs](https://docs.microsoft.com/en-us/minecraft/creator/scriptapi/mojang-gametest/simulatedplayer#useitem)
Reference: [mojang-gametest docs](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-gametest/simulatedplayer?view=minecraft-bedrock-experimental#useitem)

#### Simulate Stop Destroying Block

Expand All @@ -1674,7 +1674,7 @@ Reference: [mojang-gametest docs](https://docs.microsoft.com/en-us/minecraft/cre
- Return value: Whether the simulation operation was successful
- Return type: `Boolean`

Reference: [mojang-gametest docs](https://docs.microsoft.com/en-us/minecraft/creator/scriptapi/mojang-gametest/simulatedplayer#stopbreakingblock)
Reference: [mojang-gametest docs](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-gametest/simulatedplayer?view=minecraft-bedrock-experimental#stopbreakingblock)

#### Simulate Stop Interacting

Expand All @@ -1683,7 +1683,7 @@ Reference: [mojang-gametest docs](https://docs.microsoft.com/en-us/minecraft/cre
- Return value: Whether the simulation operation was successful
- Return type: `Boolean`

Reference: [mojang-gametest docs](https://docs.microsoft.com/en-us/minecraft/creator/scriptapi/mojang-gametest/simulatedplayer#stopinteracting)
Reference: [mojang-gametest docs](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-gametest/simulatedplayer?view=minecraft-bedrock-experimental#stopinteracting)

#### Simulate Stop Moving

Expand All @@ -1692,7 +1692,7 @@ Reference: [mojang-gametest docs](https://docs.microsoft.com/en-us/minecraft/cre
- Return value: Whether the simulation operation was successful
- Return type: `Boolean`

Reference: [mojang-gametest docs](https://docs.microsoft.com/en-us/minecraft/creator/scriptapi/mojang-gametest/simulatedplayer#stopmoving)
Reference: [mojang-gametest docs](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-gametest/simulatedplayer?view=minecraft-bedrock-experimental#stopmoving)

#### Simulate Stop Using Item

Expand All @@ -1701,4 +1701,4 @@ Reference: [mojang-gametest docs](https://docs.microsoft.com/en-us/minecraft/cre
- Return value: Whether the simulation operation was successful
- Return type: `Boolean`

Reference: [mojang-gametest docs](https://docs.microsoft.com/en-us/minecraft/creator/scriptapi/mojang-gametest/simulatedplayer#stopusingitem)
Reference: [mojang-gametest docs](https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server-gametest/simulatedplayer?view=minecraft-bedrock-experimental#stopusingitem)
Loading
Loading