From 463b006e433efdbab2b134ca3ccb8443f083e5c3 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sun, 6 Oct 2019 18:41:45 +1100 Subject: [PATCH] SPIGOT-5341: Add Material.isAir By: md_5 --- .../src/main/java/org/bukkit/Material.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/Material.java b/paper-api/src/main/java/org/bukkit/Material.java index b9838dc96..ce3bb9155 100644 --- a/paper-api/src/main/java/org/bukkit/Material.java +++ b/paper-api/src/main/java/org/bukkit/Material.java @@ -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) { + // + case AIR: + case CAVE_AIR: + case VOID_AIR: + // ----- Legacy Separator ----- + case LEGACY_AIR: + // + return true; + default: + return false; + } + } + /** * Check if the material is a block and does not block any light *