mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-16 08:56:04 +01:00
Add the dungeon ID to the transfer scene packet
This commit is contained in:
@@ -275,14 +275,17 @@ public class World implements Iterable<Player> {
|
|||||||
.teleportType(teleportType)
|
.teleportType(teleportType)
|
||||||
.enterReason(enterReason)
|
.enterReason(enterReason)
|
||||||
.teleportTo(teleportTo)
|
.teleportTo(teleportTo)
|
||||||
.enterType(EnterType.ENTER_TYPE_JUMP);
|
.enterType(EnterType.ENTER_TYPE_GOTO);
|
||||||
|
|
||||||
val sceneData = GameData.getSceneDataMap().get(sceneId);
|
val sceneData = GameData.getSceneDataMap().get(sceneId);
|
||||||
if (dungeonData != null) {
|
if (dungeonData != null) {
|
||||||
teleportProps
|
teleportProps
|
||||||
.teleportTo(dungeonData.getStartPosition())
|
.teleportTo(dungeonData.getStartPosition())
|
||||||
.teleportRot(dungeonData.getStartRotation());
|
.teleportRot(dungeonData.getStartRotation());
|
||||||
teleportProps.enterType(EnterType.ENTER_TYPE_DUNGEON).enterReason(EnterReason.DungeonEnter);
|
teleportProps
|
||||||
|
.enterType(EnterType.ENTER_TYPE_DUNGEON)
|
||||||
|
.enterReason(EnterReason.DungeonEnter);
|
||||||
|
teleportProps.dungeonId(dungeonData.getId());
|
||||||
} else if (player.getSceneId() == sceneId) {
|
} else if (player.getSceneId() == sceneId) {
|
||||||
teleportProps.enterType(EnterType.ENTER_TYPE_GOTO);
|
teleportProps.enterType(EnterType.ENTER_TYPE_GOTO);
|
||||||
} else if (sceneData != null && sceneData.getSceneType() == SceneType.SCENE_HOME_WORLD) {
|
} else if (sceneData != null && sceneData.getSceneType() == SceneType.SCENE_HOME_WORLD) {
|
||||||
@@ -326,7 +329,7 @@ public class World implements Iterable<Player> {
|
|||||||
|
|
||||||
var newScene = this.getSceneById(teleportProperties.getSceneId());
|
var newScene = this.getSceneById(teleportProperties.getSceneId());
|
||||||
newScene.addPlayer(player);
|
newScene.addPlayer(player);
|
||||||
player.setAvatarsAbilityForScene(newScene);
|
player.getTeamManager().applyAbilities(newScene);
|
||||||
|
|
||||||
// Dungeon
|
// Dungeon
|
||||||
// Dungeon system is handling this already
|
// Dungeon system is handling this already
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import lombok.Data;
|
|||||||
@Builder
|
@Builder
|
||||||
public class TeleportProperties {
|
public class TeleportProperties {
|
||||||
private final int sceneId;
|
private final int sceneId;
|
||||||
|
@Builder.Default private final int dungeonId = 0;
|
||||||
private final PlayerTeleportEvent.TeleportType teleportType;
|
private final PlayerTeleportEvent.TeleportType teleportType;
|
||||||
private final EnterReason enterReason;
|
private final EnterReason enterReason;
|
||||||
private Position teleportTo;
|
private Position teleportTo;
|
||||||
|
|||||||
@@ -100,6 +100,10 @@ public class PacketPlayerEnterSceneNotify extends BasePacket {
|
|||||||
+ "-"
|
+ "-"
|
||||||
+ 18402);
|
+ 18402);
|
||||||
|
|
||||||
|
if (teleportProperties.getDungeonId() != 0) {
|
||||||
|
proto.setDungeonId(teleportProperties.getDungeonId());
|
||||||
|
}
|
||||||
|
|
||||||
this.setData(proto);
|
this.setData(proto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user