Spawn the player at the scene's start position when sent to a dungeon

This commit is contained in:
KingRainbow44
2023-04-12 02:34:13 -04:00
parent 0de69cd1fa
commit 60eb62fa42
2 changed files with 26 additions and 1 deletions

View File

@@ -6,6 +6,9 @@ import emu.grasscutter.data.ResourceType;
import emu.grasscutter.data.excels.RewardPreviewData;
import emu.grasscutter.game.dungeons.enums.*;
import java.util.List;
import emu.grasscutter.scripts.data.SceneMeta;
import emu.grasscutter.utils.Position;
import lombok.Getter;
@ResourceType(name = "DungeonExcelConfigData.json")
@@ -62,6 +65,20 @@ public class DungeonData extends GameResource {
return involveType;
}
/**
* @return The position of the player when they enter the dungeon.
*/
public Position getStartPosition() {
return SceneMeta.of(this.getSceneId()).config.born_pos;
}
/**
* @return The rotation of the player when they enter the dungeon.
*/
public Position getStartRotation() {
return SceneMeta.of(this.getSceneId()).config.born_rot;
}
@Override
public void onLoad() {
if (this.passRewardPreviewID > 0) {