Class O2Wands
java.lang.Object
net.pottercraft.ollivanders2.item.wand.O2Wands
Manage wands and wand functions
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckCoreNBT(@NotNull String core, @NotNull org.bukkit.inventory.ItemStack itemStack) Does this core match what is set on the NBT for this wand?booleancheckNBT(@NotNull org.bukkit.inventory.ItemStack itemstack) Check wand NBTbooleancheckWoodNBT(@NotNull String wood, @NotNull org.bukkit.inventory.ItemStack itemStack) Does this wood match what is set on the NBT for this wand?@Nullable org.bukkit.inventory.ItemStackcreateCorelessWand(@NotNull O2WandWoodType woodType, int amount) Create a coreless wand of a specified wood type.@NotNull StringcreateLore(@NotNull String wood, @NotNull String core) Make a wand lore string from a wood and core@Nullable org.bukkit.inventory.ItemStackCreate a random wand@NotNull List<org.bukkit.inventory.ItemStack> Get all the wands in the game.booleangiveRandomWand(@NotNull org.bukkit.entity.Player player) Give a player a random wand.booleanholdsWand(@NotNull org.bukkit.entity.Player player) Does the player hold a wand item in their primary hand?booleanholdsWand(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.inventory.EquipmentSlot hand) Does the player hold a wand item in their hand?booleanisDestinedWand(@NotNull O2Player player, @NotNull org.bukkit.inventory.ItemStack itemStack) Determine if a wand matches the player's destined wand type.booleanisDestinedWand(@NotNull org.bukkit.entity.Player player, @NotNull org.bukkit.inventory.ItemStack stack) Is this ItemStack the player's destined wand?booleanisWand(@NotNull org.bukkit.inventory.ItemStack itemstack) Is this item stack a wand?@Nullable org.bukkit.inventory.ItemStackMake an ItemStack of a specific wand type@Nullable org.bukkit.inventory.ItemStackmakeWandFromCoreless(@NotNull org.bukkit.inventory.ItemStack corelessWand, @NotNull O2WandCoreType core, int amount) Make a wand from a coreless wand and a wand core
-
Field Details
-
wandLoreConjunction
Wand conjunction for wand lore- See Also:
-
-
Constructor Details
-
O2Wands
Constructor- Parameters:
plugin- callback to the plugin
-
-
Method Details
-
isWand
public boolean isWand(@NotNull @NotNull org.bukkit.inventory.ItemStack itemstack) Is this item stack a wand?- Parameters:
itemstack- stack to be checked- Returns:
- true if yes, false if no
-
checkNBT
public boolean checkNBT(@NotNull @NotNull org.bukkit.inventory.ItemStack itemstack) Check wand NBT- Parameters:
itemstack- the itemstack to check- Returns:
- true if this wand has a valid NBT, false otherwise
-
createLore
@NotNull public @NotNull String createLore(@NotNull @NotNull String wood, @NotNull @NotNull String core) Make a wand lore string from a wood and core- Parameters:
wood- the wand wood typecore- the wand core type- Returns:
- the wand lore string
-
isDestinedWand
public boolean isDestinedWand(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull org.bukkit.inventory.ItemStack stack) Is this ItemStack the player's destined wand?- Parameters:
player- player to check the stack against.stack- ItemStack to be checked- Returns:
- true if yes, false if no
-
isDestinedWand
public boolean isDestinedWand(@NotNull @NotNull O2Player player, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) Determine if a wand matches the player's destined wand type.- Parameters:
player- the player to checkitemStack- the wand to check- Returns:
- true if is a wand and matches the player's destined wand, false otherwise
-
checkCoreNBT
public boolean checkCoreNBT(@NotNull @NotNull String core, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) Does this core match what is set on the NBT for this wand?- Parameters:
core- the core typeitemStack- the item to check- Returns:
- true if it matches, false otherwise
-
checkWoodNBT
public boolean checkWoodNBT(@NotNull @NotNull String wood, @NotNull @NotNull org.bukkit.inventory.ItemStack itemStack) Does this wood match what is set on the NBT for this wand?- Parameters:
wood- the wood typeitemStack- the item to check- Returns:
- true if it matches, false otherwise
-
holdsWand
public boolean holdsWand(@NotNull @NotNull org.bukkit.entity.Player player) Does the player hold a wand item in their primary hand?- Parameters:
player- player to check.- Returns:
- true if the player holds a wand, false otherwise
-
holdsWand
public boolean holdsWand(@NotNull @NotNull org.bukkit.entity.Player player, @NotNull @NotNull org.bukkit.inventory.EquipmentSlot hand) Does the player hold a wand item in their hand?- Parameters:
player- player to check.hand- the equipment slot to check for this player- Returns:
- true if the player holds a wand, false otherwise
-
getAllWands
Get all the wands in the game.- Returns:
- a list of all the wands
-
makeWand
@Nullable public @Nullable org.bukkit.inventory.ItemStack makeWand(@NotNull @NotNull String wood, @NotNull @NotNull String core, int amount) Make an ItemStack of a specific wand type- Parameters:
wood- the wand woodcore- the wand coreamount- the number of wands to make- Returns:
- an ItemStack of wands or null if wood or core is not valid
-
makeWandFromCoreless
@Nullable public @Nullable org.bukkit.inventory.ItemStack makeWandFromCoreless(@NotNull @NotNull org.bukkit.inventory.ItemStack corelessWand, @NotNull @NotNull O2WandCoreType core, int amount) Make a wand from a coreless wand and a wand core- Parameters:
corelessWand- the coreless wandcore- the wand coreamount- the amount to make- Returns:
- an item stack of the wand type, null if an error occurred
-
createCorelessWand
@Nullable public @Nullable org.bukkit.inventory.ItemStack createCorelessWand(@NotNull @NotNull O2WandWoodType woodType, int amount) Create a coreless wand of a specified wood type.- Parameters:
woodType- the wood type for the wandamount- the amount- Returns:
- an item stack of this wand type, null if an error occurred
-
giveRandomWand
public boolean giveRandomWand(@NotNull @NotNull org.bukkit.entity.Player player) Give a player a random wand.- Parameters:
player- the player to give the wand to- Returns:
- true if successful
-
createRandomWand
@Nullable public @Nullable org.bukkit.inventory.ItemStack createRandomWand()Create a random wand- Returns:
- a random wand or null if something went wrong
-