Custom Filter
Some methods (e.g. the getSoundFiles
methods in the ServerApi) can be passed a filter argument to filter the results. By default there are two predefined filters. However, if you want to add your own filter, follow these steps:
- Create a new class that either extends from AbstractFilter or (if more controllers are needed) implements the IFilter interface.
- Override the
isValid()
method and include an implementation of your filter. - Now register the filter once in the FilterRegistry right at the beginning when loading the mod.