Industrial Foregoing

Industrial Foregoing

95M Downloads

Minor color determination inefficiency

sfPlayer1 opened this issue ยท 0 comments

commented

The two implementations of getColorFrom() iterate over all mipmap levels:
https://github.com/Buuz135/Industrial-Foregoing/blob/master/src/main/java/com/buuz135/industrial/utils/ColorUtils.java#L47

This is not really needed, it should be enough to process only the smallest layer at pixelMatrix[pixelMatrix.length - 1], which was already downsampled by MC depending on the user's configuration. If MC's downsampling is not suitable for the application, only the largest layer at pixelMatrix[0] should be used.

FluidUtils.getFluidColor normally caches the return value, making this change rather superfluous, but I still think it's cleaner and there may be other uses that don't use caching.