mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-31 12:41:25 +01:00
SPIGOT-5341: Add Material.isAir
By: md_5 <git@md-5.net>
This commit is contained in:
parent
fe63b8897f
commit
463b006e43
@ -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…
Reference in New Issue
Block a user