mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-02-07 18:46:49 +01:00
Spawn the player at the scene's start position when sent to a dungeon
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user