mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-07 16:49:12 +00:00
Don't map item amount in Inventory#add(int, int).
This commit is contained in:
@@ -117,8 +117,8 @@ public final class Inventory {
|
|||||||
* @return The amount that remains.
|
* @return The amount that remains.
|
||||||
*/
|
*/
|
||||||
public int add(int id, int amount) {
|
public int add(int id, int amount) {
|
||||||
Optional<Item> optionalItem = add(new Item(id, amount));
|
Optional<Item> item = add(new Item(id, amount));
|
||||||
return optionalItem.map(item -> optionalItem.isPresent() ? item.getAmount() : 0).get();
|
return item.isPresent() ? item.get().getAmount() : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user