mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 15:30:19 +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;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isBlock() {
|
||||||
|
return id < 256;
|
||||||
|
}
|
||||||
|
|
||||||
public static Material getMaterial(final int id) {
|
public static Material getMaterial(final int id) {
|
||||||
return lookup.get(id);
|
return lookup.get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
for (Material material : values()) {
|
for (Material material : values()) {
|
||||||
lookup.put(material.getID(), material);
|
lookup.put(material.getID(), material);
|
||||||
|
|
Loading…
Reference in a new issue