11package dev .ftb .mods .ftbchunks .client .minimap ;
22
33import com .mojang .blaze3d .platform .NativeImage ;
4+ import com .mojang .blaze3d .systems .RenderSystem ;
5+ import com .mojang .blaze3d .textures .AddressMode ;
6+ import com .mojang .blaze3d .textures .FilterMode ;
47import dev .ftb .mods .ftbchunks .FTBChunks ;
58import dev .ftb .mods .ftbchunks .api .FTBChunksAPI ;
9+ import dev .ftb .mods .ftbchunks .client .FTBChunksClientConfig ;
610import dev .ftb .mods .ftbchunks .client .map .MapDimension ;
711import dev .ftb .mods .ftbchunks .client .map .MapRegion ;
812import dev .ftb .mods .ftblibrary .math .XZ ;
@@ -25,7 +29,16 @@ public MinimapRegionCutoutTexture() {
2529 image = new NativeImage (NativeImage .Format .RGBA , size , size , true );
2630 image .fillRect (0 , 0 , size , size , 0 );
2731
28- texture = new DynamicTexture (ID ::toString , image );
32+ texture = new DynamicTexture (ID ::toString , image ) {
33+ @ Override
34+ public void upload () {
35+ MinimapBlurMode blurMode = FTBChunksClientConfig .MINIMAP_BLUR_MODE .get ();
36+ boolean minimapBlur = blurMode == MinimapBlurMode .AUTO ? (FTBChunksClientConfig .MINIMAP_ZOOM .get () < 1.5 ) : blurMode == MinimapBlurMode .ON ;
37+ FilterMode filter = minimapBlur ? FilterMode .LINEAR : FilterMode .NEAREST ;
38+ this .sampler = RenderSystem .getSamplerCache ().getSampler (AddressMode .CLAMP_TO_EDGE , AddressMode .CLAMP_TO_EDGE , filter , filter , false );
39+ super .upload ();
40+ }
41+ };
2942 Minecraft .getInstance ().getTextureManager ().register (ID , texture );
3043 }
3144
0 commit comments