Update teleport docs and allow overriding Y coord when teleporting

This commit is contained in:
Angda Song 2022-05-04 14:13:23 -07:00 committed by Melledy
parent d62be2d1d7
commit 3edbed463b
3 changed files with 14 additions and 8 deletions

View File

@ -143,10 +143,12 @@ There is a dummy user named "Server" in every player's friends list that you can
### Bonus
When you want to teleport to somewhere, use the ingame marking function on Map, click Confirm. You will see your
character falling from a very high destination, exact location that you marked.
You can also specify a set Y coordinate by renaming the map marker.
- Teleporting
- When you want to teleport to somewhere, use the in-game marking function on Map.
- Mark a point on the map using the fish hook marking (the last one.)
- (Optional) rename the map marker to a number to override the default Y coordinate (height, default 300.)
- Confirm and close the map.
- You will see your character falling from a very high destination, exact location that you marked.
# Quick Troubleshooting

View File

@ -145,6 +145,12 @@ chmod +x gradlew
### 额外功能
当你想传送到某个地点, 只需要在地图中创建标记, 关闭地图后即可到达目标地点上空
- 传送
- 当你想传送到某个地点时,可以使用游戏里的地图标记功能。
- 用鱼钩(最后一个图标)在地图上标记一个点位。
- (可选) 将标记名称改为数字即可修改传送位置的Y坐标高度缺省值是300
- 确认添加标记,并关闭地图。
- 你会看到你的角色从你选定点位的正上方高空落下。
# 快速排除问题

View File

@ -70,9 +70,7 @@ public class HandlerMarkMapReq extends PacketHandler {
}
private void teleport(Player player, MapMark mapMark) {
// Increased height means you can fly to the top of dragonspine now,
// at the cost of slightly longer falling to your destination.
float y = 700;
float y = isInt(mapMark.getName()) ? Integer.parseInt(mapMark.getName()) : 300;
float x = mapMark.getPosition().getX();
float z = mapMark.getPosition().getZ();
player.getPos().set(x, y, z);