Class MappedMaterial

java.lang.Object
co.crystaldev.alpinecore.util.MappedMaterial

public final class MappedMaterial extends Object
A helper class offering a flexible way to group and test against various material types.
Since:
0.3.1
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static @NotNull MappedMaterial.Builder
     
    static @NotNull MappedMaterial
    of(@NotNull com.cryptomorin.xseries.XMaterial... materials)
     
    static @NotNull MappedMaterial
    of(@NotNull Collection<com.cryptomorin.xseries.XMaterial> materials)
     
    boolean
    test(@NotNull com.cryptomorin.xseries.XMaterial type)
    Tests if the specified XMaterial is contained within this material map.
    boolean
    test(@NotNull org.bukkit.block.Block block)
    Tests if the specified Block is contained within this material map.
    boolean
    test(@NotNull org.bukkit.inventory.ItemStack item)
    Tests if the specified ItemStack is contained within this material map.
    boolean
    test(@NotNull org.bukkit.Material type)
    Tests if the specified Material is contained within this material map.

    Methods inherited from class java.lang.Object

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

    • MappedMaterial

      public MappedMaterial()
  • Method Details

    • test

      public boolean test(@NotNull @NotNull com.cryptomorin.xseries.XMaterial type)
      Tests if the specified XMaterial is contained within this material map.
      Parameters:
      type - the material to test
      Returns:
      true if the material map contains the specified material; false otherwise.
    • test

      public boolean test(@NotNull @NotNull org.bukkit.Material type)
      Tests if the specified Material is contained within this material map.
      Parameters:
      type - the material to test
      Returns:
      true if the material map contains the specified material; false otherwise.
    • test

      public boolean test(@NotNull @NotNull org.bukkit.block.Block block)
      Tests if the specified Block is contained within this material map.
      Parameters:
      block - the block to test
      Returns:
      true if the material map contains the specified material; false otherwise.
    • test

      public boolean test(@NotNull @NotNull org.bukkit.inventory.ItemStack item)
      Tests if the specified ItemStack is contained within this material map.
      Parameters:
      item - the item to test
      Returns:
      true if the material map contains the specified material; false otherwise.
    • of

      @NotNull public static @NotNull MappedMaterial of(@NotNull @NotNull com.cryptomorin.xseries.XMaterial... materials)
    • of

      @NotNull public static @NotNull MappedMaterial of(@NotNull @NotNull Collection<com.cryptomorin.xseries.XMaterial> materials)
    • builder

      @NotNull public static @NotNull MappedMaterial.Builder builder()