Skip to content

Commit

Permalink
v2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Ra1ny-Yuki committed Apr 7, 2024
1 parent 658d3a3 commit e322734
Show file tree
Hide file tree
Showing 12 changed files with 417 additions and 130 deletions.
46 changes: 36 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,46 @@ A [MCDReforged](https://github.com/Fallen-Breath/MCDReforged) plugin, inspired b

[MinecraftDataAPI](https://github.com/MCDReforged/MinecraftDataAPI/)

[MCDReforged](https://github.com/Fallen-Breath/MCDReforged) >= 2.1.3
[MCDReforged](https://github.com/Fallen-Breath/MCDReforged) >= 2.12.0

> Changed in v2.2:
>
> No longer supports MCDR v2.11 or earlier
## Commands

1. `!!whereis` or `!!vris`(can be modified in config):Show coordinate of other player

Command format: `!!whereis <player> [args(optional)]`
Command format: `!!whereis <player> [args(optional)]` (multiple players allowed)

​ Optional arguments could be following values (multiple arguments should be divided by space):

`-a` or `-s` arguments are allowed (can be called in one argument as `-as` or `-sa`)
`-a`, `--all` means broadcasting coordinate to all the players and highlight target player

`-a` means broadcasting coordinate to **a**ll the players and highlight target player
`-s`, `--sudo` allows querying coordinate of protected players

`-s` means **s**udo, allows querying coordinate of protected players
Both 2 arguments requires `admin` permission level in the config file of this plugin

​ Both 2 arguments requires `admin` permission level in the config file of this plugin
> Changed in v2.2:
>
> No longer supports arguments like `-as` and `-sa`, multiple players allowed
2. `!!here` (can be modified in config): Broadcast your current coordinate

​ Any `!!here` divided with space in chat message can be responded if inline here is enabled in config. **New in version 2.1**
> New in v2.1:
>
> Inline `!!here` command divided by space can be responded if enabled
Optional argument can be used with both commands: (unavailable for inline `!!here`)

`-h`, `--highlight` <duration> Set highlight target player time, overrides config settings

> Players won't be highlighted if their location is only queried, not broadcast
> New in v2.2:
>
> New optional argument `-h <duration>` introduced

## Config File

Expand All @@ -37,13 +58,14 @@ Calling `!!MCDR plg reload where_is` to reload is required to make it loaded aft

Here is the config items in the file

**WARNING: These 2 items which are marked with asterisk below should be configured manually before you update to 2.x or you'll lose all the configuration during loading the new version!!! You can ignore this message if you haven't install this plugin before**
> [!WARNING]
> These 2 items which are marked with asterisk below should be configured manually before you update to 2.x or you'll lose all the configuration during loading the new version!!! You can ignore this message if you haven't install this plugin before
| Keys | Value type | Default value | Introduction |
|----------------------------------|---------------------------------|-------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `enable_where_is` | `bool` | `true` | Set it to `true` to enable query other player location |
| `enable_here` | `bool` | `true` | Set it to `true` to enable broadcast your location |
| `enable_inline_here` | `bool` | `false` | Set it to `true` to make inline here enabled. **New in version 2.1** |
| `enable_inline_here` | `bool` | `false` | Set it to `true` to make inline here enabled. |
| *`command_prefix` | `dict`(which includes 2 items) | In the following sheets | Command prefix of this plugin |
| `broadcast_to_console` | `bool` | `true` | `!!here` or `!!vris <player> -a` will also send message to server console |
| `permission_requirements` | `dict`(which includes 3 items) | In the following sheets | Minimum permission of commands |
Expand All @@ -54,7 +76,11 @@ Here is the config items in the file
| `location_protection` | `dict`(which includes 5 items) | In the following sheets | Player coordinate protection configuration |
| `dimension_translation_mode` | `Literal['mcdr', 'minecraft']` | `'mcdr'` | `mcdr`: MCDReforged translates dimension names; `minecraft`: Minecraft translates dimension names. In 1.19 and later versions, using `mcdr` will avoid translation failure due to these dimension key change. |
| `custom_dimension_name` | `Dict[str, Dict[str, str]]` | Too long to show | A mapping of dimension name translation for `mcdr` translation mode. This fist layer keys are the languages. The second layer keys are the dimension IDs (Non-vanilla dimensions are allowed. vanilla dimensions are required to fill and should omit the namespace). |
| `custom_vanilla_translation_key` | `Dict[str, str]` | Too long to show | A mapping of dimension translation keys for `minecraft` translation mode. (Non-vanilla dimensions are allowed. vanilla dimensions are required to fill and should omit the namespace). **New in version 2.1** |
| `custom_vanilla_translation_key` | `Dict[str, str]` | Too long to show | A mapping of dimension translation keys for `minecraft` translation mode. (Non-vanilla dimensions are allowed. vanilla dimensions are required to fill and should omit the namespace). |

> New in v2.1:
>
> New configuration items: `inline_here` and `custom_vanilla_translation_key`
In the sheet above, the items which have stable items is showing below:

Expand Down
76 changes: 51 additions & 25 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,45 @@ Where Is

[MinecraftDataAPI](https://github.com/MCDReforged/MinecraftDataAPI/)

[MCDReforged](https://github.com/Fallen-Breath/MCDReforged) >= 2.1.3
[MCDReforged](https://github.com/Fallen-Breath/MCDReforged) >= 2.12.0

> 于 2.2 版本变更:
>
> 不再支持 MCDR 2.11 及更早版本
## 指令

1. `!!whereis` 或者 `!!vris`(可在配置文件中修改):显示一个其他玩家的坐标。

指令格式: `!!whereis <玩家> [参数(可选)]`
指令格式: `!!whereis <玩家> [参数(可选)]` (可以写多个玩家)

​ 可选参数可以为以下值(多个参数使用空格隔开):

可以加`-a` 或者 `-s`(可以合成一个参数写作 `-as` 或者 `-sa`)。
`-a`, `--all` 意为向所有玩家发送坐标并高亮该玩家

`-a` 意为向所有(**a**ll)玩家发送坐标并高亮该玩家;
`-s`, `--sudo` 意为提权,允许查看受保护的玩家的坐标

`-s` 意为提权(**s**udo),允许查看受保护的玩家的坐标。
两个参数均需要插件配置中设置的 `admin` 等级来执行

​ 两个参数均需要插件配置中设置的 `admin` 等级来执行。
> 于 2.2 版本变更:
>
> 不再支持 `-as``-sa` 形式的参数,允许添加多个玩家
2. `!!here` (可在配置文件中修改): 广播自己当前的坐标

​ 在配置文件中启用聊天中任意 here 指令解析时,聊天信息中用空格隔开的任意 `!!here` 字段均会被响应 **2.1新版功能**
> 2.1 新版功能:
>
> 在启用了配置项的情况下, 聊天行中空格隔开的 `!!here` 指令可以被响应
两条指令均可使用的可选参数: (对行中 `!!here` 无效)

`-h`, `--highlight` <时长> 设定目标玩家的高亮时长

> 其位置仅被查询而非被广播的情况下,不能高亮玩家
> 2.2 新版功能:
>
> 引入了新可选参数 `-h <duration>`
## 配置文件

Expand All @@ -37,24 +57,30 @@ Where Is

以下为配置文件内容

**警告:下方被星号标记的两项的值须在更新到2.x版本前手动配置,否则您将在加载新版本时丢失本插件的全部配置,若您此前从未安装过本插件可无视该条信息**

|| 值的类型 | 默认值 | 说明 |
|----------------------------------|--------------------------------|-------------------------|------------------------------------------------------------------------------------------|
| `enable_where_is` | `bool` | `true` | 设置为`true`以启用查询玩家坐标的功能 |
| `enable_here` | `bool` | `true` | 设置为`true`以启用广播自己坐标的功能 |
| `enable_here` | `bool` | `false` | 设置为 `true` 以允许聊天中任意 here 指令解析功能 **2.1 新版功能** |
| *`command_prefix` | `dict`(含固定的2个项目) | `'!!vris', '!!whereis'` | 插件指令前缀 |
| `broadcast_to_console` | `bool` | `true` | `!!here``!!vris <player> -a` 会将坐标信息同时显示在服务端控制台 |
| `permission_requirements` | `dict`(含固定的3个项目) | 见下表 | 指令要求的最小权限等级 |
| *`hightlight_time` | `dict`(含固定的2个项目) | 见下表 | 当包含 `-a` 参数时高亮玩家的时间 |
| `display_waypoints` | `dict`(含固定的2个项目) | 见下表 | 是否显示小地图坐标点 |
| `query_timeout` | `int` | `3` | Minecraft Data API的超时时间 |
| `click_to_teleport` | `bool` | `true` | 允许玩家点击补全传送指令 (仍需OP以执行) |
| `location_protection` | `dict`(含固定的5个项目) | 见下表 | 玩家坐标保护相关设定 |
| `dimension_translation_mode` | `Literal['mcdr', 'minecraft']` | `'mcdr'` | `mcdr`: 维度名称由MCDR翻译; `minecraft`: 维度名称由Minecraft翻译。在1.19及以上版本,用`mcdr`项可以避免因翻译键名改动造成的翻译失败 |
| `custom_dimension_name` | `Dict[str, Dict[str, str]` | 内容过长不便展示 | 由 MCDR 翻译的维度名称的翻译键值映射。首层键名为语言,二级键名为维度ID(支持非原版维度,原版维度必须填写且应去掉命名空间) |
| `custom_vanilla_translation_key` | `Dict[str, str]` | 内容过长不便展示 | 由 Minecraft 翻译的维度键名映射 (支持非原版维度,原版维度必须填写且应去掉命名空间). **2.1 新版功能** |
> [!WARNING]
> 下方被星号标记的两项的值须在更新到2.x版本前手动配置,否则您将在加载新版本时丢失本插件的全部配置,若您此前从未安装过本插件可无视该条信息
|| 值的类型 | 默认值 | 说明 |
|----------------------------------|--------------------------------|----------|------------------------------------------------------------------------------------------|
| `enable_where_is` | `bool` | `true` | 设置为`true`以启用查询玩家坐标的功能 |
| `enable_here` | `bool` | `true` | 设置为`true`以启用广播自己坐标的功能 |
| `enable_here` | `bool` | `false` | 设置为 `true` 以允许聊天中任意 here 指令解析功能 |
| *`command_prefix` | `dict`(含固定的2个项目) | 见下表 | 插件指令前缀 |
| `broadcast_to_console` | `bool` | `true` | `!!here``!!vris <player> -a` 会将坐标信息同时显示在服务端控制台 |
| `permission_requirements` | `dict`(含固定的3个项目) | 见下表 | 指令要求的最小权限等级 |
| *`hightlight_time` | `dict`(含固定的2个项目) | 见下表 | 当包含 `-a` 参数时高亮玩家的时间 |
| `display_waypoints` | `dict`(含固定的2个项目) | 见下表 | 是否显示小地图坐标点 |
| `query_timeout` | `int` | `3` | Minecraft Data API的超时时间 |
| `click_to_teleport` | `bool` | `true` | 允许玩家点击补全传送指令 (仍需OP以执行) |
| `location_protection` | `dict`(含固定的5个项目) | 见下表 | 玩家坐标保护相关设定 |
| `dimension_translation_mode` | `Literal['mcdr', 'minecraft']` | `'mcdr'` | `mcdr`: 维度名称由MCDR翻译; `minecraft`: 维度名称由Minecraft翻译。在1.19及以上版本,用`mcdr`项可以避免因翻译键名改动造成的翻译失败 |
| `custom_dimension_name` | `Dict[str, Dict[str, str]` | 内容过长不便展示 | 由 MCDR 翻译的维度名称的翻译键值映射。首层键名为语言,二级键名为维度ID(支持非原版维度,原版维度必须填写且应去掉命名空间) |
| `custom_vanilla_translation_key` | `Dict[str, str]` | 内容过长不便展示 | 由 Minecraft 翻译的维度键名映射 (支持非原版维度,原版维度必须填写且应去掉命名空间). |


> 2.1 新版功能:
>
> 新的配置项目: `inline_here``custom_vanilla_translation_key`

上述提到的含固定键值对的的配置项如下:
Expand Down
Binary file modified img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 18 additions & 1 deletion lang/en_us.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
where_is:
help:
detailed: |
§7--------§9 {name} §rv{ver} §7--------§r
Query other player's location
§d[Basic usage]§r
§7{vris} §5<player>§3 [optional]§r Query player's location
§7{here} §3[optional]§r §rBroadcast your own location
§d[Advanced usage]§r
Argument §5<player>§r allows multiple players
Argument §3[optional]§r for command §7{vris}§r:
§8> §b-a§7, §b--all§r Broadcast player's location
§8> §b-s§7, §b--sudo§r Allow to query protected player
Argument §3[optional]§r for both commands:
§8> §b-h§7, §b--highlight§6 <duration>§r Set highlight time
vris: Query location of other player
here: Broadcast your own location
suggest: Click to fill command §7{}
err:
generic: "Error occurred: {}"
not_online: "Required player is not online"
not_online: "Required player {} is not online"
perm_denied: "Permission denied"
invalid_args: "Invalid argument"
warn:
Expand Down
21 changes: 19 additions & 2 deletions lang/zh_cn.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
where_is:
help:
detailed: |
§7--------§9 {name} §rv{ver} §7--------§r
查询其他玩家的位置
§d【基础用法】§r
§7{vris} §5<玩家>§3 [可选参数]§r 查询玩家的位置
§7{here} §r广播你自己的位置
§d【进阶用法】§r
参数 §5<玩家>§r 允许添加多个玩家
指令 §7{vris}§r 的 §3[可选参数]§r 可为:
§8> §b-a§7, §b--all§r 广播查询到的玩家位置
§8> §b-s§7, §b--sudo§r 允许查询受保护的玩家
适用于所有指令的参数 §3[可选参数]§r:
§8> §b-h§7, §b--highlight§6 <时长>§r 设置高亮时长
vris: 查询其他玩家的位置
here: 广播你自己的位置
suggest: 点击填入指令 §7{}
err:
generic: "出现错误: {}"
not_online: "这玩家不在线啊"
generic: "出现错误: §4{}"
not_online: "玩家 §4{}§c 不在线"
perm_denied: "权限不足"
invalid_args: "无效的参数"
warn:
Expand Down
Loading

0 comments on commit e322734

Please sign in to comment.