Commit 7cf0e448 authored by Melledy's avatar Melledy
Browse files

World level updates without needing to restart

parent 9b729327
...@@ -29,7 +29,7 @@ public final class SetWorldLevelCommand implements CommandHandler { ...@@ -29,7 +29,7 @@ public final class SetWorldLevelCommand implements CommandHandler {
// Set in both world and player props // Set in both world and player props
sender.getWorld().setWorldLevel(level); sender.getWorld().setWorldLevel(level);
sender.setProperty(PlayerProperty.PROP_PLAYER_WORLD_LEVEL, level); sender.setWorldLevel(level);
sender.dropMessage("World level set to " + level + "."); sender.dropMessage("World level set to " + level + ".");
} catch (NumberFormatException ignored) { } catch (NumberFormatException ignored) {
......
...@@ -268,6 +268,11 @@ public class GenshinPlayer { ...@@ -268,6 +268,11 @@ public class GenshinPlayer {
return this.getProperty(PlayerProperty.PROP_PLAYER_WORLD_LEVEL); 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() { public int getPrimogems() {
return this.getProperty(PlayerProperty.PROP_PLAYER_HCOIN); return this.getProperty(PlayerProperty.PROP_PLAYER_HCOIN);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment