Skip to content

Commit

Permalink
Fixed end biome source injection (FabricMC#2940)
Browse files Browse the repository at this point in the history
  • Loading branch information
TelepathicGrunt authored Mar 15, 2023
1 parent b8ac354 commit 348a9c6
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public class TheEndBiomeSourceMixin extends BiomeSourceMixin {
@Unique
private boolean biomeSetModified = false;

@Unique
private boolean hasCheckedForModifiedSet = false;

/**
* Modifies the codec, so it calls the static factory method that gives us access to the
* full biome registry instead of just the pre-defined biomes that vanilla uses.
Expand Down Expand Up @@ -106,8 +109,12 @@ private void getWeightedEndBiome(int biomeX, int biomeY, int biomeZ, MultiNoiseU

@Override
protected void fabric_modifyBiomeSet(Set<RegistryEntry<Biome>> biomes) {
if (!biomeSetModified) {
biomeSetModified = true;
if (!hasCheckedForModifiedSet) {
hasCheckedForModifiedSet = true;
biomeSetModified = !overrides.get().customBiomes.isEmpty();
}

if (biomeSetModified) {
biomes.addAll(overrides.get().customBiomes);
}
}
Expand Down

0 comments on commit 348a9c6

Please sign in to comment.