mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-22 20:03:21 +00:00
World level updates without needing to restart
This commit is contained in:
parent
9b7293272b
commit
7cf0e448cd
@ -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) {
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user