Adding Items to my inventory in Java
<p>I am making a text-based game on JavaFX, and after I hit a tree, I want to get Oak logs. 
I have already built my inventory, and I have put default items in it such as Water, Bread, etc.
I am trying to add my Oak Logs to my inventory, but nothing is working.</p>

<p>Here is a part of my code:</p>

<pre><code>Item ItemList[] = {new Bread(), new OakLog()};
Optional&lt;ButtonType&gt; result = alert.showAndWait();
            if(result.get() == buttonTypeOak) {
                woodcuttingXP = woodcuttingXP + oakXP;
                dialogue.appendText("You swing at an Oak tree. + " + oakXP + "XP.\n");
                dialogue.appendText("You gathered 1 log.\n");
                mainCharacter.getInventory().add(new OakLog());
            }
</code></pre>

<p>Here is my Item Class:</p>

<pre><code>package game;

public class Item {
    private String name;
    private int weight;
    private int quantity;
    private int value;
    private String description;

public Item(String name, int value, String description) {
    this.name = name;
    this.value = value;
    this.description = description;
    }

public String getName() {
    return name;
}

public void setName(String name) {
    this.name = name;
}

public int getWeight() {
    return weight;
}

public void setWeight(int weight) {
    this.weight = weight;
}

public int getQuantity() {
    return quantity;
}

public void setQuantity(int quantity) {
    this.quantity = quantity;
}

public int getValue() {
    return value;
}

public void setValue(int value) {
    this.value = value;
}

public String getDescription() {
    return description;
}

public void setDescription(String description) {
    this.description = description;
}

public String toString() {
    return getName();
}
}
</code></pre>

<p>And finally, here is my Character class:</p>

<pre><code>package game;
import java.util.ArrayList;

import beverages.Water;
import items.OakLog;
import rawFood.Bread;

public class Character {
    private String name;
    private int hydrationLevel;
    private int healthLevel;
    private int hungerLevel;
    private int woodcuttingLevel;

    public int getWoodcuttingLevel() {
        return woodcuttingLevel;
    }

    public void setWoodcuttingLevel(int woodcuttingLevel) {
        this.woodcuttingLevel = woodcuttingLevel;
    }

    public int getHungerLevel() {
        return hungerLevel;
    }

    public void setHungerLevel(int hungerLevel) {
        this.hungerLevel = hungerLevel;
    }

    private ArrayList&lt;Item&gt; inventory = new ArrayList&lt;Item&gt;();

    public ArrayList&lt;Item&gt; getInventory() {
        return inventory;
    }

    public void setInventory(ArrayList&lt;Item&gt; inventory) {
        this.inventory = inventory;
    }

    //creates a person with two basic items
    public Character(String name){
        this.name = name;
        this.hydrationLevel = 100;
        this.healthLevel = 100; 
        this.hungerLevel = 100;
        this.woodcuttingLevel = 1;
        addToInventory (new Bread());
        addToInventory (new OakLog());
        addToInventory (new Water());
}

    //GETTERS AND SETTERS
    public String getName() {
        return name;
    }

    public int getHydrationLevel() {
        return hydrationLevel;
    }

    public void setHydrationLevel(int hydrationLevel) {
        this.hydrationLevel = hydrationLevel;
    }

    public int getHealthLevel() {
        return healthLevel;
    }

    public void setHealthLevel(int healthLevel) {
        this.healthLevel = healthLevel;
    }
    //END GETTERS AND SETTERS

    /*Method Name: eat()
     *Method Inputs: a piece of food 
     *Method Purpose: Will allow the user to eat food
     */

    public Item getItemFromInventory(int index){
        Item item = inventory.get(index);
        return item;
    }

    public void addToInventory(Item item){
        if(inventory.contains(item)){
            item.setQuantity(item.getQuantity()+1);
        }
        else{
            item.setQuantity(1);
            inventory.add(item);
        }
    }

    public String toString(){
        return "Character Stats:\nName:" +  getName() + "\nHydration: " + getHydrationLevel() + "\nHealth: " + getHealthLevel() + "\nWoodcutting: " + getWoodcuttingLevel(); 
    }

}
</code></pre>