Biome height support
This commit is contained in:
parent
21358808e4
commit
cee5c914f9
36 changed files with 212 additions and 41 deletions
|
@ -10,17 +10,23 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import net.minecraft.world.biome.source.BiomeSource;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.gen.chunk.ChunkGeneratorSettings;
|
||||
import net.minecraft.world.gen.chunk.NoiseChunkGenerator;
|
||||
import net.minecraft.world.gen.chunk.StructuresConfig;
|
||||
import ru.betterend.world.generator.GeneratorOptions;
|
||||
import ru.betterend.world.generator.TerrainGenerator;
|
||||
|
||||
@Mixin(NoiseChunkGenerator.class)
|
||||
public abstract class NoiseChunkGeneratorMixin {
|
||||
public abstract class NoiseChunkGeneratorMixin extends ChunkGenerator {
|
||||
@Final
|
||||
@Shadow
|
||||
protected Supplier<ChunkGeneratorSettings> settings;
|
||||
|
||||
public NoiseChunkGeneratorMixin(BiomeSource populationSource, BiomeSource biomeSource, StructuresConfig structuresConfig, long worldSeed) {
|
||||
super(populationSource, biomeSource, structuresConfig, worldSeed);
|
||||
}
|
||||
|
||||
@Inject(method = "<init>(Lnet/minecraft/world/biome/source/BiomeSource;Lnet/minecraft/world/biome/source/BiomeSource;JLjava/util/function/Supplier;)V", at = @At("TAIL"))
|
||||
private void beOnInit(BiomeSource populationSource, BiomeSource biomeSource, long seed, Supplier<ChunkGeneratorSettings> settings, CallbackInfo info) {
|
||||
TerrainGenerator.initNoise(seed);
|
||||
|
@ -30,7 +36,7 @@ public abstract class NoiseChunkGeneratorMixin {
|
|||
private void beSampleNoiseColumn(double[] buffer, int x, int z, CallbackInfo info) {
|
||||
if (GeneratorOptions.useNewGenerator() && settings.get().equals(ChunkGeneratorSettings.END)) {
|
||||
if (TerrainGenerator.canGenerate(x, z)) {
|
||||
TerrainGenerator.fillTerrainDensity(buffer, x, z);
|
||||
TerrainGenerator.fillTerrainDensity(buffer, x, z, getBiomeSource());
|
||||
info.cancel();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue