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
1c15dd3c
Commit
1c15dd3c
authored
Apr 24, 2022
by
BaiSugar
Browse files
fix
parent
5eeea84f
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/command/commands/GiveAllCommand.java
View file @
1c15dd3c
...
...
@@ -21,7 +21,7 @@ public class GiveAllCommand implements CommandHandler {
int
target
,
amount
=
99999
;
switch
(
args
.
size
())
{
default
:
//
giveall
*no args*
default
:
// *no args*
try
{
target
=
sender
.
getUid
();
}
catch
(
NullPointerException
ignored
){
...
...
@@ -29,7 +29,7 @@ public class GiveAllCommand implements CommandHandler {
return
;
}
break
;
case
1
:
//[player]
case
1
:
//
[player]
try
{
target
=
Integer
.
parseInt
(
args
.
get
(
0
));
if
(
Grasscutter
.
getGameServer
().
getPlayerByUid
(
target
)
==
null
)
{
...
...
@@ -37,11 +37,11 @@ public class GiveAllCommand implements CommandHandler {
return
;
}
}
catch
(
NumberFormatException
ignored
){
CommandHandler
.
sendMessage
(
sender
,
"Invalid
amount or
player ID."
);
CommandHandler
.
sendMessage
(
sender
,
"Invalid player ID."
);
return
;
}
break
;
case
2
:
//[player] [amount]
case
2
:
//
[player] [amount]
try
{
target
=
Integer
.
parseInt
(
args
.
get
(
0
));
if
(
Grasscutter
.
getGameServer
().
getPlayerByUid
(
target
)
==
null
&&
sender
!=
null
)
{
...
...
@@ -85,19 +85,11 @@ public class GiveAllCommand implements CommandHandler {
}
player
.
getInventory
().
addItems
(
genshinItemList
);
for
(
AvatarData
avatarData:
GenshinData
.
getAvatarDataMap
().
values
())
{
int
ascension
;
int
level
=
90
;
for
(
AvatarData
avatarData:
GenshinData
.
getAvatarDataMap
().
values
())
{
// Calculate ascension level.
if
(
level
<=
40
)
{
ascension
=
(
int
)
Math
.
ceil
(
90
/
20
f
);
}
else
{
ascension
=
(
int
)
Math
.
ceil
(
90
/
10
f
)
-
3
;
}
int
ascension
=
(
int
)
Math
.
ceil
(
90
/
10
f
)
-
3
;
GenshinAvatar
avatar
=
new
GenshinAvatar
(
avatarData
);
avatar
.
setLevel
(
level
);
avatar
.
setLevel
(
90
);
avatar
.
setPromoteLevel
(
ascension
);
for
(
int
i
=
1
;
i
<=
6
;
i
++){
avatar
.
getTalentIdList
().
add
((
avatar
.
getAvatarId
()-
10000000
)*
10
+
i
);
//(10000058-10000000)*10+i
...
...
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