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
60319ee9
Commit
60319ee9
authored
Apr 24, 2022
by
BaiSugar
Browse files
Corrected format
parent
07969577
Changes
3
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/command/Command.java
View file @
60319ee9
src/main/java/emu/grasscutter/command/CommandMap.java
View file @
60319ee9
...
@@ -136,9 +136,11 @@ public final class CommandMap {
...
@@ -136,9 +136,11 @@ public final class CommandMap {
}
}
// Invoke execute method for handler.
// Invoke execute method for handler.
// Get whether the command starts a thread
boolean
threading
=
this
.
annotations
.
get
(
label
).
threading
();
boolean
threading
=
this
.
annotations
.
get
(
label
).
threading
();
Runnable
runnable
=
()
->
handler
.
execute
(
player
,
args
);
Runnable
runnable
=
()
->
handler
.
execute
(
player
,
args
);
if
(
threading
)
{
if
(
threading
)
{
//start thread
Thread
command
=
new
Thread
(
runnable
);
Thread
command
=
new
Thread
(
runnable
);
command
.
start
();
command
.
start
();
}
}
...
...
src/main/java/emu/grasscutter/command/commands/GiveAllCommand.java
View file @
60319ee9
package
emu.grasscutter.command.commands
;
package
emu.grasscutter.command.commands
;
import
com.thoughtworks.proxy.toys.nullobject.Null
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.Grasscutter
;
import
emu.grasscutter.command.Command
;
import
emu.grasscutter.command.Command
;
import
emu.grasscutter.command.CommandHandler
;
import
emu.grasscutter.command.CommandHandler
;
...
@@ -22,7 +21,7 @@ public class GiveAllCommand implements CommandHandler {
...
@@ -22,7 +21,7 @@ public class GiveAllCommand implements CommandHandler {
int
target
,
amount
=
99999
;
int
target
,
amount
=
99999
;
switch
(
args
.
size
())
{
switch
(
args
.
size
())
{
default
:
//
giveall
*no args*
default
:
// *no args*
try
{
try
{
target
=
sender
.
getUid
();
target
=
sender
.
getUid
();
}
catch
(
NullPointerException
ignored
){
}
catch
(
NullPointerException
ignored
){
...
@@ -38,7 +37,7 @@ public class GiveAllCommand implements CommandHandler {
...
@@ -38,7 +37,7 @@ public class GiveAllCommand implements CommandHandler {
return
;
return
;
}
}
}
catch
(
NumberFormatException
ignored
){
}
catch
(
NumberFormatException
ignored
){
CommandHandler
.
sendMessage
(
sender
,
"Invalid
amount or
player ID."
);
CommandHandler
.
sendMessage
(
sender
,
"Invalid player ID."
);
return
;
return
;
}
}
break
;
break
;
...
@@ -73,7 +72,7 @@ public class GiveAllCommand implements CommandHandler {
...
@@ -73,7 +72,7 @@ public class GiveAllCommand implements CommandHandler {
Collection
<
GenshinItem
>
genshinItemList
=
new
LinkedList
<>();
Collection
<
GenshinItem
>
genshinItemList
=
new
LinkedList
<>();
for
(
ItemData
itemdata:
GenshinData
.
getItemDataMap
().
values
())
{
for
(
ItemData
itemdata:
GenshinData
.
getItemDataMap
().
values
())
{
if
(
itemdata
.
getId
()
>
1000
&&
itemdata
.
getId
()
<=
1099
)
continue
;
//is avatar
if
(
itemdata
.
getId
()
>
1000
&&
itemdata
.
getId
()
<=
1099
)
continue
;
if
(
itemdata
.
isEquip
())
{
if
(
itemdata
.
isEquip
())
{
for
(
int
i
=
0
;
i
<
20
;
i
++)
{
for
(
int
i
=
0
;
i
<
20
;
i
++)
{
genshinItemList
.
add
(
new
GenshinItem
(
itemdata
));
genshinItemList
.
add
(
new
GenshinItem
(
itemdata
));
...
@@ -86,22 +85,14 @@ public class GiveAllCommand implements CommandHandler {
...
@@ -86,22 +85,14 @@ public class GiveAllCommand implements CommandHandler {
}
}
player
.
getInventory
().
addItems
(
genshinItemList
);
player
.
getInventory
().
addItems
(
genshinItemList
);
for
(
AvatarData
avatarData:
GenshinData
.
getAvatarDataMap
().
values
())
for
(
AvatarData
avatarData:
GenshinData
.
getAvatarDataMap
().
values
())
{
{
int
ascension
;
int
level
=
90
;
// Calculate ascension level.
// Calculate ascension level.
if
(
level
<=
40
)
{
int
ascension
=
(
int
)
Math
.
ceil
(
90
/
10
f
)
-
3
;
ascension
=
(
int
)
Math
.
ceil
(
90
/
20
f
);
}
else
{
ascension
=
(
int
)
Math
.
ceil
(
90
/
10
f
)
-
3
;
}
GenshinAvatar
avatar
=
new
GenshinAvatar
(
avatarData
);
GenshinAvatar
avatar
=
new
GenshinAvatar
(
avatarData
);
avatar
.
setLevel
(
level
);
avatar
.
setLevel
(
90
);
avatar
.
setPromoteLevel
(
ascension
);
avatar
.
setPromoteLevel
(
ascension
);
for
(
int
i
=
1
;
i
<=
6
;
i
++){
for
(
int
i
=
1
;
i
<=
6
;
i
++){
avatar
.
getTalentIdList
().
add
((
avatar
.
getAvatarId
()-
10000000
)*
10
+
i
);
//(10000058-10000000)*10+i
avatar
.
getTalentIdList
().
add
((
avatar
.
getAvatarId
()-
10000000
)*
10
+
i
);
}
}
// This will handle stats and talents
// This will handle stats and talents
avatar
.
recalcStats
();
avatar
.
recalcStats
();
...
...
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