Skip to content

Commit

Permalink
Update Lua Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
RainyHallways committed Jan 5, 2024
1 parent 9b3a888 commit d1d4605
Showing 50 changed files with 2,545 additions and 1,037 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
lang: zh-CN
title: 方块、命令块
description: 方块和命令块示例
---
lang: zh-CN
title: 方块、命令块
description: 方块和命令块示例
---

# 方块和命令块放置相关API
@@ -30,10 +30,10 @@ description: 方块和命令块示例
- block_name: 方块的名字
- block_data: 方块的状态
- option: 命令方块的配置
- 返回:
- 返回: 错误信息
``` lua
-- 在884.73.829位置放置一个重复命令方块,命令为list @a 10tick后执行,并且需要红石激活 条件为真 名字为:列出所有玩家 延迟为10 tick 输出结果 并且在第一次tick时执行
coromega:place_command_block(
local err = coromega:place_command_block(
{ x = 884, y = 73, z = 829 }, -- 坐标
"repeating_command_block", -- command_block/chain_command_block/repeating_command_block
0, -- 方块数据,影响朝向
@@ -47,6 +47,31 @@ description: 方块和命令块示例
execute_on_first_tick = true, -- 执行第一个对象
}
)
if err then
coromega:print(err)
end
```

- place_sign(pos, block_name, text, lighting)
- 范围: 任意
- 说明: 在pos位置放置一个告示牌
- 参数:
- pos: 放置的位置
- block_name: 方块的名字
- text: 告示牌上的字
- lighting: 是否发光
- 返回: 错误信息
``` lua
-- 在 1,-60,0 位置放置一个告示牌,上面写着 240! 同时发光
local err = coromega:place_sign(
{ x = 1, y = -60, z = 0 }, -- 坐标
"jungle_standing_sign 0",
"§a§l240!",
true
)
if err then
coromega:print(err)
end
```

## 区块构建 API
Original file line number Diff line number Diff line change
@@ -213,111 +213,126 @@ description: 命令示例
local result = player:check({ "m=c", "tag=!ban", "tag=!ban" })
local result = player:check({ "m=c"})
```
-- uuid_string()

### 获取玩家 uuid
- uuid_string()
- 范围:协程内
- 说明:获取玩家的uuid字符串
- 参数:无
- 返回值:uuid字符串
- 返回值:uuid字符串,是否获得该信息
``` lua
local uuid = player:uuid_string()
local uuid,found = player:uuid_string()
```
-- name()

### 获取玩家名字
- name()
- 范围:协程内
- 说明:获取玩家的名字
- 参数:无
- 返回值:玩家名
- 返回值:玩家名,是否获得该信息
``` lua
local name = player:name()
local name,found = player:name()
```

### 获取玩家id
- entity_unique_id()
- 范围:协程内
- 说明:获取玩家的实体唯一id
- 参数:无
- 返回值:实体唯一id
- 返回值:实体唯一id,是否获得该信息
``` lua
local id = player:entity_unique_id()
local id,found = player:entity_unique_id()
```

### 获取玩家登录时间
- login_time()
- 范围:协程内
- 说明:获取玩家的登录时间(unix time), 其类型与 :now() 一致,单位秒
- 参数:无
- 返回值:登录时间
- 返回值:登录时间,是否获得该信息
``` lua
local time = player:login_time()
local time,found = player:login_time()
```

### 获取玩家平台聊天id
- platform_chat_id()
- 范围:协程内
- 说明:获取玩家的平台聊天id
- 参数:无
- 返回值:平台聊天id
- 返回值:平台聊天id,是否获得该信息
``` lua
local id = player:platform_chat_id()
local id,found = player:platform_chat_id()
```

### 获取玩家皮肤id
- skin_id()
- 范围:协程内
- 说明:获取玩家的皮肤id
- 参数:无
- 返回值:皮肤id
- 返回值:皮肤id,是否获得该信息
``` lua
local id = player:skin_id()
local id,found = player:skin_id()
```

### 获取玩家属性标识
- properties_flag()
- 范围:协程内
- 说明:获取玩家的属性标识
- 参数:无
- 返回值:属性标识
- 返回值:属性标识,是否获得该信息
``` lua
local flag = player:properties_flag()
local flag,found = player:properties_flag()
```

### 获取玩家命令权限等级
- command_permission_level()
- 范围:协程内
- 说明:获取玩家的命令权限等级
- 参数:无
- 返回值:命令权限等级
- 返回值:命令权限等级,是否获得该信息
``` lua
local level = player:command_permission_level()
local level,found = player:command_permission_level()
```

### 获取玩家动作权限
- action_permissions()
- 范围:协程内
- 说明:获取玩家的动作权限
- 参数:无
- 返回值:动作权限
- 返回值:动作权限,是否获得该信息
``` lua
local permissions = player:action_permissions()
local permissions,found = player:action_permissions()
```

### 获取玩家op权限等级
- op_permission_level()
- 范围:协程内
- 说明:获取玩家的op权限等级
- 参数:无
- 返回值:op权限等级
- 返回值:op权限等级,是否获得该信息
``` lua
local level = player:op_permission_level()
local level,found = player:op_permission_level()
```

### 获取玩家自定义存储权限
- custom_stores_permissions()
- 范围:协程内
- 说明:获取玩家的自定义存储权限
- 参数:无
- 返回值:自定义存储权限
- 返回值:自定义存储权限,是否获得该信息
``` lua
local permissions = player:custom_stores_permissions()
local permissions,found = player:custom_stores_permissions()
```

### 获取玩家设备id
@@ -355,9 +370,10 @@ description: 命令示例
- 范围:协程内
- 说明:获取玩家的冒险和动作能力等级字典
- 参数:无
- 返回值:冒险和动作能力等级字典
- 返回值:冒险和动作能力等级字典,是否获得该信息
``` lua
local adventure_ability_map, action_permission_ability_map = player:adventure_and_action_ability_map()
local adventure_ability_map, action_permission_ability_map,found = player:adventure_and_action_ability_map()
```

### 更新玩家的权限等级字典
@@ -377,9 +393,10 @@ description: 命令示例
- 范围:协程内
- 说明:判断玩家是否为op
- 参数:无
- 返回值:是否为op
- 返回值:是否为op,是否获得该信息
``` lua
local result = player:is_op()
local result,found = player:is_op()
```

### 判断是否在线
46 changes: 46 additions & 0 deletions docs/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
lang: zh-CN
title: 安装指南
description: 安装指南
sidebar: auto
---

# 安装 neomega

## 安卓、linux、macos
如果你是 安卓、linux、macos 用户,那么
在你的黑框框(终端)里复制黏贴下面一整段: <br/>
`
curl -o install.sh https://omega-1259160345.cos.ap-nanjing.myqcloud.com/fastbuilder_launcher/install.sh && bash install.sh && rm install.sh
`

再输入 `./fastbuilder` 即可

## Windows
windows 下载这个,双击运行:
[windows-amd64.exe](https://omega-1259160345.cos.ap-nanjing.myqcloud.com/fastbuilder_launcher/windows-amd64.exe)

## Dockerfile
```dockerfile
FROM ubuntu:20.04
RUN export DEBIAN_FRONTEND=noninteractive && export DEBIAN_FRONTEND=teletype \
&& sed -i 's/archive.ubuntu.com/mirrors.bfsu.edu.cn/g' /etc/apt/sources.list \
&& apt-get update -yq && apt-get install -yq --no-install-recommends \
ca-certificates \
&& apt clean -yq && apt autoclean -yq && apt autoremove -yq && rm -rf /var/lib/apt/lists/*

ADD https://omega-1259160345.cos.ap-nanjing.myqcloud.com/fastbuilder_launcher/linux-amd64 /usr/bin/fastbuilder
RUN mkdir -p /workspace/cache/default_config/fastbuilder && mkdir -p root/.config && ln -s /workspace/cache/default_config/fastbuilder /root/.config/fastbuilder \
&& echo -n 'zh_CN' > /root/.config/fastbuilder/language \
&& chmod +x /usr/bin/fastbuilder
RUN fastbuilder -b
ADD https://omega-1259160345.cos.ap-nanjing.myqcloud.com/fastbuilder_launcher/certs.tar.gz /etc/ssl/certs.tar.gz
RUN mkdir -p /workspace

RUN echo "#!/bin/sh" >> /usr/bin/start \
&& echo "sleep 1" >> /usr/bin/start \
&& echo "fastbuilder" >> /usr/bin/start \
&& chmod +x /usr/bin/start
WORKDIR /workspace
ENTRYPOINT [ "/usr/bin/start" ]
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added docs/neomega-launcher-topdown.drawio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/repo_architectures.drawio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3,452 changes: 2,436 additions & 1,016 deletions package-lock.json

Large diffs are not rendered by default.

0 comments on commit d1d4605

Please sign in to comment.