From bc1bef573ef37ead9d8c02ec946b0f85a1fc4be9 Mon Sep 17 00:00:00 2001 From: Ghost_chu <2908803755@qq.com> Date: Wed, 28 Jul 2021 01:26:57 +0800 Subject: [PATCH] For newer Minecraft versions, use isAir to instead --- src/main/java/org/maxgamer/quickshop/util/Util.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/org/maxgamer/quickshop/util/Util.java b/src/main/java/org/maxgamer/quickshop/util/Util.java index f451b9d76..ff7e3e6d8 100644 --- a/src/main/java/org/maxgamer/quickshop/util/Util.java +++ b/src/main/java/org/maxgamer/quickshop/util/Util.java @@ -841,6 +841,10 @@ public class Util { } public static boolean isAir(@NotNull Material mat) { + try { + return isAir0(mat); // For newer versions, we had better use Bukkit API + } catch (Exception ignored) { + } if (mat == Material.AIR) { return true; } @@ -858,6 +862,11 @@ public class Util { return false; } + @SuppressWarnings("RedundantThrows") + private static boolean isAir0(@NotNull Material mat) throws Exception { + return mat.isAir(); + } + /** * Check a material is or not a WALL_SIGN *