Optimize biome retrieval

This commit is contained in:
IronApollo 2020-10-14 23:10:55 -04:00
parent e6b083554b
commit 27f16d97b3
3 changed files with 9 additions and 3 deletions

View File

@ -185,10 +185,12 @@ public class Regen_v1_15_R2 extends Regenerator<IChunkAccess, ProtoChunk, Chunk,
public void doTick(BooleanSupplier booleansupplier) { //no ticking
}
private final BiomeBase singleBiome = options.hasBiomeType() ? IRegistry.BIOME.get(MinecraftKey.a(options.getBiomeType().getId())) : null;
@Override
public BiomeBase a(int i, int k, int j) {
if (options.hasBiomeType()) {
return IRegistry.BIOME.get(MinecraftKey.a(options.getBiomeType().getId()));
return singleBiome;
}
return this.getChunkProvider().getChunkGenerator().getWorldChunkManager().getBiome(i, j, k);
}

View File

@ -203,10 +203,12 @@ public class Regen_v1_16_R1 extends Regenerator<IChunkAccess, ProtoChunk, Chunk,
public void doTick(BooleanSupplier booleansupplier) { //no ticking
}
private final BiomeBase singleBiome = options.hasBiomeType() ? IRegistry.BIOME.get(MinecraftKey.a(options.getBiomeType().getId())) : null;
@Override
public BiomeBase a(int i, int j, int k) {
if (options.hasBiomeType()) {
return IRegistry.BIOME.get(MinecraftKey.a(options.getBiomeType().getId()));
return singleBiome;
}
return this.getChunkProvider().getChunkGenerator().getWorldChunkManager().getBiome(i, j, k);
}

View File

@ -208,10 +208,12 @@ public class Regen_v1_16_R2 extends Regenerator<IChunkAccess, ProtoChunk, Chunk,
public void doTick(BooleanSupplier booleansupplier) { //no ticking
}
private final BiomeBase singleBiome = options.hasBiomeType() ? RegistryGeneration.WORLDGEN_BIOME.get(MinecraftKey.a(options.getBiomeType().getId())) : null;
@Override
public BiomeBase a(int i, int j, int k) {
if (options.hasBiomeType()) {
return RegistryGeneration.WORLDGEN_BIOME.get(MinecraftKey.a(options.getBiomeType().getId()));
return singleBiome;
}
return this.getChunkProvider().getChunkGenerator().getWorldChunkManager().getBiome(i, j, k);
}