Class CustomItem

java.lang.Object
redempt.redlib.itemutils.CustomItem

public abstract class CustomItem extends Object
Represents a custom item with special behavior
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    A constructor that should only be called by getAll(Plugin)
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
     
    getAll(org.bukkit.plugin.Plugin plugin)
    Gets an instance of every class which extends CustomItem in your plugin, and puts them in a map by name Note: Custom item classes MUST have a default constructor which takes no arguments to be loaded by this method
    abstract org.bukkit.inventory.ItemStack
     
    org.bukkit.inventory.ItemStack
     
    final String
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CustomItem

      protected CustomItem(String name)
      A constructor that should only be called by getAll(Plugin)
      Parameters:
      name - The name of the CustomItem - insert a constant when overriding this constructor, do not take it as a parameter of the overridden constructor
  • Method Details

    • getAll

      public static Map<String,CustomItem> getAll(org.bukkit.plugin.Plugin plugin)
      Gets an instance of every class which extends CustomItem in your plugin, and puts them in a map by name Note: Custom item classes MUST have a default constructor which takes no arguments to be loaded by this method
      Parameters:
      plugin - The plugin to get the custom items from
      Returns:
      A map of the custom items by name
    • cloneOnGet

      protected boolean cloneOnGet()
      Returns:
      Whether the item should be cloned before being returned
    • getDefaultItem

      public abstract org.bukkit.inventory.ItemStack getDefaultItem()
      Returns:
      The default item for this CustomItem
    • getName

      public final String getName()
      Returns:
      The name of this custom item
    • getItem

      public org.bukkit.inventory.ItemStack getItem()
      Returns:
      The item