mirror of
https://github.com/Melledy/LunarCore.git
synced 2025-12-12 13:24:36 +01:00
Fix train parlor map UI
This commit is contained in:
@@ -14,6 +14,7 @@ public class GameConstants {
|
|||||||
// Game
|
// Game
|
||||||
public static final String DEFAULT_NAME = "A Nameless";
|
public static final String DEFAULT_NAME = "A Nameless";
|
||||||
public static final int[] DEFAULT_HEAD_ICONS = {208001, 208002};
|
public static final int[] DEFAULT_HEAD_ICONS = {208001, 208002};
|
||||||
|
public static final int DEFAULT_WORLD_ID = 101;
|
||||||
public static final int TRAILBLAZER_AVATAR_ID = 8001;
|
public static final int TRAILBLAZER_AVATAR_ID = 8001;
|
||||||
public static final int MAX_TRAILBLAZER_LEVEL = 70;
|
public static final int MAX_TRAILBLAZER_LEVEL = 70;
|
||||||
public static final int[] WORLD_LEVEL_UPGRADES = {0, 20, 30, 40, 50, 60, 65};
|
public static final int[] WORLD_LEVEL_UPGRADES = {0, 20, 30, 40, 50, 60, 65};
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ public class Player implements Tickable {
|
|||||||
private int planeId;
|
private int planeId;
|
||||||
private int floorId;
|
private int floorId;
|
||||||
private int entryId;
|
private int entryId;
|
||||||
|
private int worldId;
|
||||||
|
|
||||||
private long lastActiveTime;
|
private long lastActiveTime;
|
||||||
|
|
||||||
@@ -800,6 +801,11 @@ public class Player implements Tickable {
|
|||||||
nextScene = new Scene(this, planeExcel, floorId);
|
nextScene = new Scene(this, planeExcel, floorId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set world id
|
||||||
|
if (planeExcel.getPlaneType() == PlaneType.Town || planeExcel.getPlaneType() == PlaneType.Maze) {
|
||||||
|
this.worldId = planeExcel.getWorldID();
|
||||||
|
}
|
||||||
|
|
||||||
// Set player position
|
// Set player position
|
||||||
this.getPos().set(pos);
|
this.getPos().set(pos);
|
||||||
this.getRot().set(rot);
|
this.getRot().set(rot);
|
||||||
@@ -918,6 +924,11 @@ public class Player implements Tickable {
|
|||||||
this.challengeInstance = null;
|
this.challengeInstance = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set default world id if we don't have it
|
||||||
|
if (this.worldId == 0) {
|
||||||
|
this.worldId = GameConstants.DEFAULT_WORLD_ID;
|
||||||
|
}
|
||||||
|
|
||||||
// Unstuck check, dont load player into raid scenes
|
// Unstuck check, dont load player into raid scenes
|
||||||
MazePlaneExcel planeExcel = GameData.getMazePlaneExcelMap().get(planeId);
|
MazePlaneExcel planeExcel = GameData.getMazePlaneExcelMap().get(planeId);
|
||||||
if (planeExcel == null || planeExcel.getPlaneType().getVal() >= PlaneType.Raid.getVal()) {
|
if (planeExcel == null || planeExcel.getPlaneType().getVal() >= PlaneType.Raid.getVal()) {
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ public class Scene implements Tickable {
|
|||||||
private final int planeId;
|
private final int planeId;
|
||||||
private final int floorId;
|
private final int floorId;
|
||||||
private int entryId;
|
private int entryId;
|
||||||
|
private int worldId;
|
||||||
@Setter private int leaveEntryId;
|
@Setter private int leaveEntryId;
|
||||||
|
|
||||||
private int lastEntityId = 0;
|
private int lastEntityId = 0;
|
||||||
@@ -72,6 +73,13 @@ public class Scene implements Tickable {
|
|||||||
this.healingSprings = new ObjectArrayList<>();
|
this.healingSprings = new ObjectArrayList<>();
|
||||||
this.triggers = new ObjectArrayList<>();
|
this.triggers = new ObjectArrayList<>();
|
||||||
|
|
||||||
|
// Set world id
|
||||||
|
if (this.getExcel().getPlaneType() == PlaneType.Train) {
|
||||||
|
this.worldId = player.getWorldId();
|
||||||
|
} else {
|
||||||
|
this.worldId = this.getExcel().getWorldID();
|
||||||
|
}
|
||||||
|
|
||||||
// Use singleton to avoid allocating memory for a new entity loader everytime we create a scene
|
// Use singleton to avoid allocating memory for a new entity loader everytime we create a scene
|
||||||
this.entityLoader = getExcel().getPlaneType().getSceneEntityLoader();
|
this.entityLoader = getExcel().getPlaneType().getSceneEntityLoader();
|
||||||
|
|
||||||
@@ -391,10 +399,10 @@ public class Scene implements Tickable {
|
|||||||
public synchronized SceneInfo toProto() {
|
public synchronized SceneInfo toProto() {
|
||||||
// Set loaded flag
|
// Set loaded flag
|
||||||
this.loaded = true;
|
this.loaded = true;
|
||||||
|
|
||||||
// Proto
|
// Proto
|
||||||
var proto = SceneInfo.newInstance()
|
var proto = SceneInfo.newInstance()
|
||||||
.setWorldId(this.getExcel().getWorldID())
|
.setWorldId(this.getWorldId())
|
||||||
.setGameModeType(this.getExcel().getPlaneType().getVal())
|
.setGameModeType(this.getExcel().getPlaneType().getVal())
|
||||||
.setPlaneId(this.getPlaneId())
|
.setPlaneId(this.getPlaneId())
|
||||||
.setFloorId(this.getFloorId())
|
.setFloorId(this.getFloorId())
|
||||||
|
|||||||
Reference in New Issue
Block a user