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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
compare
(@NotNull org.bukkit.inventory.ItemStack item, UUID uuid, @NotNull StringReplacer stringReplacer) Compare the modifier of an itemboolean
loadFromItem
(org.bukkit.inventory.ItemStack item) Load the modifier from an itemvoid
loadFromObject
(Object object) Load the modifier from an object@NotNull org.bukkit.inventory.ItemStack
modify
(@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, wait
Methods inherited from interface me.hsgamer.hscore.minecraft.item.ItemComparator
compare, compare
Methods 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:ItemModifier
Modify the item- Specified by:
modify
in 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:ItemModifier
Serialize the modifier to an object- Specified by:
toObject
in interfaceItemModifier<org.bukkit.inventory.ItemStack>
- Returns:
- the object
-
loadFromObject
Description copied from interface:ItemModifier
Load the modifier from an object- Specified by:
loadFromObject
in interfaceItemModifier<org.bukkit.inventory.ItemStack>
- Parameters:
object
- the object
-
loadFromItem
public boolean loadFromItem(org.bukkit.inventory.ItemStack item) Description copied from interface:ItemModifier
Load the modifier from an item- Specified by:
loadFromItem
in 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:ItemComparator
Compare the modifier of an item- Specified by:
compare
in 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:
this
for builder chain
-
setAmount
Set the amount- Parameters:
amount
- the amount- Returns:
this
for builder chain
-