diff --git a/src/main/java/emu/grasscutter/game/player/Player.java b/src/main/java/emu/grasscutter/game/player/Player.java index ef3abc7f7..1d1f80e51 100644 --- a/src/main/java/emu/grasscutter/game/player/Player.java +++ b/src/main/java/emu/grasscutter/game/player/Player.java @@ -187,7 +187,7 @@ public class Player { this.birthday = new PlayerBirthday(); this.rewardedLevels = new HashSet<>(); this.moonCardGetTimes = new HashSet<>(); - this.codex = new PlayerCodex(); + this.codex = new PlayerCodex(this); this.shopLimit = new ArrayList<>(); this.expeditionInfo = new HashMap<>(); @@ -208,7 +208,7 @@ public class Player { this.signature = ""; this.teamManager = new TeamManager(this); this.birthday = new PlayerBirthday(); - this.codex = new PlayerCodex(); + this.codex = new PlayerCodex(this); this.setProperty(PlayerProperty.PROP_PLAYER_LEVEL, 1); this.setProperty(PlayerProperty.PROP_IS_SPRING_AUTO_USE, 1); this.setProperty(PlayerProperty.PROP_SPRING_AUTO_USE_PERCENT, 50); @@ -1174,6 +1174,9 @@ public class Player { if (this.getTeamManager() == null) { this.teamManager = new TeamManager(this); } + if (this.getCodex() == null) { + this.codex = new PlayerCodex(this); + } if (this.getProfile().getUid() == 0) { this.getProfile().syncWithCharacter(this); } diff --git a/src/main/java/emu/grasscutter/game/player/PlayerCodex.java b/src/main/java/emu/grasscutter/game/player/PlayerCodex.java index 909848150..a310f4772 100644 --- a/src/main/java/emu/grasscutter/game/player/PlayerCodex.java +++ b/src/main/java/emu/grasscutter/game/player/PlayerCodex.java @@ -39,6 +39,11 @@ public class PlayerCodex { this.unlockedReliquarySuitCodex = new HashSet<>(); } + public PlayerCodex(Player player){ + this(); + this.player = player; + } + public void setPlayer(Player player) { this.player = player; }