mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 23:10:16 +01:00
Convenience method to see if a material is a block
By: durron597 <martin.jared@gmail.com>
This commit is contained in:
parent
d7bd97f934
commit
8efd0c02c7
1 changed files with 5 additions and 1 deletions
|
@ -193,10 +193,14 @@ public enum Material {
|
|||
return id;
|
||||
}
|
||||
|
||||
public boolean isBlock() {
|
||||
return id < 256;
|
||||
}
|
||||
|
||||
public static Material getMaterial(final int id) {
|
||||
return lookup.get(id);
|
||||
}
|
||||
|
||||
|
||||
static {
|
||||
for (Material material : values()) {
|
||||
lookup.put(material.getID(), material);
|
||||
|
|
Loading…
Reference in a new issue