mirror of
https://github.com/FabricMC/fabric.git
synced 2024-11-28 02:26:01 -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
|
||||
private boolean biomeSetModified = false;
|
||||
|
||||
@Unique
|
||||
private boolean hasCheckedForModifiedSet = false;
|
||||
|
||||
@Inject(method = "<init>", at = @At("RETURN"))
|
||||
private void init(Registry<Biome> biomeRegistry, CallbackInfo ci) {
|
||||
overrides = Suppliers.memoize(() -> TheEndBiomeData.createOverrides(biomeRegistry));
|
||||
|
@ -55,8 +58,12 @@ public class TheEndBiomeSourceMixin extends BiomeSourceMixin {
|
|||
|
||||
@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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue