Skip to content

Commit

Permalink
Re-add removed API method
Browse files Browse the repository at this point in the history
  • Loading branch information
Haxxer committed Aug 23, 2024
1 parent f70807a commit ab28e05
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/API/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down

0 comments on commit ab28e05

Please sign in to comment.