little convenient material lookup

This commit is contained in:
jascotty2 2019-08-23 16:36:01 -05:00
parent a2c9037608
commit cb2832001a

View File

@ -1137,6 +1137,16 @@ public enum LegacyMaterials {
return name == null ? null : lookupMap.get(name.toUpperCase());
}
/**
* Lookup a Legacy Material by bukkit material.
*
* @param mat item to lookup
* @return LegacyMaterial or null if none found
*/
public static LegacyMaterials getMaterial(Material mat) {
return mat == null ? null : lookupMap.get(mat.name());
}
/**
* Lookup a Legacy Material by its modern id name and return its associated Item. <br />
* This also can grab materials by their legacy, but only if there is no modern material by that name.