Package valorless.havenbags.api
Class BagCreationObject
java.lang.Object
valorless.havenbags.api.BagCreationObject
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
ConstructorsConstructorDescriptionBagCreationObject(int size) 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 TypeMethodDescriptionList<org.bukkit.inventory.ItemStack>Gets the list of ItemStacks representing the bag's contents.Gets the player who created this bag.getOwner()Gets the UUID string of the bag's owner.getUuid()Gets the unique identifier (UUID string) for this bag.voidsetContents(List<org.bukkit.inventory.ItemStack> contents) Replaces the bag's contents with the provided list.voidsetCreator(String creator) Sets the player who created this bag.voidSets the UUID string of the bag's owner.voidSets the unique identifier (UUID string) for this bag.
-
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
Constructor to initialize a BagCreationObject with specified contents.- Parameters:
contents- the list of ItemStacks to be included in the bag
-
-
Method Details
-
getUuid
Gets the unique identifier (UUID string) for this bag.- Returns:
- the bag's UUID string
-
setUuid
Sets the unique identifier (UUID string) for this bag.- Parameters:
uuid- the UUID string to assign to this bag
-
getOwner
Gets the UUID string of the bag's owner.- Returns:
- the owner's UUID string, or "ownerless" if none is set
-
setOwner
Sets the UUID string of the bag's owner.- Parameters:
owner- the owner's UUID string
-
getContents
Gets the list of ItemStacks representing the bag's contents.- Returns:
- a mutable list of ItemStacks in this bag
-
setContents
Replaces the bag's contents with the provided list.- Parameters:
contents- the new list of ItemStacks to store in this bag
-
getCreator
Gets the player who created this bag.- Returns:
- the creating Player, or null if not set
-
setCreator
Sets the player who created this bag.- Parameters:
creator- the creating Player
-