Skip to content

Commit ff7304d

Browse files
committed
Add feature "ptphere" and separate "ptpto" from mainCommand
- Fix bug where help message dividers are not aligned with the help title - Replace command "ptp <player>" with a new command "ptpto <player>" to send request to teleport to a player. - Add new command "ptphere <player>" to send request to a player to teleport to your current position - Add optional argument "(player)" for "ptpaccept (player)"/"ptpdeny (player)"/"ptpcancel (player)" to accept/deny/cancel a most recent request from/to a specific player.
1 parent e70d81a commit ff7304d

File tree

16 files changed

+619
-360
lines changed

16 files changed

+619
-360
lines changed

README.cn.md

Lines changed: 40 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,20 @@ See the English document [here](./README.md).
2020

2121
## 可用命令总览
2222

23-
| 命令 | 功能 |
24-
|-------------------------|------------|
25-
| `/ptp <玩家>` | 请求传送到指定玩家。 |
26-
| `/ptp <x> <y> <z>` | 传送到指定坐标。 |
27-
| `/ptp <维度> <x> <y> <z>` | 传送到指定维度坐标。 |
28-
| `/ptpback` | 回到上一次传送点。 |
29-
| `/ptphome` | 回家。 |
30-
| `/ptpsethome` | 设置家。 |
31-
| `/ptpaccept` | 接受传送请求。 |
32-
| `/ptpdeny` | 拒绝传送请求。 |
33-
| `/ptpcancel` | 取消传送请求。 |
23+
*指令中<>表示必填参数,()表示可选参数*
24+
25+
| 命令 | 功能 |
26+
|-------------------------|-----------------|
27+
| `/ptp` | 指令指南。 |
28+
| `/ptp (维度) <x> <y> <z>` | 传送到(指定维度的)指定坐标。 |
29+
| `/ptpto <玩家>` | 请求传送到指定玩家。 |
30+
| `/ptphere <玩家>` | 请求对方传送至自己当前位置。 |
31+
| `/ptpaccept (玩家)` | 接受(指定玩家的)传送请求。 |
32+
| `/ptpdeny (玩家)` | 拒绝(指定玩家的)传送请求。 |
33+
| `/ptpcancel (玩家)` | 取消(指定玩家的)传送请求。 |
34+
| `/ptpback` | 回到上一次传送点。 |
35+
| `/ptphome` | 回家。 |
36+
| `/ptphome set` | 设置家为当前位置。 |
3437

3538
---
3639

@@ -53,6 +56,8 @@ See the English document [here](./README.md).
5356
},
5457
"request": {
5558
"requestCommand": {
59+
"toommand": "ptpto",
60+
"hereCommand": "ptphere",
5661
"acceptCommand": "ptpaccept",
5762
"denyCommand": "ptpdeny",
5863
"cancelCommand": "ptpcancel"
@@ -109,11 +114,13 @@ See the English document [here](./README.md).
109114

110115
#### 请求命令
111116

112-
| 字段名 | 类型 | 说明 |
113-
|-----------------|----------|----------------------------|
114-
| `acceptCommand` | `string` | 接受请求的命令(默认 `/ptpaccept`|
115-
| `denyCommand` | `string` | 拒绝请求的命令(默认 `/ptpdeny`|
116-
| `cancelCommand` | `string` | 取消自己发出的请求(默认 `/ptpcancel`|
117+
| 字段名 | 类型 | 说明 |
118+
|-----------------|----------|------------------------------------|
119+
| `toCommand` | `string` | 请求传送至对方的命令(默认 `/ptpaccept`|
120+
| `hereCommand` | `string` | 请求对方传送至自己当前位置的命令(默认 `/ptpaccept`|
121+
| `acceptCommand` | `string` | 接受请求的命令(默认 `/ptpaccept`|
122+
| `denyCommand` | `string` | 拒绝请求的命令(默认 `/ptpdeny`|
123+
| `cancelCommand` | `string` | 取消自己发出的请求(默认 `/ptpcancel`|
117124

118125
#### 配置
119126

@@ -190,11 +197,11 @@ See the English document [here](./README.md).
190197
- 同一维度:
191198
- 直接使用欧氏距离。
192199
- 维度间传送:
193-
- 从主世界 → 下界:乘以 8 倍。
194-
- 从下界 → 主世界:乘以 0.125 倍。
195-
- 进入/离开末地:使用到原点 `(0,0,0)` 的距离。
200+
- 从主世界 × 8 → 下界;
201+
- 从下界 × 1.25 → 主世界;
202+
- 进入/离开末地:使用其中位于末地的坐标到末地中心 `(0,0,0)` 的距离。
196203
- 其他维度:
197-
- 暂时使用裸欧氏距离计算,如果你要魔改源码,可以在`PayTpCalculator`中的`calculatePrice`进行设置。
204+
- 暂时仅使用欧氏距离计算,如果你要魔改源码,可以在`PayTpCalculator`中的`calculatePrice`进行设置。
198205

199206
2. **计算公式**
200207

@@ -218,11 +225,11 @@ See the English document [here](./README.md).
218225

219226
```json
220227
{
221-
"minPrice": 1,
222-
"maxPrice": 64,
223-
"baseRadius": 10.0,
224-
"rate": 0.01,
225-
"crossDimMultiplier": 1.5
228+
"minPrice": 1,
229+
"maxPrice": 64,
230+
"baseRadius": 10.0,
231+
"rate": 0.01,
232+
"crossDimMultiplier": 1.5
226233
}
227234
```
228235

@@ -247,18 +254,18 @@ See the English document [here](./README.md).
247254

248255
## 兼容性与部署
249256

250-
| 类型 | 支持 |
251-
|-----------------------|-----------------------|
252-
| Fabric Loader ||
253-
| Server Only ||
254-
| 客户端 UI (Cloth Config) ||
255-
| 多语言支持 | zh_cn / zh_tw / en_us |
256-
| Minecraft 版本 | 1.21+ |
257+
| 类型 | 支持 |
258+
|-----------------------|------------------------|
259+
| Fabric Loader | |
260+
| Server Only | |
261+
| 客户端 UI (Cloth Config) | |
262+
| 多语言支持 | en_us / zh_cn / zh_tw |
263+
| Minecraft 版本 | 1.21.4+ |
257264

258265
---
259266

260267
## 致谢
261268

262-
本模组灵感来自早期经济型传送插件,请求逻辑参考TPA模组,使用 Fabric API 编写,兼容原版存档。
269+
本模组灵感来自早期经济型传送插件,请求逻辑参考**Teleport Command**模组,使用 Fabric API 编写,兼容原版存档。
263270
欢迎在 GitHub 上提交 Issue 或 PR 改进配置逻辑与算法。
264271

README.md

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,18 @@ It supports flexible teleportation modes, multi-language localization, and fully
2323

2424
## Commands
2525

26-
| Command | Description |
27-
|--------------------------------|-------------------------------------------------|
28-
| `/ptp <x> <y> <z>` | Teleport to specified coordinates |
29-
| `/ptp <dimension> <x> <y> <z>` | Teleport to coordinates in a specific dimension |
30-
| `/ptpaccept` | Accept a teleport request |
31-
| `/ptpdeny` | Deny a teleport request |
32-
| `/ptpcancel` | Cancel a pending teleport request |
33-
| `/ptpback` | Return to the previous location |
34-
| `/ptphome` | Teleport to your home (if configured) |
26+
| Command | Description |
27+
|--------------------------------|-------------------------------------------------------------|
28+
| `/ptp ` | Get command guide for PayTp. |
29+
| `/ptp (dimension) <x> <y> <z>` | Teleport to specified coordinates (in a specific dimension) |
30+
| `/ptpto <player>` | Send request to teleport to a player |
31+
| `/ptphere <player>` | Send request to a player to teleport to you |
32+
| `/ptpaccept (player)` | Accept a teleport request (from a specific player) |
33+
| `/ptpdeny (player)` | Deny a teleport request (from a specific player) |
34+
| `/ptpcancel (player)` | Cancel a pending teleport request (to a specific player) |
35+
| `/ptpback` | Return to the previous location |
36+
| `/ptphome` | Teleport to your home (if configured) |
37+
| `/ptphome set` | Set your home to your current position |
3538

3639
---
3740

@@ -54,6 +57,8 @@ It supports flexible teleportation modes, multi-language localization, and fully
5457
},
5558
"request": {
5659
"requestCommand": {
60+
"toCommand": "ptpto",
61+
"here": "ptphere",
5762
"acceptCommand": "ptpaccept",
5863
"denyCommand": "ptpdeny",
5964
"cancelCommand": "ptpcancel"
@@ -110,11 +115,13 @@ It supports flexible teleportation modes, multi-language localization, and fully
110115

111116
#### Request Commands
112117

113-
| Field | Type | Description |
114-
|-----------------|----------|----------------------------------------------------------|
115-
| `acceptCommand` | `string` | Command to accept a request (default `/ptpaccept`). |
116-
| `denyCommand` | `string` | Command to deny a request (default `/ptpdeny`). |
117-
| `cancelCommand` | `string` | Command to cancel a sent request (default `/ptpcancel`). |
118+
| Field | Type | Description |
119+
|-----------------|----------|-----------------------------------------------------------------------------------------|
120+
| `toCommand` | `string` | Command to request teleporting to the target player (default `/ptpto`). |
121+
| `hereCommand` | `string` | Command to request the target player to teleport to your location (default `/ptphere`). |
122+
| `acceptCommand` | `string` | Command to accept a request (default `/ptpaccept`). |
123+
| `denyCommand` | `string` | Command to deny a request (default `/ptpdeny`). |
124+
| `cancelCommand` | `string` | Command to cancel a sent request (default `/ptpcancel`). |
118125

119126
#### Configuration
120127

@@ -190,11 +197,11 @@ It supports flexible teleportation modes, multi-language localization, and fully
190197
- Same dimension:
191198
- Use direct Euclidean distance.
192199
- Cross-dimension:
193-
- Overworld → Nether: ×8
194-
- Nether → Overworld: ×0.125
195-
- Entering/leaving The End: use distance from origin `(0,0,0)`.
200+
- Overworld × 8 → Nether;
201+
- Nether × 0.125 → Overworld;
202+
- Entering/leaving The End: use the distance from whichever coordinate is in The End to the End center `(0,0,0)`.
196203
- Other dimensions:
197-
- Use Euclidean distance by default. Can customize in `PayTpCalculator#calculatePrice`.
204+
- Use Euclidean distance by default. Can customize in `PayTpCalculator#calculateDistance`.
198205

199206
2. **Formula**:
200207

@@ -218,11 +225,11 @@ Default `price` configuration:
218225

219226
```json
220227
{
221-
"minPrice": 1,
222-
"maxPrice": 64,
223-
"baseRadius": 10.0,
224-
"rate": 0.01,
225-
"crossDimMultiplier": 1.5
228+
"minPrice": 1,
229+
"maxPrice": 64,
230+
"baseRadius": 10.0,
231+
"rate": 0.01,
232+
"crossDimMultiplier": 1.5
226233
}
227234
```
228235

@@ -253,14 +260,14 @@ If the **Cloth Config API** is installed, all settings can be adjusted directly
253260
| Fabric Loader ||
254261
| Server Only ||
255262
| Client UI (Cloth Config) ||
256-
| Multi-language Support | zh_cn / zh_tw / en_us |
257-
| Minecraft Version | 1.21+ |
263+
| Multi-language Support | en_us / zh_cn / zh_tw |
264+
| Minecraft Version | 1.21.4+ |
258265

259266
---
260267

261268
## Credits
262269

263-
This mod is inspired by early economy-style teleport plugins. The request logic references the TPA mod.
270+
This mod is inspired by early economy-style teleport plugins. The request logic references the **Teleport Command** mod.
264271
Developed using Fabric API and fully compatible with vanilla saves.
265272
Feel free to submit issues or pull requests on GitHub to improve configuration and calculation algorithms.
266273

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ loom_version=1.11-SNAPSHOT
1616
fabric_version=0.136.0+1.21.10
1717

1818
# Mod Properties
19-
mod_version=1.0.0-1.21.10
19+
mod_version=1.1.0-1.21.10
2020
maven_group=com.flwolfy.paytp
2121
archives_base_name=pay-to-teleport
2222

0 commit comments

Comments
 (0)