Skip to content

Commit

Permalink
replace var with explicit type
Browse files Browse the repository at this point in the history
  • Loading branch information
Abbie5 committed Feb 25, 2025
1 parent fe0e07d commit 70b2df0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/main/java/cc/abbie/amap/client/AMapWorldRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void afterEntities(WorldRenderContext context) {

for (Map.Entry<LandmarkType<?>, Map<BlockPos, Landmark<?>>> entry : MapStorage.INSTANCE.landmarks.entrySet()) {
LandmarkType<?> type = entry.getKey();
for (var entry2 : entry.getValue().entrySet()) {
for (Map.Entry<BlockPos, Landmark<?>> entry2 : entry.getValue().entrySet()) {
BlockPos pos = entry2.getKey();
Landmark<?> landmark = entry2.getValue();
int color = Objects.requireNonNullElse(landmark.color(), DyeColor.WHITE).getTextureDiffuseColor();
Expand Down
21 changes: 11 additions & 10 deletions src/main/java/cc/abbie/amap/client/ChunkRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import folk.sisby.surveyor.terrain.LayerSummary;
import folk.sisby.surveyor.terrain.RegionSummary;
import folk.sisby.surveyor.util.RegistryPalette;

import java.util.HashMap;
import java.util.HashSet;
Expand All @@ -43,10 +44,10 @@ public static void bakeChunk(ChunkPos chunkPos) {
LayerSummary.Raw[][] northTerr = MapStorage.INSTANCE.regions.get(northRegionPos);
if (northTerr == null) return;

var northBlockPalette = MapStorage.INSTANCE.blockPalettes.get(northChunkPos);
RegistryPalette<Block>.ValueView northBlockPalette = MapStorage.INSTANCE.blockPalettes.get(northChunkPos);
if (northBlockPalette == null) return;

var northBiomePalette = MapStorage.INSTANCE.biomePalettes.get(northChunkPos);
RegistryPalette<Biome>.ValueView northBiomePalette = MapStorage.INSTANCE.biomePalettes.get(northChunkPos);
if (northBiomePalette == null) return;

if (dirtyChunks.contains(chunkPos)) {
Expand All @@ -64,20 +65,20 @@ public static void bakeChunk(ChunkPos chunkPos) {
ChunkPos regionPos = new ChunkPos(RegionSummary.chunkToRegion(chunkPos.x), RegionSummary.chunkToRegion(chunkPos.z));
ChunkPos regionRelativePos = new ChunkPos(RegionSummary.regionRelative(chunkPos.x), RegionSummary.regionRelative(chunkPos.z));
LayerSummary.Raw[][] terr = MapStorage.INSTANCE.regions.get(regionPos);
var blockPalette = MapStorage.INSTANCE.blockPalettes.get(chunkPos);
var biomePalette = MapStorage.INSTANCE.biomePalettes.get(chunkPos);
RegistryPalette<Block>.ValueView blockPalette = MapStorage.INSTANCE.blockPalettes.get(chunkPos);
RegistryPalette<Biome>.ValueView biomePalette = MapStorage.INSTANCE.biomePalettes.get(chunkPos);

if (terr == null || blockPalette == null || biomePalette == null)
return;

var summ = terr[regionRelativePos.x][regionRelativePos.z];
var northSumm = northTerr[northRegionRelativePos.x][northRegionRelativePos.z];
LayerSummary.Raw summ = terr[regionRelativePos.x][regionRelativePos.z];
LayerSummary.Raw northSumm = northTerr[northRegionRelativePos.x][northRegionRelativePos.z];
if (summ == null || northSumm == null) return;

var blocks = summ.blocks();
var biomes = summ.biomes();
var northBlocks = northSumm.blocks();
var northBiomes = northSumm.biomes();
int[] blocks = summ.blocks();
int[] biomes = summ.biomes();
int[] northBlocks = northSumm.blocks();
int[] northBiomes = northSumm.biomes();
if (blocks == null || biomes == null || northBlocks == null || northBiomes == null) return;

ResourceLocation textureLocation = textures.get(regionPos);
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/cc/abbie/amap/client/minimap/MinimapHud.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import folk.sisby.surveyor.landmark.LandmarkType;
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;

import java.util.Map;
import java.util.Objects;

public class MinimapHud implements HudRenderCallback {
Expand Down Expand Up @@ -147,9 +148,9 @@ public void onHudRender(GuiGraphics gui, DeltaTracker deltaTracker) {
pose.popPose();
}

for (var entry : MapStorage.INSTANCE.landmarks.entrySet()) {
for (Map.Entry<LandmarkType<?>, Map<BlockPos, Landmark<?>>> entry : MapStorage.INSTANCE.landmarks.entrySet()) {
LandmarkType<?> type = entry.getKey();
for (var entry2 : entry.getValue().entrySet()) {
for (Map.Entry<BlockPos, Landmark<?>> entry2 : entry.getValue().entrySet()) {
BlockPos pos = entry2.getKey();
Landmark<?> landmark = entry2.getValue();
float[] color = GuiUtil.toFloats(Objects.requireNonNullElse(landmark.color(), DyeColor.WHITE).getTextureDiffuseColor());
Expand Down

0 comments on commit 70b2df0

Please sign in to comment.