Class AmountModifier
java.lang.Object
me.hsgamer.hscore.bukkit.item.modifier.AmountModifier
- All Implemented Interfaces:
ItemComparator<org.bukkit.inventory.ItemStack>,ItemModifier<org.bukkit.inventory.ItemStack>
public class AmountModifier
extends Object
implements ItemComparator<org.bukkit.inventory.ItemStack>, ItemModifier<org.bukkit.inventory.ItemStack>
The amount modifier
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancompare(@NotNull org.bukkit.inventory.ItemStack item, UUID uuid, @NotNull StringReplacer stringReplacer) Compare the modifier of an itembooleanloadFromItem(org.bukkit.inventory.ItemStack item) Load the modifier from an itemvoidloadFromObject(Object object) Load the modifier from an object@NotNull org.bukkit.inventory.ItemStackmodify(@NotNull org.bukkit.inventory.ItemStack original, UUID uuid, @NotNull StringReplacer stringReplacer) Modify the itemsetAmount(int amount) Set the amountSet the amounttoObject()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.minecraft.item.ItemModifier
modify, modify
-
Constructor Details
-
AmountModifier
public AmountModifier()
-
-
Method Details
-
modify
@NotNull public @NotNull org.bukkit.inventory.ItemStack modify(@NotNull @NotNull org.bukkit.inventory.ItemStack original, UUID uuid, @NotNull @NotNull StringReplacer stringReplacer) Description copied from interface:ItemModifierModify the item- Specified by:
modifyin interfaceItemModifier<org.bukkit.inventory.ItemStack>- Parameters:
original- the original itemuuid- the unique idstringReplacer- the string replacer- Returns:
- the modified item
-
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
-
loadFromItem
public boolean loadFromItem(org.bukkit.inventory.ItemStack item) Description copied from interface:ItemModifierLoad the modifier from an item- Specified by:
loadFromItemin interfaceItemModifier<org.bukkit.inventory.ItemStack>- Parameters:
item- the item- Returns:
- true if it can
-
compare
public boolean compare(@NotNull @NotNull org.bukkit.inventory.ItemStack item, UUID uuid, @NotNull @NotNull StringReplacer stringReplacer) Description copied from interface:ItemComparatorCompare the modifier of an item- Specified by:
comparein interfaceItemComparator<org.bukkit.inventory.ItemStack>- Parameters:
item- the itemuuid- the unique idstringReplacer- the string replacer- Returns:
- true if it matches, otherwise false
-
setAmount
Set the amount- Parameters:
amount- the amount- Returns:
thisfor builder chain
-
setAmount
Set the amount- Parameters:
amount- the amount- Returns:
thisfor builder chain
-