mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-26 05:04:20 +00:00
commit
3ae30e3c79
@ -212,7 +212,10 @@ public class World implements Iterable<GenshinPlayer> {
|
||||
return false;
|
||||
}
|
||||
|
||||
Integer oldSceneId = null;
|
||||
|
||||
if (player.getScene() != null) {
|
||||
oldSceneId = player.getScene().getId();
|
||||
player.getScene().removePlayer(player);
|
||||
}
|
||||
|
||||
@ -221,7 +224,11 @@ public class World implements Iterable<GenshinPlayer> {
|
||||
player.getPos().set(pos);
|
||||
|
||||
// Teleport packet
|
||||
player.sendPacket(new PacketPlayerEnterSceneNotify(player, EnterType.EnterSelf, EnterReason.TransPoint, sceneId, pos));
|
||||
if (oldSceneId.equals(sceneId)) {
|
||||
player.sendPacket(new PacketPlayerEnterSceneNotify(player, EnterType.EnterGoto, EnterReason.TransPoint, sceneId, pos));
|
||||
} else {
|
||||
player.sendPacket(new PacketPlayerEnterSceneNotify(player, EnterType.EnterJump, EnterReason.TransPoint, sceneId, pos));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ public class PacketPlayerEnterSceneNotify extends GenshinPacket {
|
||||
.setSceneId(newScene)
|
||||
.setPos(newPos.toProto())
|
||||
.setSceneBeginTime(System.currentTimeMillis())
|
||||
.setType(EnterType.EnterSelf)
|
||||
.setType(type)
|
||||
.setTargetUid(target.getUid())
|
||||
.setEnterSceneToken(player.getEnterSceneToken())
|
||||
.setWorldLevel(target.getWorld().getWorldLevel())
|
||||
|
Loading…
Reference in New Issue
Block a user