mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-31 22:22:49 +00:00
SPIGOT-5341: Add Material.isAir
This commit is contained in:
parent
547f5709d4
commit
0399d9d6b6
1 changed files with 20 additions and 0 deletions
|
@ -5035,6 +5035,26 @@ public enum Material implements Keyed {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the material is an air block.
|
||||
*
|
||||
* @return True if this material is an air block.
|
||||
*/
|
||||
public boolean isAir() {
|
||||
switch (this) {
|
||||
//<editor-fold defaultstate="collapsed" desc="isAir">
|
||||
case AIR:
|
||||
case CAVE_AIR:
|
||||
case VOID_AIR:
|
||||
// ----- Legacy Separator -----
|
||||
case LEGACY_AIR:
|
||||
//</editor-fold>
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the material is a block and does not block any light
|
||||
*
|
||||
|
|
Loading…
Add table
Reference in a new issue