Package dev.deepcore.challenge.ui
Class PrepBookService
java.lang.Object
dev.deepcore.challenge.ui.PrepBookService
Handles prep-book item creation, detection, and inventory management.
-
Constructor Summary
ConstructorsConstructorDescriptionPrepBookService(org.bukkit.plugin.java.JavaPlugin plugin) Creates a prep-book service. -
Method Summary
Modifier and TypeMethodDescriptionvoidgiveIfMissing(org.bukkit.entity.Player player) Gives a prep book to the player when they do not already have one.booleanisPrepBook(org.bukkit.inventory.ItemStack itemStack) Returns whether the provided item stack is a tagged DeepCore prep book.voidremoveFromInventory(org.bukkit.entity.Player player) Removes all prep book instances from the player's inventory.
-
Constructor Details
-
PrepBookService
public PrepBookService(org.bukkit.plugin.java.JavaPlugin plugin) Creates a prep-book service.- Parameters:
plugin- plugin used to derive the prep-book metadata key
-
-
Method Details
-
giveIfMissing
public void giveIfMissing(org.bukkit.entity.Player player) Gives a prep book to the player when they do not already have one.- Parameters:
player- player who should receive a prep book
-
removeFromInventory
public void removeFromInventory(org.bukkit.entity.Player player) Removes all prep book instances from the player's inventory.- Parameters:
player- player whose inventory should be stripped of prep books
-
isPrepBook
public boolean isPrepBook(org.bukkit.inventory.ItemStack itemStack) Returns whether the provided item stack is a tagged DeepCore prep book.- Parameters:
itemStack- item stack to test- Returns:
- true when the stack is a tagged prep book
-