Class CustomStackUtils

java.lang.Object
com.mclds.plugins.customplugin.utils.CustomStackUtils

public class CustomStackUtils extends Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    getNamespacedID(@NotNull org.bukkit.inventory.ItemStack itemStack)
     
    static String
    getNamespacedID(org.bukkit.Material material)
     
    static boolean
    hasNamespacedId(String namespacedId)
     
    static boolean
    invalidIcons(org.bukkit.entity.Player player, @Nullable Map map)
     
    static org.bukkit.Material
    material(String namespacedId)
     
    static @Nullable org.bukkit.inventory.ItemStack
    of(String namespacedId)
     
    static @Nullable org.bukkit.inventory.ItemStack
     
    static @Nullable org.bukkit.inventory.ItemStack
    of(String namespacedId, String displayName)
     
    static @Nullable org.bukkit.inventory.ItemStack
    of(String namespacedId, String displayName, List<net.kyori.adventure.text.TextComponent> lore)
     
    static @Nullable org.bukkit.inventory.ItemStack
    of(String namespacedId, net.kyori.adventure.text.Component displayName, List<net.kyori.adventure.text.TextComponent> lore)
     
    static @Nullable Map<String,@NotNull org.bukkit.inventory.ItemStack>
    require(String... namespacedIds)
    检查是否有指定的物品,如果全部存在,则返回一个Map,否则返回 null
    static @Nullable Map<String,@NotNull org.bukkit.inventory.ItemStack>
    requireWithName(String... namespacedIdsWithName)
    检查是否有指定的物品,如果全部存在,则返回一个Map,否则返回 null 格式为:单数是物品名,双数是物品名对应 NamespacedId
    static boolean
    same(org.bukkit.inventory.ItemStack i1, org.bukkit.inventory.ItemStack i2)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CustomStackUtils

      public CustomStackUtils()
  • Method Details

    • material

      public static org.bukkit.Material material(String namespacedId)
    • same

      public static boolean same(org.bukkit.inventory.ItemStack i1, org.bukkit.inventory.ItemStack i2)
    • require

      @Nullable public static @Nullable Map<String,@NotNull org.bukkit.inventory.ItemStack> require(String... namespacedIds)
      检查是否有指定的物品,如果全部存在,则返回一个Map,否则返回 null
      Parameters:
      namespacedIds - 物品列表
      Returns:
      是否有指定的物品,只要有一个不存在就返回 null
    • requireWithName

      @Nullable public static @Nullable Map<String,@NotNull org.bukkit.inventory.ItemStack> requireWithName(String... namespacedIdsWithName)
      检查是否有指定的物品,如果全部存在,则返回一个Map,否则返回 null 格式为:单数是物品名,双数是物品名对应 NamespacedId
      Returns:
      是否有指定的物品,只要有一个不存在,或者参数数量为奇数就返回 null
    • invalidIcons

      public static boolean invalidIcons(org.bukkit.entity.Player player, @Nullable @Nullable Map map)
    • of

      @Nullable public static @Nullable org.bukkit.inventory.ItemStack of(String namespacedId)
    • hasNamespacedId

      public static boolean hasNamespacedId(String namespacedId)
    • getNamespacedID

      public static String getNamespacedID(org.bukkit.Material material)
    • getNamespacedID

      public static String getNamespacedID(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
    • of

      @Nullable public static @Nullable org.bukkit.inventory.ItemStack of(String namespacedId, String displayName, List<net.kyori.adventure.text.TextComponent> lore)
    • of

      @Nullable public static @Nullable org.bukkit.inventory.ItemStack of(String namespacedId, net.kyori.adventure.text.Component displayName, List<net.kyori.adventure.text.TextComponent> lore)
    • of

      @Nullable public static @Nullable org.bukkit.inventory.ItemStack of(String namespacedId, String displayName)
    • of

      @Nullable public static @Nullable org.bukkit.inventory.ItemStack of(String namespacedId, CustomStackUtils.CustomStackHandler handler)