SPIGOT-5341: Add Material.isAir

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot 2019-10-06 18:41:45 +11:00
parent fe63b8897f
commit 463b006e43

View File

@ -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
*