mirror of
https://github.com/Anime-Game-Servers/Grasscutter-Quests.git
synced 2024-11-27 06:20:37 +00:00
Fix artifact & weapon generation by give command
This commit is contained in:
parent
4c1dc34c1f
commit
bce3e256cf
@ -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(genshinItem);
|
||||
items.add(new GenshinItem(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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user