Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
7cf0e448
Commit
7cf0e448
authored
Apr 26, 2022
by
Melledy
Browse files
World level updates without needing to restart
parent
9b729327
Changes
2
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/command/commands/SetWorldLevelCommand.java
View file @
7cf0e448
...
...
@@ -29,7 +29,7 @@ public final class SetWorldLevelCommand implements CommandHandler {
// Set in both world and player props
sender
.
getWorld
().
setWorldLevel
(
level
);
sender
.
set
Property
(
PlayerProperty
.
PROP_PLAYER_WORLD_LEVEL
,
level
);
sender
.
set
WorldLevel
(
level
);
sender
.
dropMessage
(
"World level set to "
+
level
+
"."
);
}
catch
(
NumberFormatException
ignored
)
{
...
...
src/main/java/emu/grasscutter/game/GenshinPlayer.java
View file @
7cf0e448
...
...
@@ -268,6 +268,11 @@ public class GenshinPlayer {
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
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment