Class CustomItemManager

java.lang.Object
com.ryandw11.structure.loottables.customitems.CustomItemManager

public class CustomItemManager extends Object
Manages the custom items defined for the loot tables.

Get this handler from CustomStructuresAPI.getCustomItemManager()

  • Constructor Details

    • CustomItemManager

      public CustomItemManager(CustomStructures structures, File file, File dir)
      This should only ever be constructed by the CustomStructures main class.

      Use CustomStructuresAPI.getCustomItemManager() to access this class for the plugin.

      Parameters:
      structures - The main class.
      file - The file.
      dir - The directory to put the file.
  • Method Details

    • addItem

      public boolean addItem(String key, org.bukkit.inventory.ItemStack itemStack)
      Add an item to the custom items file.
      Parameters:
      key - The key to add.
      itemStack - The item stack to add.
      Returns:
      If the item was successfully added.

      This returns false if the key already exists in the file.

    • removeItem

      public boolean removeItem(String key)
      Remove an item from the custom items file.
      Parameters:
      key - The key to remove.
      Returns:
      If the key was successfully removed.

      If the key is not in the file than false is returned.

    • getItem

      public org.bukkit.inventory.ItemStack getItem(String key)
      Get an item from the item file.
      Parameters:
      key - The key to check.
      Returns:
      The item stack. (Will return null if the item does not exist).
    • getConfig

      public org.bukkit.configuration.file.FileConfiguration getConfig()
      Get the File Configuration for the custom items file.

      This is meant for internal use only.

      Returns:
      The File Configuration.