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
f11138de
Commit
f11138de
authored
Apr 18, 2022
by
KingRainbow44
Browse files
Fix bugs with commands
parent
2e01c7d5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/commands/PlayerCommands.java
View file @
f11138de
...
...
@@ -41,7 +41,7 @@ public final class PlayerCommands {
case
1
:
try
{
item
=
Integer
.
parseInt
(
args
.
get
(
0
));
target
=
player
.
getId
();
target
=
player
.
get
Account
().
getPlayer
Id
();
}
catch
(
NumberFormatException
ignored
)
{
// TODO: Parse from item name using GM Handbook.
CommandHandler
.
sendMessage
(
player
,
"Invalid item id."
);
...
...
@@ -147,7 +147,7 @@ public final class PlayerCommands {
@Override
public
void
execute
(
GenshinPlayer
player
,
List
<
String
>
args
)
{
if
(
args
.
size
()
<
1
)
{
CommandHandler
.
sendMessage
(
null
,
"Usage: drop <itemId|itemName> [amount]"
);
CommandHandler
.
sendMessage
(
player
,
"Usage: drop <itemId|itemName> [amount]"
);
return
;
}
...
...
@@ -157,7 +157,7 @@ public final class PlayerCommands {
ItemData
itemData
=
GenshinData
.
getItemDataMap
().
get
(
item
);
if
(
itemData
==
null
)
{
CommandHandler
.
sendMessage
(
null
,
"Invalid item id."
);
return
;
CommandHandler
.
sendMessage
(
player
,
"Invalid item id."
);
return
;
}
if
(
itemData
.
isEquip
())
{
...
...
@@ -172,7 +172,7 @@ public final class PlayerCommands {
player
.
getWorld
().
addEntity
(
entity
);
}
}
catch
(
NumberFormatException
ignored
)
{
CommandHandler
.
sendMessage
(
null
,
"Invalid item or player ID."
);
CommandHandler
.
sendMessage
(
player
,
"Invalid item or player ID."
);
}
}
}
...
...
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