Package redempt.redlib.itemutils
Class CustomItem
java.lang.Object
redempt.redlib.itemutils.CustomItem
Represents a custom item with special behavior
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCustomItem(String name) A constructor that should only be called bygetAll(Plugin) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanstatic 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 methodabstract org.bukkit.inventory.ItemStackorg.bukkit.inventory.ItemStackgetItem()final StringgetName()
-
Constructor Details
-
CustomItem
A constructor that should only be called bygetAll(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
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
- Returns:
- The name of this custom item
-
getItem
public org.bukkit.inventory.ItemStack getItem()- Returns:
- The item
-