Skip to content

Commit 25b7109

Browse files
committed
readme update for mcdr2.0
1 parent d27745d commit 25b7109

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ A MCDReforged api plugin to get player data information and more
1111

1212
## Usage
1313

14-
Use `server.get_plugin_instance()` to get the MinecraftDataAPI instance
14+
Directly `import` MinecraftDataAPI and just use it:
1515

1616
```python
17-
api = server.get_plugin_instance('minecraft_data_api')
17+
import minecraft_data_api as api
18+
19+
pos = api.get_player_info('Steve', 'Pos')
1820
```
1921

20-
You can declare the dependency of this plugin in PLUGIN_METADATA:
22+
Suggestion: declare the dependency of MinecraftDataAPI in your plugin metadata:
2123

2224
```python
2325
PLUGIN_METADATA = {
@@ -29,7 +31,7 @@ PLUGIN_METADATA = {
2931

3032
## Function list
3133

32-
Check the sample plugin in the `examples` folder or read the code to get a more comprehensive understanding
34+
Check the example plugin in the `examples` folder or read the code to get a more comprehensive understanding
3335

3436
### convert_minecraft_json
3537

@@ -51,9 +53,9 @@ Args:
5153
- text: A data get entity or other command result that use Minecraft style json format
5254

5355
Return:
54-
- A parsed json result. It can be a `dict`, a `list` or an `int`
56+
- A parsed json result. It can be a `dict` / `list` / `int` / `float`
5557

56-
Samples:
58+
Examples:
5759

5860
- Input `Steve has the following entity data: [-227.5d, 64.0d, 231.5d]`, output `[-227.5, 64.0, 123000.0]`
5961

README_cn.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111

1212
## 使用方法
1313

14-
使用 `server.get_plugin_instance()` 来获得 MinecraftDataAPI 插件实例,即可使用
14+
直接 `import` MinecraftDataAPI,就能用了
1515

1616
```python
17-
api = server.get_plugin_instance('minecraft_data_api')
17+
import minecraft_data_api as api
18+
19+
pos = api.get_player_info('Steve', 'Pos')
1820
```
1921

20-
可在 PLUGIN_METADATA 中声明对本 API 的依赖:
22+
建议:在插件元数据中声明对 MinecraftDataAPI 的依赖:
2123

2224
```python
2325
PLUGIN_METADATA = {

0 commit comments

Comments
 (0)