mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
fix removing item by name
This commit is contained in:
@@ -1194,9 +1194,7 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void removeItem(String name) {
|
public void removeItem(String name) {
|
||||||
ItemData item = ItemListData.getItem(name);
|
inventoryItems.stream().filter(itemData -> name.equalsIgnoreCase(itemData.name)).findFirst().ifPresent(this::removeItem);
|
||||||
if (item != null)
|
|
||||||
removeItem(item);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeItem(ItemData item) {
|
public void removeItem(ItemData item) {
|
||||||
|
|||||||
Reference in New Issue
Block a user