diff --git a/src/API/api.js b/src/API/api.js index c750b200..e0890594 100644 --- a/src/API/api.js +++ b/src/API/api.js @@ -1080,6 +1080,23 @@ class API { return PileUtilities.isItemPileMerchant(target, data); } + /** + * Whether an item pile is a banker. If it is not enabled, it is always false. + * + * @param {Token/TokenDocument} target + * @param {Object/boolean} [data=false] data existing flags data to use + * @return {boolean} + */ + static isItemPileBanker(target, data = false) { + if (!game.modules.get("item_piles_bankers")?.active) { + let word = "install and activate"; + if (game.modules.get('item_piles_bankers')) word = "activate"; + Helpers.custom_warning(`This api method from Item Piles requires the 'item_piles_bankers' module. Please ${word} it.`, true); + return false; + } + return PileUtilities.isItemPileBanker(target, data); + } + /** * Whether an item pile is a merchant. If it is not enabled, it is always false. *