The content here assumes you have read the custom resolvers section of how_to.md and have a passing knowledge of writing mixins.
This document is incomplete and not extensive, I'm trying my best to make this make sense
The general idea of how to add a new cause of pollution is as simple as a single mixin, throw it in where it will be
caused, call fireEvent() with the proper parameters, and enjoy the fruits of your labor. For inventories, however,
there's an extra step; The mixin must extend PollutionContainer and implement its method, and check its
items if they're also containers and to handle its contents, if necessary, then firing an event on the item itself.
The simplest example of how this is done is found in ItemDestructionMixin.java,
showing off how to do the mixin, as well as how to handle an item's contents.
Given the number of addons for AE2 providing different types of AE storage cells for different resources, creating an
all-encompassing system to handle everything, so a system has been put into place to allow the implementation of custom
handlers. This is done through the AE2CompatHandler
and its inner interface KeyHandler
The primary way to "register" these handlers is through the addHandler() function, attaching your handler to the
type provided. Notably, if (somehow) another mod provided a handler before yours, then an error is thrown as I don't
want to have to figure out how to merge them.
Examples of this are seen in the main file of this mod, CompressedPollution.java, where is also displays the fact that you should always check whether AE2 is present when attempting to access anything in the compatibility handler.