Class MaterialUtil

java.lang.Object
com.ranull.graves.util.MaterialUtil

public final class MaterialUtil extends Object
Utility class for handling various material-related operations across MC 1.8–1.21.x.

Uses string-name checks so it can be compiled against any one API version while recognizing legacy and modern material names at runtime.

  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isAir(String name)
    Checks if the given string represents an air block.
    static boolean
    isAir(org.bukkit.Material material)
    Checks if the given material is an air block.
    static boolean
    isLava(String name)
    Checks if the given string represents lava.
    static boolean
    isLava(org.bukkit.Material material)
    Checks if the given material is lava.
    static boolean
    Checks if the given string represents a player head (block or item), across versions.
    static boolean
    isPlayerHead(org.bukkit.Material material)
    Checks if the given material is a player head (block or item), across versions.
    static boolean
    isSafeNotSolid(org.bukkit.Material material)
    Checks if the given material is not solid and is safe (i.e., not lava).
    static boolean
    isSafeSolid(org.bukkit.Material material)
    Checks if the given material is solid and safe (i.e., not lava).
    static boolean
    Checks if the given string represents water.
    static boolean
    isWater(org.bukkit.Material material)
    Checks if the given material is water.

    Methods inherited from class java.lang.Object

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

    • isAir

      public static boolean isAir(org.bukkit.Material material)
      Checks if the given material is an air block.
    • isAir

      public static boolean isAir(String name)
      Checks if the given string represents an air block.
    • isLava

      public static boolean isLava(org.bukkit.Material material)
      Checks if the given material is lava.
    • isLava

      public static boolean isLava(String name)
      Checks if the given string represents lava.
    • isSafeNotSolid

      public static boolean isSafeNotSolid(org.bukkit.Material material)
      Checks if the given material is not solid and is safe (i.e., not lava).
    • isSafeSolid

      public static boolean isSafeSolid(org.bukkit.Material material)
      Checks if the given material is solid and safe (i.e., not lava).
    • isWater

      public static boolean isWater(org.bukkit.Material material)
      Checks if the given material is water.
    • isWater

      public static boolean isWater(String name)
      Checks if the given string represents water.
    • isPlayerHead

      public static boolean isPlayerHead(org.bukkit.Material material)
      Checks if the given material is a player head (block or item), across versions.
    • isPlayerHead

      public static boolean isPlayerHead(String name)
      Checks if the given string represents a player head (block or item), across versions.