Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
import net.minecraftforge.fluids.FluidRegistry;
import net.minecraftforge.fluids.FluidStack;

import it.unimi.dsi.fastutil.bytes.Byte2ObjectOpenHashMap;
import org.jetbrains.annotations.Nullable;

import java.awt.*;
import java.awt.image.BufferedImage;
import java.awt.image.WritableRaster;
import java.util.HashMap;
import java.util.Map;

public class ProspectingTexture extends AbstractTexture {

Expand All @@ -29,8 +30,8 @@ public class ProspectingTexture extends AbstractTexture {
private boolean darkMode;
private int imageWidth = -1;
private int imageHeight = -1;
public final HashMap<Byte, String>[][] map;
public static HashMap<Byte, String> emptyTag = new HashMap<>();
public final Map<Byte, String>[][] map;
public static Map<Byte, String> emptyTag = new Byte2ObjectOpenHashMap<>();
private int playerXGui;
private int playerYGui;
private final ProspectorMode mode;
Expand All @@ -42,10 +43,10 @@ public ProspectingTexture(ProspectorMode mode, int radius, boolean darkMode) {
this.mode = mode;
if (this.mode == ProspectorMode.FLUID) {
// noinspection unchecked
map = new HashMap[(radius * 2 - 1)][(radius * 2 - 1)];
map = new Byte2ObjectOpenHashMap[(radius * 2 - 1)][(radius * 2 - 1)];
} else {
// noinspection unchecked
map = new HashMap[(radius * 2 - 1) * 16][(radius * 2 - 1) * 16];
map = new Byte2ObjectOpenHashMap[(radius * 2 - 1) * 16][(radius * 2 - 1) * 16];
}
}

Expand Down Expand Up @@ -102,7 +103,7 @@ private BufferedImage getImage() {

for (int i = 0; i < wh; i++) {
for (int j = 0; j < wh; j++) {
HashMap<Byte, String> data = this.map[this.mode == ProspectorMode.ORE ? i : i / 16][this.mode ==
Map<Byte, String> data = this.map[this.mode == ProspectorMode.ORE ? i : i / 16][this.mode ==
ProspectorMode.ORE ? j : j / 16];
// draw bg
image.setRGB(i, j, ((data == null) ^ darkMode) ? Color.darkGray.getRGB() : Color.WHITE.getRGB());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public void drawInForeground(int mouseX, int mouseY) {
if (ProspectingTexture.SELECTED_ALL.equals(texture.getSelected()) ||
texture.getSelected().equals(dict)) {
oreInfo.put(name, oreInfo.getOrDefault(name, 0) + 1);
oreHeight.put(name, oreHeight.getOrDefault(name, 0) + height.intValue());
oreHeight.put(name, oreHeight.getOrDefault(name, 0) + Byte.toUnsignedInt(height));
if (oreInfo.get(name) > maxAmount[0]) {
maxAmount[0] = oreInfo.get(name);
MaterialStack m = OreDictUnifier.getMaterial(OreDictUnifier.get(dict));
Expand Down
Loading