diff --git a/src/main/java/emu/grasscutter/command/commands/SetWorldLevelCommand.java b/src/main/java/emu/grasscutter/command/commands/SetWorldLevelCommand.java index 146837523..2499293d4 100644 --- a/src/main/java/emu/grasscutter/command/commands/SetWorldLevelCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/SetWorldLevelCommand.java @@ -29,7 +29,7 @@ public final class SetWorldLevelCommand implements CommandHandler { // Set in both world and player props sender.getWorld().setWorldLevel(level); - sender.setProperty(PlayerProperty.PROP_PLAYER_WORLD_LEVEL, level); + sender.setWorldLevel(level); sender.dropMessage("World level set to " + level + "."); } catch (NumberFormatException ignored) { diff --git a/src/main/java/emu/grasscutter/game/GenshinPlayer.java b/src/main/java/emu/grasscutter/game/GenshinPlayer.java index 9df81955b..ad0fe248d 100644 --- a/src/main/java/emu/grasscutter/game/GenshinPlayer.java +++ b/src/main/java/emu/grasscutter/game/GenshinPlayer.java @@ -267,6 +267,11 @@ public class GenshinPlayer { public int getWorldLevel() { return this.getProperty(PlayerProperty.PROP_PLAYER_WORLD_LEVEL); } + + public void setWorldLevel(int level) { + this.setProperty(PlayerProperty.PROP_PLAYER_WORLD_LEVEL, level); + this.sendPacket(new PacketPlayerPropNotify(this, PlayerProperty.PROP_PLAYER_WORLD_LEVEL)); + } public int getPrimogems() { return this.getProperty(PlayerProperty.PROP_PLAYER_HCOIN);