Class PrepBookService

java.lang.Object
dev.deepcore.challenge.ui.PrepBookService

public final class PrepBookService extends Object
Handles prep-book item creation, detection, and inventory management.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PrepBookService(org.bukkit.plugin.java.JavaPlugin plugin)
    Creates a prep-book service.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    giveIfMissing(org.bukkit.entity.Player player)
    Gives a prep book to the player when they do not already have one.
    boolean
    isPrepBook(org.bukkit.inventory.ItemStack itemStack)
    Returns whether the provided item stack is a tagged DeepCore prep book.
    void
    removeFromInventory(org.bukkit.entity.Player player)
    Removes all prep book instances from the player's inventory.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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