Package com.ranull.graves.util
Class MaterialUtil
java.lang.Object
com.ranull.graves.util.MaterialUtil
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.
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanChecks if the given string represents an air block.static booleanisAir(org.bukkit.Material material) Checks if the given material is an air block.static booleanChecks if the given string represents lava.static booleanisLava(org.bukkit.Material material) Checks if the given material is lava.static booleanisPlayerHead(String name) Checks if the given string represents a player head (block or item), across versions.static booleanisPlayerHead(org.bukkit.Material material) Checks if the given material is a player head (block or item), across versions.static booleanisSafeNotSolid(org.bukkit.Material material) Checks if the given material is not solid and is safe (i.e., not lava).static booleanisSafeSolid(org.bukkit.Material material) Checks if the given material is solid and safe (i.e., not lava).private static booleanisSafeSupport(org.bukkit.Material material) private static booleanisSolid(org.bukkit.Material material) Treats certain non-solid “supports” as solid for our purposes.static booleanChecks if the given string represents water.static booleanisWater(org.bukkit.Material material) Checks if the given material is water.
-
Field Details
-
AIR_NAMES
-
WATER_NAMES
-
LAVA_NAMES
-
PLAYER_HEAD_NAMES
-
SAFE_SUPPORTS
-
-
Constructor Details
-
MaterialUtil
private MaterialUtil()
-
-
Method Details
-
isAir
public static boolean isAir(org.bukkit.Material material) Checks if the given material is an air block. -
isAir
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
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). -
isSolid
private static boolean isSolid(org.bukkit.Material material) Treats certain non-solid “supports” as solid for our purposes. -
isSafeSupport
private static boolean isSafeSupport(org.bukkit.Material material) -
isWater
public static boolean isWater(org.bukkit.Material material) Checks if the given material is water. -
isWater
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
Checks if the given string represents a player head (block or item), across versions.
-