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); } }