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
c728b9f5
Commit
c728b9f5
authored
Apr 19, 2022
by
KingRainbow44
Browse files
Attempt to fix `!givechar`
parent
69cb03f4
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/commands/PlayerCommands.java
View file @
c728b9f5
...
...
@@ -186,12 +186,12 @@ public final class PlayerCommands {
}
@Command
(
label
=
"givechar"
,
aliases
=
{
"givec"
},
usage
=
"Usage: givechar <player|avatarId> [avatarId] [level]"
)
usage
=
"Usage: givechar <player|avatarId> [
level|
avatarId] [level]"
)
public
static
class
GiveCharCommand
implements
CommandHandler
{
@Override
public
void
execute
(
GenshinPlayer
player
,
List
<
String
>
args
)
{
int
target
,
avatarId
,
level
=
1
,
ascension
=
1
;
if
(
args
.
size
()
<
2
)
{
if
(
args
.
size
()
<
1
)
{
CommandHandler
.
sendMessage
(
player
,
"Usage: givechar <player> <avatarId> [level]"
);
return
;
}
...
...
@@ -204,7 +204,8 @@ public final class PlayerCommands {
try
{
target
=
Integer
.
parseInt
(
args
.
get
(
0
));
if
(
Grasscutter
.
getGameServer
().
getPlayerByUid
(
target
)
==
null
)
{
target
=
player
.
getUid
();
level
=
Integer
.
parseInt
(
args
.
get
(
1
));
target
=
player
.
getUid
();
level
=
Integer
.
parseInt
(
args
.
get
(
1
));
avatarId
=
Integer
.
parseInt
(
args
.
get
(
0
));
}
else
{
avatarId
=
Integer
.
parseInt
(
args
.
get
(
1
));
...
...
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