Class ItemsAdder
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Advanced stuff, better not touch it. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
applyResourcepack
(org.bukkit.entity.Player player) Applies the Resource pack set for ItemsAdder to the provided player.static boolean
Deprecated.static List<CustomStack>
Returns all the registered items.static List<CustomStack>
getAllItems
(String namespace) Returns all the registered items by a specific namespace.static List<CustomStack>
getAllItems
(org.bukkit.Material material) Returns all the registered items which use a specific Bukkit Material.static org.bukkit.inventory.ItemStack
getCustomBlock
(org.bukkit.block.Block block) Deprecated.static org.bukkit.block.data.BlockData
getCustomBlockBlockData
(org.bukkit.inventory.ItemStack customBlock, boolean lightweight) Deprecated.static org.bukkit.inventory.ItemStack
getCustomBlockByFaces
(org.bukkit.Material material, HashMap<org.bukkit.block.BlockFace, Boolean> blockFaces) Deprecated.static List<org.bukkit.inventory.ItemStack>
getCustomBlockLoot
(org.bukkit.block.Block block) Deprecated.static List<org.bukkit.inventory.ItemStack>
getCustomBlockLoot
(org.bukkit.block.Block block, boolean includeSelfBlock) Deprecated.static List<org.bukkit.inventory.ItemStack>
getCustomBlockLoot
(org.bukkit.block.Block block, org.bukkit.inventory.ItemStack tool, boolean includeSelfBlock) Deprecated.static org.bukkit.inventory.ItemStack
getCustomItem
(String namespacedId) Deprecated.static int
getCustomItemDurability
(org.bukkit.inventory.ItemStack itemStack) Deprecated.static int
getCustomItemMaxDurability
(org.bukkit.inventory.ItemStack itemStack) Deprecated.static String
getCustomItemName
(org.bukkit.inventory.ItemStack itemStack) Deprecated.static int
getCustomItemUsages
(org.bukkit.inventory.ItemStack itemStack) Deprecated.static String
getCustomSeedNameFromCrop
(org.bukkit.block.Block block) Deprecated.static @Nullable String
getLiquidName
(org.bukkit.Location location) Deprecated.Deprecated.getNamespacedBlocksNamesInConfig
(String searchStr) Deprecated.static @Nullable String
getPackUrl
(boolean appendHash) Retrieve the resourcepack direct download URL.static boolean
hasKeepOnDeath
(String namespacedId) Check if a custom item has keep_on_death behaviour enabled.static boolean
hasKeepOnDeath
(org.bukkit.inventory.ItemStack itemStack) Check if a custom item has keep_on_death behaviour enabled.static boolean
isCustomBlock
(org.bukkit.block.Block block) Deprecated.static boolean
isCustomCrop
(org.bukkit.block.Block block) Deprecated.static boolean
isCustomItem
(String customItemName) Deprecated.static boolean
isCustomItem
(org.bukkit.inventory.ItemStack itemStack) Deprecated.static boolean
isCustomRecipe
(String namespacedKey) Check if a custom recipe is registered by ItemsAdder.static boolean
isCustomRecipe
(org.bukkit.NamespacedKey namespacedKey) Check if a custom recipe is registered by ItemsAdder.static boolean
isFurniture
(org.bukkit.entity.Entity entity) Deprecated.static boolean
matchCustomItemName
(org.bukkit.inventory.ItemStack itemStack, String customItemName) Deprecated.static void
placeCustomBlock
(org.bukkit.Location location, org.bukkit.inventory.ItemStack itemStack) Deprecated.static void
placeCustomCrop
(org.bukkit.Location location, org.bukkit.inventory.ItemStack seed) Deprecated.static boolean
playTotemAnimation
(org.bukkit.entity.Player player, String namespacedId) Play totem animation.static void
removeCustomBlock
(org.bukkit.Location location) Deprecated.static org.bukkit.inventory.ItemStack
setCustomItemDurability
(org.bukkit.inventory.ItemStack item, int durability) Deprecated.static org.bukkit.inventory.ItemStack
setCustomItemMaxDurability
(org.bukkit.inventory.ItemStack item, int maxDurability) Deprecated.static void
Deprecated.
-
Constructor Details
-
ItemsAdder
public ItemsAdder()
-
-
Method Details
-
areItemsLoaded
Deprecated.Please listen toItemsAdderLoadDataEvent
event instead. -
isCustomItem
Deprecated.Please useCustomStack.byItemStack(ItemStack)
!= null
instead. -
isCustomItem
Deprecated.Please useCustomStack.getInstance(String)
!= null
instead. -
getCustomItem
Deprecated.Please useCustomStack.getInstance(String)
instead. -
placeCustomBlock
@Deprecated public static void placeCustomBlock(org.bukkit.Location location, org.bukkit.inventory.ItemStack itemStack) Deprecated.Please useCustomBlock.place(Location)
instead. -
removeCustomBlock
Deprecated.Please useCustomBlock
instead. -
getCustomBlockByFaces
@Deprecated public static org.bukkit.inventory.ItemStack getCustomBlockByFaces(org.bukkit.Material material, HashMap<org.bukkit.block.BlockFace, Boolean> blockFaces) Deprecated.Please don't use this method anymore, it's not reliable as blocks are not only mushrooms.Get a custom block based on the
BlockFace
values.- Parameters:
material
-blockFaces
-- Returns:
-
isCustomBlock
Deprecated.Please useCustomBlock
instead. -
getCustomBlockLoot
@Deprecated public static List<org.bukkit.inventory.ItemStack> getCustomBlockLoot(org.bukkit.block.Block block, boolean includeSelfBlock) Deprecated.Please useCustomBlock
instead. -
getCustomBlockLoot
@Deprecated public static List<org.bukkit.inventory.ItemStack> getCustomBlockLoot(org.bukkit.block.Block block) Deprecated.Please useCustomBlock
instead. -
getCustomBlockLoot
@Deprecated public static List<org.bukkit.inventory.ItemStack> getCustomBlockLoot(org.bukkit.block.Block block, org.bukkit.inventory.ItemStack tool, boolean includeSelfBlock) Deprecated.Please useCustomBlock
instead. -
placeCustomCrop
@Deprecated public static void placeCustomCrop(org.bukkit.Location location, org.bukkit.inventory.ItemStack seed) Deprecated.Please useCustomCrop
instead. -
isCustomCrop
Deprecated.Please useCustomCrop
instead. -
getCustomSeedNameFromCrop
Deprecated.Please useCustomCrop
instead. -
getCustomBlock
@Deprecated public static org.bukkit.inventory.ItemStack getCustomBlock(org.bukkit.block.Block block) Deprecated.Please useCustomBlock
instead.Gets a CustomBlock instance through the provided Bukkit Block.
This may return null if the provided Block is not associated with a CustomBlock.- Parameters:
block
- The Bukkit Block to get the CustomBlock from.- Returns:
- Possibly-null CustomBlock instance.
-
matchCustomItemName
@Deprecated public static boolean matchCustomItemName(org.bukkit.inventory.ItemStack itemStack, String customItemName) Deprecated.Please useCustomStack
instead.Returns whether the namespace and id of the provided CustomStack match the one of this CustomStack.
- Parameters:
itemStack
- The CustomStack to check the namespace and id against.customItemName
- The CustomStack ID in the formatnamespace:id
to check the item namespaced ID against.- Returns:
- true if namespace and id match, otherwise false.
-
isFurniture
Deprecated.Please useCustomFurniture
instead.Check if a Bukkit
Entity
is a custom furniture.- Parameters:
entity
- TheBukkit
entity.- Returns:
- true if it's a custom entity, false if not.
-
getCustomItemName
Deprecated.Please useCustomStack
instead.Gets the namespace and id of this CustomStack instance in the format
namespace:id
- Parameters:
itemStack
- Custom item.- Returns:
- String representing namespace and id of the custom item.
-
getCustomItemUsages
Deprecated.Please useCustomStack
instead.Get custom usages of a custom item. (Usages is a special property of this plugin. It's not a Vanilla attribute)
- Parameters:
itemStack
- Custom item.- Returns:
- Custom durability of a custom item.
-
setCustomItemDurability
@Deprecated public static org.bukkit.inventory.ItemStack setCustomItemDurability(org.bukkit.inventory.ItemStack item, int durability) Deprecated.Please useCustomStack
instead.Set the custom durability of a custom item.
- Parameters:
item
- Custom item.durability
- Durability to set.- Returns:
- The modified ItemStack.
-
setCustomItemMaxDurability
@Deprecated public static org.bukkit.inventory.ItemStack setCustomItemMaxDurability(org.bukkit.inventory.ItemStack item, int maxDurability) Deprecated.Please useCustomStack
instead.Set the custom durability of a custom item.
- Parameters:
item
- Custom item.maxDurability
- Max durability to set.- Returns:
- The modified ItemStack.
-
getCustomItemDurability
Deprecated.Please useCustomStack
instead.Get the custom durability of a custom item.
- Parameters:
itemStack
- Custom item.- Returns:
- Custom durability of a custom item.
-
getCustomItemMaxDurability
Deprecated.Please useCustomStack
instead.Get the custom max durability of a custom item.
- Parameters:
itemStack
- Custom item.- Returns:
- Custom max durability of a custom item.
-
getNamespacedBlocksNamesInConfig
Deprecated.Get list of custom blocks IDs in the formatnamespace:id
which contains thesearchStr
keyword.- Parameters:
searchStr
- Keyword to search for.- Returns:
- Complete list of custom blocks IDs in the format
namespace:id
.
-
getNamespacedBlocksNamesInConfig
Deprecated.Get complete list of custom blocks IDs in the formatnamespace:id
.- Returns:
- Complete list of custom blocks IDs in the format
namespace:id
.
-
getCustomBlockBlockData
@Deprecated public static org.bukkit.block.data.BlockData getCustomBlockBlockData(org.bukkit.inventory.ItemStack customBlock, boolean lightweight) Deprecated.Please useCustomStack
instead.Get the Bukkit
BlockData
- Parameters:
customBlock
- The ItemStack of the custom block you want to get BukkitBlockData
of.lightweight
- Unused property.- Returns:
- Bukkit
BlockData
-
playTotemAnimation
Play totem animation.
Warning: Make sure to delay it using a bukkit runnable (1 tick should be ok) if you call this after you close an inventory or sometimes animation won't show.- Parameters:
player
- The player to play the anomation towards.namespacedId
- The ID in the formatnamespace:id
to get the totem animation from.- Returns:
- true if successful, false when provided ID was invalid.
-
setLiquid
Deprecated.Place a custom liquid in the specified location.- Parameters:
namespacedID
- The ID in the formatnamespace:id
of the liquid you want to place.location
- Location of where you want to place the liquid
-
getLiquidName
Deprecated.Get the name of the liquid in this location.- Parameters:
location
- Location you want to check.- Returns:
- null if no custom liquid is available in the location.
-
hasKeepOnDeath
public static boolean hasKeepOnDeath(org.bukkit.inventory.ItemStack itemStack) Check if a custom item has keep_on_death behaviour enabled.- Parameters:
itemStack
- the custom item- Returns:
- true if it has 'keep_on_death: true', false if not or if it's not a custom item
-
hasKeepOnDeath
Check if a custom item has keep_on_death behaviour enabled.- Parameters:
namespacedId
- Namespace and ID in the formatnamespace:id
of the custom item- Returns:
- true if it has 'keep_on_death: true', false if not or if it's not a custom item
-
applyResourcepack
public static void applyResourcepack(org.bukkit.entity.Player player) Applies the Resource pack set for ItemsAdder to the provided player.- Parameters:
player
- The player to apply the resource pack to.
-
getAllItems
Returns all the registered items.- Returns:
- null if ItemsAdder is not loaded completely, be sure to listen to ItemsAdderLoadDataEvent
-
getAllItems
Returns all the registered items by a specific namespace.- Returns:
- null if ItemsAdder is not loaded completely, be sure to listen to ItemsAdderLoadDataEvent
-
getAllItems
Returns all the registered items which use a specific Bukkit Material.- Returns:
- null if ItemsAdder is not loaded completely, be sure to listen to ItemsAdderLoadDataEvent
-
isCustomRecipe
public static boolean isCustomRecipe(org.bukkit.NamespacedKey namespacedKey) Check if a custom recipe is registered by ItemsAdder.- Parameters:
namespacedKey
- the recipe namespaced key.- Returns:
- true if it's an ItemsAdder recipe, false if not.
-
isCustomRecipe
Check if a custom recipe is registered by ItemsAdder.- Parameters:
namespacedKey
- the recipe Namespace and ID in the formatnamespace:id
.- Returns:
- true if it's an ItemsAdder recipe, false if not.
-
getPackUrl
Retrieve the resourcepack direct download URL.- Parameters:
appendHash
- append the hash to the URL or not.- Returns:
- returns the URL if is available, null if the resourcepack is still generating or the plugin still loading.
-