PolyhedralDev / Terra

Voxel world generation modding platform
MIT License
642 stars 85 forks source link

[Bug] Same image gets loaded multiple times for each reference #390

Closed Astrashh closed 1 year ago

Astrashh commented 1 year ago

Issue Description

When using image multiple image samplers pointing to the same image path, the image gets loaded for each sampler. For abstract configs using image samplers that get extended a lot, this can quickly eat up memory, especially with large images.

This can be avoided by adding an image cache in each config pack, and letting the BufferedImage loader populate and hand out instances via the cache.

Full stacktrace

Posted by Daeron ( Garage Rock Summer Era)#1297 on discord https://mclo.gs/IZbt6lh

Astrashh commented 1 year ago

Fixed in b10130c slated for v6.3.0