Class CustomItemManager
java.lang.Object
com.ryandw11.structure.loottables.customitems.CustomItemManager
Manages the custom items defined for the loot tables.
Get this handler from CustomStructuresAPI.getCustomItemManager()
-
Constructor Summary
ConstructorDescriptionCustomItemManager(CustomStructures structures, File file, File dir)
This should only ever be constructed by the CustomStructures main class. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Add an item to the custom items file.org.bukkit.configuration.file.FileConfiguration
Get the File Configuration for the custom items file.org.bukkit.inventory.ItemStack
Get an item from the item file.boolean
removeItem(String key)
Remove an item from the custom items file.
-
Constructor Details
-
CustomItemManager
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
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
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
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.
-