Package studio.magemonkey.codex.util
Class ItemUtils
java.lang.Object
studio.magemonkey.codex.util.ItemUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final studio.magemonkey.codex.legacy.placeholder.PlaceholderType<studio.magemonkey.codex.api.items.ItemType> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.inventory.ItemStack[]compact(boolean respectStackSize, org.bukkit.inventory.ItemStack... itemsToCompact) Compact given array, it will create the smallest possible array with given items, so it will join duplicated items etc.static org.bukkit.inventory.meta.ItemMetagetItemMeta(org.bukkit.inventory.ItemStack itemStack) static org.bukkit.MaterialgetMaterial(String mat) Attempts to match the string to a bukkit material.static org.bukkit.inventory.ItemStackreplaceText(org.bukkit.inventory.ItemStack item, studio.magemonkey.codex.util.messages.MessageData... replace) static org.bukkit.ColorsimpleDeserializeColor(String string) static List<org.bukkit.Color> simpleDeserializeColors(Collection<String> strings) static org.bukkit.FireworkEffectstatic List<org.bukkit.FireworkEffect> static StringsimpleSerializeColor(org.bukkit.Color color) simpleSerializeColors(Collection<org.bukkit.Color> colors) simpleSerializeEffect(org.bukkit.FireworkEffect effect) simpleSerializeEffects(Collection<org.bukkit.FireworkEffect> effects)
-
Field Details
-
ITEM_TYPE
public static final studio.magemonkey.codex.legacy.placeholder.PlaceholderType<studio.magemonkey.codex.api.items.ItemType> ITEM_TYPE
-
-
Constructor Details
-
ItemUtils
public ItemUtils()
-
-
Method Details
-
replaceText
public static org.bukkit.inventory.ItemStack replaceText(org.bukkit.inventory.ItemStack item, studio.magemonkey.codex.util.messages.MessageData... replace) -
getMaterial
Attempts to match the string to a bukkit material.- Parameters:
mat- the string to match- Returns:
- the material that matches the input string
-
getItemMeta
@Nullable public static org.bukkit.inventory.meta.ItemMeta getItemMeta(org.bukkit.inventory.ItemStack itemStack) -
simpleDeserializeEffect
-
simpleDeserializeEffects
public static List<org.bukkit.FireworkEffect> simpleDeserializeEffects(Collection<Map<Object, Object>> list) -
simpleDeserializeColor
-
simpleDeserializeColors
-
simpleSerializeColor
-
simpleSerializeColors
-
simpleSerializeEffect
-
simpleSerializeEffects
public static List<Map<String,Object>> simpleSerializeEffects(Collection<org.bukkit.FireworkEffect> effects) -
compact
public static org.bukkit.inventory.ItemStack[] compact(boolean respectStackSize, org.bukkit.inventory.ItemStack... itemsToCompact) Compact given array, it will create the smallest possible array with given items, so it will join duplicated items etc.- Parameters:
respectStackSize- if method should respect max stack size.itemsToCompact- item to compact.- Returns:
- compacted array of items.
-