public void remove(String item) { for (Item i : inventory) { if (i.getName() == item) { inventory.remove(i); System.out.println("Item " + item + " removed from inventory."); } } }
public void add(Item i) { System.out.println(Player.getPlayer().getName() + " has picked up: " + i.getName() + "."); inventory.add(i); }