Skip to content
This repository was archived by the owner on Dec 22, 2025. It is now read-only.

Commit 57d7070

Browse files
committed
更新插件系统文档
1 parent 7f178cd commit 57d7070

File tree

4 files changed

+34
-3
lines changed

4 files changed

+34
-3
lines changed

.vitepress/config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ export default defineConfig({
1919
collapsed: false,
2020
items: [
2121
{ text: "概述", link: "plugin/overview" },
22-
{ text: "事件", link: "plugin/event" }
22+
{ text: "事件", link: "plugin/event" },
23+
{ text: "指令", link: "plugin/command" }
2324
]
2425
},
2526
{

plugin/command.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: 指令
3+
---
4+
5+
# 指令
6+
7+
## 基本运用
8+
9+
> 该插件系统的指令未完善,主要应为是权限那块没弄好
10+
11+
```lua
12+
local plugin = function(plugin)
13+
-- 玩家加入事件
14+
local command = function(sender, name, args)
15+
sender:sendMessage("hello world!!")
16+
end
17+
18+
plugin.enable = function()
19+
-- 注册事件
20+
plugin.command.register("test", command, {
21+
description = "This is a test command",
22+
usage = "/<Command>"
23+
})
24+
end
25+
end
26+
27+
-- 编写meta和注册自己明白
28+
```

plugin/event.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ title: 事件
88

99
## 基本运用
1010

11-
> 该插件系统暂时只有玩家加入游戏事件(
11+
> 该插件系统的事件已经大部分完善,事件名与Bukkit事件类名对照在这里:[EventMap.java](https://github.com/MenthaMC/LemonMint/blob/dev/1.21.8/lemint-server/src/main/java/me/coderfrish/event/EventMap.java)
1212
1313
```lua
1414
local plugin = function(plugin)
1515
-- 玩家加入事件
1616
local join = function(event)
17-
event.setJoinMessage("Welcome " .. event.player.name .. " Join this server!!")
17+
event.setJoinMessage("Welcome " .. event:getPlayer():getName() .. " Join this server!!")
1818
end
1919

2020
plugin.enable = function()

plugin/overview.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ title: 插件系统概述
1212

1313
该插件系统不需要引入Jar包也不需要用什么构建系统,一个文件就可以搞定。
1414

15+
> 注:meta中name和version是必须写的,不然会报错。
16+
1517
```lua
1618
local plugin = function(plugin)
1719
plugin.enable = function()

0 commit comments

Comments
 (0)