Skip to content

Commit

Permalink
fixed respawn issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Globox1997 committed Nov 28, 2024
1 parent f4f72e2 commit c3f3bec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
### Fixed:
- Fixed npe
- Fixed registry issue
- Fixed respawn issue
### Changed:
-
7 changes: 6 additions & 1 deletion src/main/java/net/levelz/util/PacketHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ public static void updateSkills(ServerPlayerEntity serverPlayerEntity) {
public static void updatePlayerSkills(ServerPlayerEntity serverPlayerEntity, @Nullable ServerPlayerEntity oldPlayerEntity) {
LevelManager levelManager = ((LevelManagerAccess) serverPlayerEntity).getLevelManager();
if (oldPlayerEntity != null) {
levelManager = ((LevelManagerAccess) oldPlayerEntity).getLevelManager();
LevelManager oldLevelManager = ((LevelManagerAccess) oldPlayerEntity).getLevelManager();
levelManager.setPlayerSkills(oldLevelManager.getPlayerSkills());
levelManager.setOverallLevel(oldLevelManager.getOverallLevel());
levelManager.setTotalLevelExperience(oldLevelManager.getTotalLevelExperience());
levelManager.setSkillPoints(oldLevelManager.getSkillPoints());
levelManager.setLevelProgress(oldLevelManager.getLevelProgress());
}
List<Integer> playerSkillIds = new ArrayList<>();
List<Integer> playerSkillLevels = new ArrayList<>();
Expand Down

0 comments on commit c3f3bec

Please sign in to comment.