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
bf61d6fb
Commit
bf61d6fb
authored
Apr 21, 2022
by
Melledy
Committed by
GitHub
Apr 21, 2022
Browse files
Merge pull request #79 from zamlty/development
Fix artifact & weapon generation by give command
parents
bfdb0aa5
bce3e256
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/command/commands/GiveCommand.java
View file @
bf61d6fb
...
...
@@ -95,18 +95,19 @@ public final class GiveCommand implements CommandHandler {
}
private
void
item
(
GenshinPlayer
player
,
ItemData
itemData
,
int
amount
)
{
GenshinItem
genshinItem
=
new
GenshinItem
(
itemData
);
if
(
itemData
.
isEquip
())
{
List
<
GenshinItem
>
items
=
new
LinkedList
<>();
for
(
int
i
=
0
;
i
<
amount
;
i
++)
{
items
.
add
(
g
enshinItem
);
items
.
add
(
new
G
enshinItem
(
itemData
)
);
}
player
.
getInventory
().
addItems
(
items
);
player
.
sendPacket
(
new
PacketItemAddHintNotify
(
items
,
ActionReason
.
SubfieldDrop
));
}
else
{
GenshinItem
genshinItem
=
new
GenshinItem
(
itemData
);
genshinItem
.
setCount
(
amount
);
player
.
getInventory
().
addItem
(
genshinItem
);
player
.
sendPacket
(
new
PacketItemAddHintNotify
(
genshinItem
,
ActionReason
.
SubfieldDrop
));
}
}
}
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