1414import net .minecraftforge .fluids .FluidRegistry ;
1515import net .minecraftforge .fluids .FluidStack ;
1616
17+ import it .unimi .dsi .fastutil .bytes .Byte2ObjectOpenHashMap ;
1718import org .jetbrains .annotations .Nullable ;
1819
1920import java .awt .*;
2021import java .awt .image .BufferedImage ;
2122import java .awt .image .WritableRaster ;
22- import java .util .HashMap ;
23+ import java .util .Map ;
2324
2425public class ProspectingTexture extends AbstractTexture {
2526
@@ -29,8 +30,8 @@ public class ProspectingTexture extends AbstractTexture {
2930 private boolean darkMode ;
3031 private int imageWidth = -1 ;
3132 private int imageHeight = -1 ;
32- public final HashMap <Byte , String >[][] map ;
33- public static HashMap <Byte , String > emptyTag = new HashMap <>();
33+ public final Map <Byte , String >[][] map ;
34+ public static Map <Byte , String > emptyTag = new Byte2ObjectOpenHashMap <>();
3435 private int playerXGui ;
3536 private int playerYGui ;
3637 private final ProspectorMode mode ;
@@ -42,10 +43,10 @@ public ProspectingTexture(ProspectorMode mode, int radius, boolean darkMode) {
4243 this .mode = mode ;
4344 if (this .mode == ProspectorMode .FLUID ) {
4445 // noinspection unchecked
45- map = new HashMap [(radius * 2 - 1 )][(radius * 2 - 1 )];
46+ map = new Byte2ObjectOpenHashMap [(radius * 2 - 1 )][(radius * 2 - 1 )];
4647 } else {
4748 // noinspection unchecked
48- map = new HashMap [(radius * 2 - 1 ) * 16 ][(radius * 2 - 1 ) * 16 ];
49+ map = new Byte2ObjectOpenHashMap [(radius * 2 - 1 ) * 16 ][(radius * 2 - 1 ) * 16 ];
4950 }
5051 }
5152
@@ -102,7 +103,7 @@ private BufferedImage getImage() {
102103
103104 for (int i = 0 ; i < wh ; i ++) {
104105 for (int j = 0 ; j < wh ; j ++) {
105- HashMap <Byte , String > data = this .map [this .mode == ProspectorMode .ORE ? i : i / 16 ][this .mode ==
106+ Map <Byte , String > data = this .map [this .mode == ProspectorMode .ORE ? i : i / 16 ][this .mode ==
106107 ProspectorMode .ORE ? j : j / 16 ];
107108 // draw bg
108109 image .setRGB (i , j , ((data == null ) ^ darkMode ) ? Color .darkGray .getRGB () : Color .WHITE .getRGB ());
0 commit comments