From e154dc606756149a2ec4d372ca3fcc02763636be Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 6 Oct 2018 21:14:29 -0400 Subject: [PATCH] Material API additions diff --git a/src/main/java/org/bukkit/Material.java b/src/main/java/org/bukkit/Material.java index 387a0d7c..df5b0d38 100644 --- a/src/main/java/org/bukkit/Material.java +++ b/src/main/java/org/bukkit/Material.java @@ -72,6 +72,7 @@ import org.bukkit.material.MaterialData; /** * An enum of all material IDs accepted by the official server and client */ +@SuppressWarnings({"DeprecatedIsStillUsed", "deprecation"}) // Paper public enum Material implements Keyed { // ACACIA_BOAT(27326, 1), @@ -2984,6 +2985,22 @@ public enum Material implements Keyed { } } + // Paper start + + /** + * @return If the type is either AIR, CAVE_AIR or VOID_AIR + */ + public boolean isEmpty() { + switch (this) { + case AIR: + case CAVE_AIR: + case VOID_AIR: + return true; + } + return false; + } + // Paper end + /** * Do not use for any reason. * -- 2.20.1