Skip to content

Commit

Permalink
fix tag race
Browse files Browse the repository at this point in the history
  • Loading branch information
sisby-folk committed May 31, 2024
1 parent c84ac95 commit 9bfa690
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ org.gradle.configureondemand=true
# Enable advanced multi-module optimizations (share tiny-remaper instance between projects)
fabric.loom.multiProjectOptimisation=true
# Mod Properties
baseVersion = 2.8.1
baseVersion = 2.8.2
defaultBranch = 1.20
branch = 1.20
2 changes: 2 additions & 0 deletions src/main/java/folk/sisby/antique_atlas/WorldAtlasData.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package folk.sisby.antique_atlas;

import com.google.common.collect.Multimap;
import folk.sisby.antique_atlas.reloader.BiomeTileProviders;
import folk.sisby.antique_atlas.reloader.MarkerTextures;
import folk.sisby.antique_atlas.reloader.StructureTileProviders;
import folk.sisby.antique_atlas.util.Rect;
Expand Down Expand Up @@ -77,6 +78,7 @@ public void onStructuresAdded(World world, WorldStructureSummary ws, Multimap<Re
}

public void tick(World world) {
if (!BiomeTileProviders.getInstance().hasFallbacks()) return;
for (int i = 0; i < AntiqueAtlas.CONFIG.chunkTickLimit; i++) {
ChunkPos pos = terrainDeque.pollFirst();
if (pos == null) break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public static BiomeTileProviders getInstance() {

private final Map<Identifier, TerrainTileProvider> tileProviders = new HashMap<>();
private final Map<Identifier, Identifier> biomeFallbacks = new HashMap<>();
private boolean hasFallbacks = false;

public BiomeTileProviders() {
super(new Gson(), "atlas/biome");
Expand Down Expand Up @@ -71,12 +72,18 @@ public void registerFallbacks(Registry<Biome> biomeRegistry) {
if (AntiqueAtlas.CONFIG.fallbackFailHandling == AntiqueAtlasConfig.FallbackHandling.CRASH) throw new IllegalStateException("Antique Atlas fallback biome registration failed! Fix the missing biome or change fallbackFailHandling in antique_atlas.toml");
}
}
hasFallbacks = true;
}

public void clearFallbacks() {
hasFallbacks = false;
biomeFallbacks.clear();
}

public boolean hasFallbacks() {
return hasFallbacks;
}

private static Identifier getFallbackBiome(RegistryEntry<Biome> biome) {
if (biome.isIn(ConventionalBiomeTags.VOID) || biome.isIn(ForgeTags.Biomes.IS_VOID)) {
return BiomeKeys.THE_VOID.getValue();
Expand Down

0 comments on commit 9bfa690

Please sign in to comment.