mirror of
https://github.com/FabricMC/fabric.git
synced 2024-11-24 16:48:02 -05:00
Fixed end biome source injection (#2940)
(cherry picked from commit348a9c6486
) (cherry picked from commitf1c68e5823
)
This commit is contained in:
parent
68a20504ee
commit
16f1e31314
1 changed files with 9 additions and 2 deletions
|
@ -43,6 +43,9 @@ public class TheEndBiomeSourceMixin extends BiomeSourceMixin {
|
||||||
@Unique
|
@Unique
|
||||||
private boolean biomeSetModified = false;
|
private boolean biomeSetModified = false;
|
||||||
|
|
||||||
|
@Unique
|
||||||
|
private boolean hasCheckedForModifiedSet = false;
|
||||||
|
|
||||||
@Inject(method = "<init>", at = @At("RETURN"))
|
@Inject(method = "<init>", at = @At("RETURN"))
|
||||||
private void init(Registry<Biome> biomeRegistry, CallbackInfo ci) {
|
private void init(Registry<Biome> biomeRegistry, CallbackInfo ci) {
|
||||||
overrides = Suppliers.memoize(() -> TheEndBiomeData.createOverrides(biomeRegistry));
|
overrides = Suppliers.memoize(() -> TheEndBiomeData.createOverrides(biomeRegistry));
|
||||||
|
@ -55,8 +58,12 @@ public class TheEndBiomeSourceMixin extends BiomeSourceMixin {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void fabric_modifyBiomeSet(Set<RegistryEntry<Biome>> biomes) {
|
protected void fabric_modifyBiomeSet(Set<RegistryEntry<Biome>> biomes) {
|
||||||
if (!biomeSetModified) {
|
if (!hasCheckedForModifiedSet) {
|
||||||
biomeSetModified = true;
|
hasCheckedForModifiedSet = true;
|
||||||
|
biomeSetModified = !overrides.get().customBiomes.isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (biomeSetModified) {
|
||||||
biomes.addAll(overrides.get().customBiomes);
|
biomes.addAll(overrides.get().customBiomes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue