My attempt at maintaining this great mod, from the source code posted by @richardg867