Skip to main content
The Deno 2 Release Candidate is here
Learn more
class ItemFilterService
import { ItemFilterService } from "https://deno.land/x/sptaki@1.2.0/services/mod.ts";

Centralise the handling of blacklisting items, uses blacklist found in config/item.json, stores items that should not be used by players / broken items

Constructors

new
ItemFilterService(
logger: ILogger,
databaseServer: DatabaseServer,
configServer: ConfigServer,
)

Properties

protected
configServer: ConfigServer
protected
databaseServer: DatabaseServer
protected
itemConfig: IItemConfig
protected
logger: ILogger

Methods

Return every template id blacklisted in config/item.json

getBossItems(): string[]

Return boss items in config/item.json

Get an array of items that should never be given as a reward to player

isBossItem(tpl: string): boolean

Check if the provided template id is boss item in config/item.json

isItemBlacklisted(tpl: string): boolean

Check if the provided template id is blacklisted in config/item.json

isItemRewardBlacklisted(tpl: string): boolean

Check if item is blacklisted from being a reward for player