Skip to content

Commit

Permalink
use fastutil maps for minor optimisation
Browse files Browse the repository at this point in the history
  • Loading branch information
Abbie5 committed Feb 25, 2025
1 parent d210e75 commit fe0e07d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/java/cc/abbie/amap/client/MapStorage.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import com.google.common.collect.Multimap;

import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;

import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.player.LocalPlayer;
import net.minecraft.core.BlockPos;
Expand Down Expand Up @@ -32,10 +34,10 @@
public class MapStorage implements SurveyorClientEvents.WorldLoad, SurveyorClientEvents.TerrainUpdated, SurveyorClientEvents.LandmarksAdded, SurveyorClientEvents.LandmarksRemoved {
public static final MapStorage INSTANCE = new MapStorage();

public Map<ChunkPos, LayerSummary.Raw[][]> regions = new HashMap<>();
public Map<ChunkPos, RegistryPalette<Block>.ValueView> blockPalettes = new HashMap<>();
public Map<ChunkPos, RegistryPalette<Biome>.ValueView> biomePalettes = new HashMap<>();
public Map<LandmarkType<?>, Map<BlockPos, Landmark<?>>> landmarks = new HashMap<>();
public Map<ChunkPos, LayerSummary.Raw[][]> regions = new Object2ObjectOpenHashMap<>();
public Map<ChunkPos, RegistryPalette<Block>.ValueView> blockPalettes = new Object2ObjectOpenHashMap<>();
public Map<ChunkPos, RegistryPalette<Biome>.ValueView> biomePalettes = new Object2ObjectOpenHashMap<>();
public Map<LandmarkType<?>, Map<BlockPos, Landmark<?>>> landmarks = new Object2ObjectOpenHashMap<>();

@Override
public void onTerrainUpdated(Level level, WorldTerrainSummary terrainSummary, Collection<ChunkPos> chunks) {
Expand Down

0 comments on commit fe0e07d

Please sign in to comment.