Class PlayerBackpack

    • Constructor Detail

      • PlayerBackpack

        public PlayerBackpack​(PlayerProfile profile,
                              int id)
        This constructor loads an existing Backpack
        Parameters:
        profile - The PlayerProfile of this Backpack
        id - The id of this Backpack
      • PlayerBackpack

        public PlayerBackpack​(PlayerProfile profile,
                              int id,
                              int size)
        This constructor creates a new Backpack
        Parameters:
        profile - The PlayerProfile of this Backpack
        id - The id of this Backpack
        size - The size of this Backpack
    • Method Detail

      • getID

        public int getID​()
      • getSize

        public int getSize​()
      • getInventory

        public Inventory getInventory​()
      • open

        public void open​(Player... players)
        This will open the Inventory of this backpack to every Player that was passed onto this method.
        Parameters:
        players - The players who this Backpack will be shown to
      • setSize

        public void setSize​(int size)
        This will change the current size of this Backpack to the specified size.
        Parameters:
        size - The new size for this Backpack
      • save

        public void save​()
        This method will save the contents of this backpack to a File.
      • markDirty

        public void markDirty​()
        This method marks the backpack dirty, it will then be queued for an autosave using save()