mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-04 00:38:11 +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.
|
||||
*/
|
||||
public int add(int id, int amount) {
|
||||
Optional<Item> optionalItem = add(new Item(id, amount));
|
||||
return optionalItem.map(item -> optionalItem.isPresent() ? item.getAmount() : 0).get();
|
||||
Optional<Item> item = add(new Item(id, amount));
|
||||
return item.isPresent() ? item.get().getAmount() : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user