Class BagCreationObject

java.lang.Object
valorless.havenbags.api.BagCreationObject

public class BagCreationObject extends Object
Represents the necessary information to create a custom bag in the HavenBags plugin. This object holds details such as the bag's unique identifier (UUID), owner, contents, and the player who created it.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor to initialize a BagCreationObject with a specified size for contents.
    BagCreationObject(List<org.bukkit.inventory.ItemStack> contents)
    Constructor to initialize a BagCreationObject with specified contents.
  • Method Summary

    Modifier and Type
    Method
    Description
    List<org.bukkit.inventory.ItemStack>
    Gets the list of ItemStacks representing the bag's contents.
    Gets the player who created this bag.
    Gets the UUID string of the bag's owner.
    Gets the unique identifier (UUID string) for this bag.
    void
    setContents(List<org.bukkit.inventory.ItemStack> contents)
    Replaces the bag's contents with the provided list.
    void
    setCreator(String creator)
    Sets the player who created this bag.
    void
    Sets the UUID string of the bag's owner.
    void
    Sets the unique identifier (UUID string) for this bag.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BagCreationObject

      public BagCreationObject(int size)
      Constructor to initialize a BagCreationObject with a specified size for contents. All contents are initialized to null.
      Parameters:
      size - the initial size of the bag's contents list, by the power of 9 (e.g., size=27 for 3 rows)
    • BagCreationObject

      public BagCreationObject(List<org.bukkit.inventory.ItemStack> contents)
      Constructor to initialize a BagCreationObject with specified contents.
      Parameters:
      contents - the list of ItemStacks to be included in the bag
  • Method Details

    • getUuid

      public String getUuid()
      Gets the unique identifier (UUID string) for this bag.
      Returns:
      the bag's UUID string
    • setUuid

      public void setUuid(String uuid)
      Sets the unique identifier (UUID string) for this bag.
      Parameters:
      uuid - the UUID string to assign to this bag
    • getOwner

      public String getOwner()
      Gets the UUID string of the bag's owner.
      Returns:
      the owner's UUID string, or "ownerless" if none is set
    • setOwner

      public void setOwner(String owner)
      Sets the UUID string of the bag's owner.
      Parameters:
      owner - the owner's UUID string
    • getContents

      public List<org.bukkit.inventory.ItemStack> getContents()
      Gets the list of ItemStacks representing the bag's contents.
      Returns:
      a mutable list of ItemStacks in this bag
    • setContents

      public void setContents(List<org.bukkit.inventory.ItemStack> contents)
      Replaces the bag's contents with the provided list.
      Parameters:
      contents - the new list of ItemStacks to store in this bag
    • getCreator

      public String getCreator()
      Gets the player who created this bag.
      Returns:
      the creating Player, or null if not set
    • setCreator

      public void setCreator(String creator)
      Sets the player who created this bag.
      Parameters:
      creator - the creating Player