From 959d52a43137a8eee89c10499a1a960e00a56fc6 Mon Sep 17 00:00:00 2001 From: Fabrizio La Rosa Date: Tue, 28 Jul 2020 23:26:10 +0200 Subject: [PATCH] Fix doors not covering all openables --- .../permission/permissions/listening/DoorPermission.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/songoda/skyblock/permission/permissions/listening/DoorPermission.java b/src/main/java/com/songoda/skyblock/permission/permissions/listening/DoorPermission.java index 53543b04..7844dc6b 100644 --- a/src/main/java/com/songoda/skyblock/permission/permissions/listening/DoorPermission.java +++ b/src/main/java/com/songoda/skyblock/permission/permissions/listening/DoorPermission.java @@ -9,6 +9,7 @@ import com.songoda.skyblock.permission.PermissionType; import org.bukkit.entity.Player; import org.bukkit.event.block.Action; import org.bukkit.event.player.PlayerInteractEvent; +import org.bukkit.material.Openable; public class DoorPermission extends ListeningPermission { @@ -27,13 +28,10 @@ public class DoorPermission extends ListeningPermission { if (event.getAction() != Action.RIGHT_CLICK_BLOCK && event.getAction() != Action.LEFT_CLICK_BLOCK) return; - - CompatibleMaterial material = CompatibleMaterial.getMaterial(event.getClickedBlock()); + Player player = event.getPlayer(); - if (material == CompatibleMaterial.BIRCH_DOOR || material == CompatibleMaterial.ACACIA_DOOR - || material == CompatibleMaterial.DARK_OAK_DOOR || material == CompatibleMaterial.JUNGLE_DOOR - || material == CompatibleMaterial.SPRUCE_DOOR || material == CompatibleMaterial.OAK_DOOR) + if (event.getClickedBlock() instanceof Openable) cancelAndMessage(event, player, plugin, messageManager); } }