From 8786cdd710497219a2432ac308eff3bbe284808b Mon Sep 17 00:00:00 2001 From: Fabrizio La Rosa Date: Tue, 28 Jul 2020 23:26:00 +0200 Subject: [PATCH] Fix for furnaces not covering all furnaces types --- .../permission/permissions/listening/FurnacePermission.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/songoda/skyblock/permission/permissions/listening/FurnacePermission.java b/src/main/java/com/songoda/skyblock/permission/permissions/listening/FurnacePermission.java index 07c21595..64c1f769 100644 --- a/src/main/java/com/songoda/skyblock/permission/permissions/listening/FurnacePermission.java +++ b/src/main/java/com/songoda/skyblock/permission/permissions/listening/FurnacePermission.java @@ -7,6 +7,7 @@ import com.songoda.skyblock.permission.ListeningPermission; import com.songoda.skyblock.permission.PermissionHandler; import com.songoda.skyblock.permission.PermissionType; import org.bukkit.block.Block; +import org.bukkit.block.Furnace; import org.bukkit.entity.Player; import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; @@ -24,15 +25,13 @@ public class FurnacePermission extends ListeningPermission { @PermissionHandler public void onInteract(PlayerInteractEvent event) { - - if (event.getAction() != Action.RIGHT_CLICK_BLOCK && event.getAction() != Action.LEFT_CLICK_BLOCK) return; Player player = event.getPlayer(); Block block = event.getClickedBlock(); - if (CompatibleMaterial.getMaterial(block) == CompatibleMaterial.FURNACE) + if (block != null && block.getState() instanceof Furnace) cancelAndMessage(event, player, plugin, messageManager); } }