PocketMine-MP 5.15.1 git-be6754494fdbbb9dd57c058ba0e33a4a78c4581f
pocketmine\item\enchantment\AvailableEnchantmentRegistry Class Reference
+ Collaboration diagram for pocketmine\item\enchantment\AvailableEnchantmentRegistry:

Public Member Functions

 getAll ()
 
 getAllEnchantmentsForItem (Item $item)
 
 getPrimaryEnchantmentsForItem (Item $item)
 
 getPrimaryItemTags (Enchantment $enchantment)
 
 getSecondaryItemTags (Enchantment $enchantment)
 
 isAvailableForItem (Enchantment $enchantment, Item $item)
 
 isRegistered (Enchantment $enchantment)
 
 register (Enchantment $enchantment, array $primaryItemTags, array $secondaryItemTags)
 
 setPrimaryItemTags (Enchantment $enchantment, array $tags)
 
 setSecondaryItemTags (Enchantment $enchantment, array $tags)
 
 unregister (Enchantment $enchantment)
 
 unregisterAll ()
 

Detailed Description

Registry of enchantments that can be applied to items during in-game enchanting (enchanting table, anvil, fishing, etc.).

Definition at line 39 of file AvailableEnchantmentRegistry.php.

Member Function Documentation

◆ getAll()

pocketmine\item\enchantment\AvailableEnchantmentRegistry::getAll ( )
Returns
Enchantment[]

Definition at line 208 of file AvailableEnchantmentRegistry.php.

◆ getAllEnchantmentsForItem()

pocketmine\item\enchantment\AvailableEnchantmentRegistry::getAllEnchantmentsForItem ( Item  $item)

Returns all available enchantments compatible with the item.

Warning: not suitable for obtaining enchantments for an enchanting table (use AvailableEnchantmentRegistry::getPrimaryEnchantmentsForItem() for that).

Returns
Enchantment[]

Definition at line 181 of file AvailableEnchantmentRegistry.php.

◆ getPrimaryEnchantmentsForItem()

pocketmine\item\enchantment\AvailableEnchantmentRegistry::getPrimaryEnchantmentsForItem ( Item  $item)

Returns enchantments that can be applied to the specified item in an enchanting table (primary only).

Returns
Enchantment[]

Definition at line 161 of file AvailableEnchantmentRegistry.php.

◆ getPrimaryItemTags()

pocketmine\item\enchantment\AvailableEnchantmentRegistry::getPrimaryItemTags ( Enchantment  $enchantment)

Returns primary compatibility tags for the specified enchantment.

An item matching at least one of these tags (or its descendents) can be:

  • Offered this enchantment in an enchanting table
  • Enchanted by any means allowed by secondary tags
Returns
string[]

Definition at line 119 of file AvailableEnchantmentRegistry.php.

◆ getSecondaryItemTags()

pocketmine\item\enchantment\AvailableEnchantmentRegistry::getSecondaryItemTags ( Enchantment  $enchantment)

Returns secondary compatibility tags for the specified enchantment.

An item matching at least one of these tags (or its descendents) can be:

  • Combined with an enchanted book with this enchantment in an anvil
  • Obtained as loot with this enchantment, e.g. fishing, treasure chests, mob equipment, etc.
Returns
string[]

Definition at line 142 of file AvailableEnchantmentRegistry.php.

◆ isAvailableForItem()

pocketmine\item\enchantment\AvailableEnchantmentRegistry::isAvailableForItem ( Enchantment  $enchantment,
Item  $item 
)

Returns whether the specified enchantment can be applied to the particular item.

Warning: not suitable for checking the availability of enchantment for an enchanting table.

Definition at line 197 of file AvailableEnchantmentRegistry.php.

◆ isRegistered()

pocketmine\item\enchantment\AvailableEnchantmentRegistry::isRegistered ( Enchantment  $enchantment)

Definition at line 106 of file AvailableEnchantmentRegistry.php.

◆ register()

pocketmine\item\enchantment\AvailableEnchantmentRegistry::register ( Enchantment  $enchantment,
array  $primaryItemTags,
array  $secondaryItemTags 
)
Parameters
string[]$primaryItemTags
string[]$secondaryItemTags

Definition at line 88 of file AvailableEnchantmentRegistry.php.

References pocketmine\item\enchantment\AvailableEnchantmentRegistry\setPrimaryItemTags(), and pocketmine\item\enchantment\AvailableEnchantmentRegistry\setSecondaryItemTags().

+ Here is the call graph for this function:

◆ setPrimaryItemTags()

pocketmine\item\enchantment\AvailableEnchantmentRegistry::setPrimaryItemTags ( Enchantment  $enchantment,
array  $tags 
)
Parameters
string[]$tags

Definition at line 126 of file AvailableEnchantmentRegistry.php.

Referenced by pocketmine\item\enchantment\AvailableEnchantmentRegistry\register().

+ Here is the caller graph for this function:

◆ setSecondaryItemTags()

pocketmine\item\enchantment\AvailableEnchantmentRegistry::setSecondaryItemTags ( Enchantment  $enchantment,
array  $tags 
)
Parameters
string[]$tags

Definition at line 149 of file AvailableEnchantmentRegistry.php.

Referenced by pocketmine\item\enchantment\AvailableEnchantmentRegistry\register().

+ Here is the caller graph for this function:

◆ unregister()

pocketmine\item\enchantment\AvailableEnchantmentRegistry::unregister ( Enchantment  $enchantment)

Definition at line 94 of file AvailableEnchantmentRegistry.php.

◆ unregisterAll()

pocketmine\item\enchantment\AvailableEnchantmentRegistry::unregisterAll ( )

Definition at line 100 of file AvailableEnchantmentRegistry.php.


The documentation for this class was generated from the following file: