Package com.ranull.graves.integration
Class ItemBridge
java.lang.Object
com.ranull.graves.integration.ItemBridge
- All Implemented Interfaces:
com.jojodmo.itembridge.ItemBridgeListener
Integration with the ItemBridge plugin for handling custom items related to graves.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionItemBridge
(Graves plugin) Constructs an ItemBridge instance and registers it with the ItemBridge plugin. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.inventory.ItemStack
fetchItemStack
(@NotNull String string) Fetches an ItemStack based on a string identifier.getItemName
(@NotNull org.bukkit.inventory.ItemStack itemStack) Gets the name of the item based on its ItemStack.com.jojodmo.itembridge.ItemBridgeListenerPriority
Gets the priority of the ItemBridge listener.boolean
Checks if the given ItemStack matches the specified string identifier.private void
register()
Registers the ItemBridge listener with the ItemBridge plugin.private void
Unregisters the current ItemBridge listener if it exists.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.jojodmo.itembridge.ItemBridgeListener
fetchItemStack, fetchItemStack, fetchItemStack, getAvailableBlocks, getAvailableItems, getBlock, getBlockParameters, getParameters, isBlock, isBlock, isItem, isReady, removeBlock, setBlock, setBlock
-
Field Details
-
plugin
-
itemBridge
private com.jojodmo.itembridge.ItemBridge itemBridge
-
-
Constructor Details
-
ItemBridge
Constructs an ItemBridge instance and registers it with the ItemBridge plugin.- Parameters:
plugin
- The Graves plugin instance.
-
-
Method Details
-
unregister
private void unregister()Unregisters the current ItemBridge listener if it exists. -
register
private void register()Registers the ItemBridge listener with the ItemBridge plugin. -
getPriority
public com.jojodmo.itembridge.ItemBridgeListenerPriority getPriority()Gets the priority of the ItemBridge listener.- Specified by:
getPriority
in interfacecom.jojodmo.itembridge.ItemBridgeListener
- Returns:
- The priority of the listener.
-
fetchItemStack
Fetches an ItemStack based on a string identifier.- Specified by:
fetchItemStack
in interfacecom.jojodmo.itembridge.ItemBridgeListener
- Parameters:
string
- The string identifier for the item.- Returns:
- The ItemStack corresponding to the identifier, or null if not found.
-
getItemName
Gets the name of the item based on its ItemStack.- Specified by:
getItemName
in interfacecom.jojodmo.itembridge.ItemBridgeListener
- Parameters:
itemStack
- The ItemStack for which to retrieve the name.- Returns:
- The name of the item, or null if not recognized.
-
isItem
public boolean isItem(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack, @NotNull @NotNull String string) Checks if the given ItemStack matches the specified string identifier.- Specified by:
isItem
in interfacecom.jojodmo.itembridge.ItemBridgeListener
- Parameters:
itemStack
- The ItemStack to check.string
- The string identifier to compare with.- Returns:
- True if the ItemStack matches the identifier, false otherwise.
-