mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-29 07:07:05 +00:00
Add 'refinement' option to 'give' command
This commit is contained in:
parent
d0ccc48642
commit
48aea3f5e4
@ -158,7 +158,7 @@ public final class GiveCommand implements CommandHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean item(Player player, ItemData itemData, int amount, int lvl, int refinement) {
|
private void item(Player player, ItemData itemData, int amount, int lvl, int refinement) {
|
||||||
if (itemData.isEquip()) {
|
if (itemData.isEquip()) {
|
||||||
List<GameItem> items = new LinkedList<>();
|
List<GameItem> items = new LinkedList<>();
|
||||||
for (int i = 0; i < amount; i++) {
|
for (int i = 0; i < amount; i++) {
|
||||||
@ -188,12 +188,10 @@ public final class GiveCommand implements CommandHandler {
|
|||||||
items.add(item);
|
items.add(item);
|
||||||
}
|
}
|
||||||
player.getInventory().addItems(items, ActionReason.SubfieldDrop);
|
player.getInventory().addItems(items, ActionReason.SubfieldDrop);
|
||||||
return true;
|
|
||||||
} else {
|
} else {
|
||||||
GameItem item = new GameItem(itemData);
|
GameItem item = new GameItem(itemData);
|
||||||
item.setCount(amount);
|
item.setCount(amount);
|
||||||
player.getInventory().addItem(item, ActionReason.SubfieldDrop);
|
player.getInventory().addItem(item, ActionReason.SubfieldDrop);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user