mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-29 20:00:16 +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) {
|
private void item(GenshinPlayer player, ItemData itemData, int amount) {
|
||||||
GenshinItem genshinItem = new GenshinItem(itemData);
|
|
||||||
if (itemData.isEquip()) {
|
if (itemData.isEquip()) {
|
||||||
List<GenshinItem> items = new LinkedList<>();
|
List<GenshinItem> items = new LinkedList<>();
|
||||||
for (int i = 0; i < amount; i++) {
|
for (int i = 0; i < amount; i++) {
|
||||||
items.add(genshinItem);
|
items.add(new GenshinItem(itemData));
|
||||||
}
|
}
|
||||||
player.getInventory().addItems(items);
|
player.getInventory().addItems(items);
|
||||||
player.sendPacket(new PacketItemAddHintNotify(items, ActionReason.SubfieldDrop));
|
player.sendPacket(new PacketItemAddHintNotify(items, ActionReason.SubfieldDrop));
|
||||||
} else {
|
} else {
|
||||||
|
GenshinItem genshinItem = new GenshinItem(itemData);
|
||||||
genshinItem.setCount(amount);
|
genshinItem.setCount(amount);
|
||||||
player.getInventory().addItem(genshinItem);
|
player.getInventory().addItem(genshinItem);
|
||||||
player.sendPacket(new PacketItemAddHintNotify(genshinItem, ActionReason.SubfieldDrop));
|
player.sendPacket(new PacketItemAddHintNotify(genshinItem, ActionReason.SubfieldDrop));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user