Class XMaterialUtil


  • public final class XMaterialUtil
    extends Object
    This class is excluded from the repository by default. If you wish to add it to your project, you can download it directly from GitHub.

    All the following methods are taken directly from Spigot with minimal changes. https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/browse/src/main/java/org/bukkit/Material.java

    Author:
    Crypto Morin
    • Constructor Detail

      • XMaterialUtil

        public XMaterialUtil()
    • Method Detail

      • isItem

        public boolean isItem​(XMaterial material)
        Checks if this Material is an obtainable item. "Obtainable items" are simply materials that can be displayed in your GUI. This method is mainly designed to support pre-1.13, servers using 1.13 and above will directly have their materials checked with Material.isItem()
        Returns:
        true if this material is an item.
        Since:
        1.13
      • isInteractable

        public boolean isInteractable​(XMaterial material)
        Checks if this Material can be interacted with.

        Interactable materials include those with functionality when they are interacted with by a player such as chests, furnaces, etc.

        Some blocks such as piston heads and stairs are considered interactable though may not perform any additional functionality.

        Note that the interactability of some materials may be dependant on their state as well. This method will return true if there is at least one state in which additional interact handling is performed for the material.

        Returns:
        true if this material can be interacted with.
        Since:
        1.13
      • isAir

        public boolean isAir​(XMaterial material)
        Check if the material is an air block.
        Returns:
        True if this material is an air block.
        Since:
        1.14.4