Class ItemManagerImpl
java.lang.Object
com.github.imdabigboss.easydatapack.backend.managers.ItemManagerImpl
- All Implemented Interfaces:
ItemManager,org.bukkit.event.Listener
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidentityDamageByEntityEvent(org.bukkit.event.entity.EntityDamageByEntityEvent event)getCustomItem(int customModelData)Gets a custom item from its custom model data.getCustomItem(@NonNull String namespaceKey)Gets a custom item from its namespace key.@NonNull List<CustomItem>Gets a list of all registered custom items.org.bukkit.inventory.ItemStackgetItemStack(int customModelData)Gets an item stack from a custom item's custom model data.org.bukkit.inventory.ItemStackgetItemStack(@NonNull String namespaceKey)Gets an item stack from a custom item's namespace key.booleanisCustomHat(@NonNull org.bukkit.inventory.ItemStack item)Gets if an item stack is a custom hat.voidonBlockBreak(org.bukkit.event.block.BlockBreakEvent event)voidonInventoryClickEvent(org.bukkit.event.inventory.InventoryClickEvent event)voidonInventoryCreativeEvent(org.bukkit.event.inventory.InventoryCreativeEvent event)voidonPrepareSmithingEvent(org.bukkit.event.inventory.PrepareSmithingEvent event)voidplayerInteractEvent(org.bukkit.event.player.PlayerInteractEvent event)voidregisterCustomItem(CustomItem item)void
-
Constructor Details
-
ItemManagerImpl
-
-
Method Details
-
registerCustomItem
- Throws:
EasyDatapackException
-
registerEventListeners
public void registerEventListeners() -
getCustomItems
Description copied from interface:ItemManagerGets a list of all registered custom items.- Specified by:
getCustomItemsin interfaceItemManager- Returns:
- a list of all registered custom items
-
getCustomItem
Description copied from interface:ItemManagerGets a custom item from its namespace key.- Specified by:
getCustomItemin interfaceItemManager- Parameters:
namespaceKey- the namespace key of the custom item- Returns:
- the custom item with the given namespace key. Will be null if there is nothing associated with the namespace key.
-
getCustomItem
Description copied from interface:ItemManagerGets a custom item from its custom model data.- Specified by:
getCustomItemin interfaceItemManager- Parameters:
customModelData- the item's custom model data- Returns:
- the custom item with the given custom model data. Will be null if there is nothing associated with the custom model data.
-
getItemStack
Description copied from interface:ItemManagerGets an item stack from a custom item's namespace key.- Specified by:
getItemStackin interfaceItemManager- Parameters:
namespaceKey- the namespace key of the custom item- Returns:
- the custom item's item stack with the given namespace key. Will be null if there is nothing associated with the namespace key.
-
getItemStack
public org.bukkit.inventory.ItemStack getItemStack(int customModelData)Description copied from interface:ItemManagerGets an item stack from a custom item's custom model data.- Specified by:
getItemStackin interfaceItemManager- Parameters:
customModelData- the item's custom model data- Returns:
- the custom item's item stack with the given custom model data. Will be null if there is nothing associated with the custom model data.
-
isCustomHat
public boolean isCustomHat(@NonNull org.bukkit.inventory.ItemStack item)Description copied from interface:ItemManagerGets if an item stack is a custom hat.- Specified by:
isCustomHatin interfaceItemManager- Parameters:
item- the item stack to check- Returns:
- true if the item stack is a custom hat, false otherwise
-
onPrepareSmithingEvent
public void onPrepareSmithingEvent(org.bukkit.event.inventory.PrepareSmithingEvent event) -
onInventoryCreativeEvent
public void onInventoryCreativeEvent(org.bukkit.event.inventory.InventoryCreativeEvent event) -
onInventoryClickEvent
public void onInventoryClickEvent(org.bukkit.event.inventory.InventoryClickEvent event) -
playerInteractEvent
public void playerInteractEvent(org.bukkit.event.player.PlayerInteractEvent event) -
entityDamageByEntityEvent
public void entityDamageByEntityEvent(org.bukkit.event.entity.EntityDamageByEntityEvent event) -
onBlockBreak
public void onBlockBreak(org.bukkit.event.block.BlockBreakEvent event)
-