mirror of
https://github.com/songoda/SongodaCore.git
synced 2025-02-06 14:42:03 +01:00
little convenient material lookup
This commit is contained in:
parent
a2c9037608
commit
cb2832001a
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user