Class EnchantmentModifier
java.lang.Object
me.hsgamer.hscore.bukkit.item.modifier.EnchantmentModifier
- All Implemented Interfaces:
ItemMetaComparator,ItemMetaModifier,ItemComparator<org.bukkit.inventory.ItemStack>,ItemModifier<org.bukkit.inventory.ItemStack>
The enchantment modifier
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddEnchantment(String enchantment) Add an enchantmentaddEnchantment(String enchantment, int level) Add an enchantmentaddEnchantment(org.bukkit.enchantments.Enchantment enchantment) Add an enchantmentaddEnchantment(org.bukkit.enchantments.Enchantment enchantment, int level) Add an enchantmentbooleancompare(@NotNull org.bukkit.inventory.meta.ItemMeta meta, @Nullable UUID uuid, @NotNull StringReplacer stringReplacer) Compare the modifier of an item metabooleanloadFromItemMeta(org.bukkit.inventory.meta.ItemMeta meta) Load the modifier from the item metavoidloadFromObject(Object object) Load the modifier from an object@NotNull org.bukkit.inventory.meta.ItemMetamodifyMeta(@NotNull org.bukkit.inventory.meta.ItemMeta meta, @Nullable UUID uuid, @NotNull StringReplacer stringReplacer) Modify the item metatoObject()Serialize the modifier to an objectMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface me.hsgamer.hscore.minecraft.item.ItemComparator
compare, compareMethods inherited from interface me.hsgamer.hscore.bukkit.item.modifier.ItemMetaComparator
compareMethods inherited from interface me.hsgamer.hscore.bukkit.item.modifier.ItemMetaModifier
loadFromItem, modifyMethods inherited from interface me.hsgamer.hscore.minecraft.item.ItemModifier
modify, modify
-
Constructor Details
-
EnchantmentModifier
public EnchantmentModifier()
-
-
Method Details
-
modifyMeta
@NotNull public @NotNull org.bukkit.inventory.meta.ItemMeta modifyMeta(@NotNull @NotNull org.bukkit.inventory.meta.ItemMeta meta, @Nullable @Nullable UUID uuid, @NotNull @NotNull StringReplacer stringReplacer) Description copied from interface:ItemMetaModifierModify the item meta- Specified by:
modifyMetain interfaceItemMetaModifier- Parameters:
meta- the item metauuid- the unique idstringReplacer- the string replacer- Returns:
- the modified item meta
-
loadFromItemMeta
public boolean loadFromItemMeta(org.bukkit.inventory.meta.ItemMeta meta) Description copied from interface:ItemMetaModifierLoad the modifier from the item meta- Specified by:
loadFromItemMetain interfaceItemMetaModifier- Parameters:
meta- the item meta- See Also:
-
compare
public boolean compare(@NotNull @NotNull org.bukkit.inventory.meta.ItemMeta meta, @Nullable @Nullable UUID uuid, @NotNull @NotNull StringReplacer stringReplacer) Description copied from interface:ItemMetaComparatorCompare the modifier of an item meta- Specified by:
comparein interfaceItemMetaComparator- Parameters:
meta- the item metauuid- the unique idstringReplacer- the string replacer- Returns:
- true if it matches, otherwise false
- See Also:
-
toObject
Description copied from interface:ItemModifierSerialize the modifier to an object- Specified by:
toObjectin interfaceItemModifier<org.bukkit.inventory.ItemStack>- Returns:
- the object
-
loadFromObject
Description copied from interface:ItemModifierLoad the modifier from an object- Specified by:
loadFromObjectin interfaceItemModifier<org.bukkit.inventory.ItemStack>- Parameters:
object- the object
-
addEnchantment
Add an enchantment- Parameters:
enchantment- the enchantmentlevel- the level- Returns:
thisfor builder chain
-
addEnchantment
@Contract("_, _ -> this") public EnchantmentModifier addEnchantment(org.bukkit.enchantments.Enchantment enchantment, int level) Add an enchantment- Parameters:
enchantment- the enchantmentlevel- the level- Returns:
thisfor builder chain
-
addEnchantment
Add an enchantment- Parameters:
enchantment- the enchantment- Returns:
thisfor builder chain
-
addEnchantment
@Contract("_ -> this") public EnchantmentModifier addEnchantment(org.bukkit.enchantments.Enchantment enchantment) Add an enchantment- Parameters:
enchantment- the enchantment- Returns:
thisfor builder chain
-