Adopted Changes to BCLBiomeBuilder(paulevsGitch/BCLib#63)

This commit is contained in:
Frank 2022-01-17 14:09:13 +01:00
parent 6b27fba242
commit dc271f08a5
8 changed files with 40 additions and 37 deletions

View file

@ -10,18 +10,18 @@ import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.SurfaceRules; import net.minecraft.world.level.levelgen.SurfaceRules;
import ru.bclib.api.biomes.BCLBiomeBuilder; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.api.biomes.BCLBiomeBuilder.BiomeSupplier;
import ru.bclib.api.biomes.BiomeAPI; import ru.bclib.api.biomes.BiomeAPI;
import ru.bclib.api.surface.SurfaceRuleBuilder; import ru.bclib.api.surface.SurfaceRuleBuilder;
import ru.bclib.interfaces.SurfaceMaterialProvider; import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.bclib.world.biomes.BCLBiome; import ru.bclib.world.biomes.BCLBiome;
import ru.bclib.world.biomes.BCLBiomeSettings;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
import ru.betterend.interfaces.StructureFeaturesAccessor; import ru.betterend.interfaces.StructureFeaturesAccessor;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndSounds; import ru.betterend.registry.EndSounds;
import java.util.function.BiFunction;
public class EndBiome extends BCLBiome implements SurfaceMaterialProvider { public class EndBiome extends BCLBiome implements SurfaceMaterialProvider {
public static class DefaultSurfaceMaterialProvider implements SurfaceMaterialProvider{ public static class DefaultSurfaceMaterialProvider implements SurfaceMaterialProvider{
public static final BlockState END_STONE = Blocks.END_STONE.defaultBlockState(); public static final BlockState END_STONE = Blocks.END_STONE.defaultBlockState();
@ -85,7 +85,7 @@ public class EndBiome extends BCLBiome implements SurfaceMaterialProvider {
protected abstract void addCustomBuildData(BCLBiomeBuilder builder); protected abstract void addCustomBuildData(BCLBiomeBuilder builder);
public BiFunction<ResourceLocation, Biome, EndBiome> getSupplier(){ public BiomeSupplier<EndBiome> getSupplier(){
return EndBiome::new; return EndBiome::new;
} }
@ -98,8 +98,8 @@ public class EndBiome extends BCLBiome implements SurfaceMaterialProvider {
} }
} }
public EndBiome(ResourceLocation biomeID, Biome biome) { public EndBiome(ResourceLocation biomeID, Biome biome, BCLBiomeSettings settings) {
super(biomeID, biome); super(biomeID, biome, settings);
} }
public static EndBiome create(Config biomeConfig){ public static EndBiome create(Config biomeConfig){

View file

@ -2,16 +2,16 @@ package ru.betterend.world.biome.cave;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import ru.bclib.api.biomes.BCLBiomeBuilder; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.api.biomes.BCLBiomeBuilder.BiomeSupplier;
import ru.bclib.world.biomes.BCLBiomeSettings;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndParticles; import ru.betterend.registry.EndParticles;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
import java.util.function.BiFunction;
public class EmptyAuroraCaveBiome extends EndCaveBiome.Config { public class EmptyAuroraCaveBiome extends EndCaveBiome.Config {
public static class Biome extends EndCaveBiome { public static class Biome extends EndCaveBiome {
public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome) { public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome, BCLBiomeSettings settings) {
super(biomeID, biome); super(biomeID, biome, settings);
this.addFloorFeature(EndFeatures.BIG_AURORA_CRYSTAL, 1); this.addFloorFeature(EndFeatures.BIG_AURORA_CRYSTAL, 1);
@ -44,7 +44,7 @@ public class EmptyAuroraCaveBiome extends EndCaveBiome.Config {
} }
@Override @Override
public BiFunction<ResourceLocation, net.minecraft.world.level.biome.Biome, EndBiome> getSupplier() { public BiomeSupplier<EndBiome> getSupplier() {
return EmptyAuroraCaveBiome.Biome::new; return EmptyAuroraCaveBiome.Biome::new;
} }
} }

View file

@ -2,6 +2,8 @@ package ru.betterend.world.biome.cave;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import ru.bclib.api.biomes.BCLBiomeBuilder; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.api.biomes.BCLBiomeBuilder.BiomeSupplier;
import ru.bclib.world.biomes.BCLBiomeSettings;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
@ -9,8 +11,8 @@ import java.util.function.BiFunction;
public class EmptyEndCaveBiome extends EndCaveBiome.Config { public class EmptyEndCaveBiome extends EndCaveBiome.Config {
public static class Biome extends EndCaveBiome { public static class Biome extends EndCaveBiome {
public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome) { public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome, BCLBiomeSettings settings) {
super(biomeID, biome); super(biomeID, biome, settings);
this.addFloorFeature(EndFeatures.END_STONE_STALAGMITE, 1); this.addFloorFeature(EndFeatures.END_STONE_STALAGMITE, 1);
this.addCeilFeature(EndFeatures.END_STONE_STALACTITE, 1); this.addCeilFeature(EndFeatures.END_STONE_STALACTITE, 1);
@ -38,7 +40,7 @@ public class EmptyEndCaveBiome extends EndCaveBiome.Config {
} }
@Override @Override
public BiFunction<ResourceLocation, net.minecraft.world.level.biome.Biome, EndBiome> getSupplier() { public BiomeSupplier<EndBiome> getSupplier() {
return Biome::new; return Biome::new;
} }
} }

View file

@ -2,16 +2,16 @@ package ru.betterend.world.biome.cave;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import ru.bclib.api.biomes.BCLBiomeBuilder; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.api.biomes.BCLBiomeBuilder.BiomeSupplier;
import ru.bclib.world.biomes.BCLBiomeSettings;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndParticles; import ru.betterend.registry.EndParticles;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
import java.util.function.BiFunction;
public class EmptySmaragdantCaveBiome extends EndCaveBiome.Config { public class EmptySmaragdantCaveBiome extends EndCaveBiome.Config {
public static class Biome extends EndCaveBiome { public static class Biome extends EndCaveBiome {
public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome) { public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome, BCLBiomeSettings settings) {
super(biomeID, biome); super(biomeID, biome, settings);
this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL, 1); this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL, 1);
this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL_SHARD, 20); this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL_SHARD, 20);
@ -45,7 +45,7 @@ public class EmptySmaragdantCaveBiome extends EndCaveBiome.Config {
} }
@Override @Override
public BiFunction<ResourceLocation, net.minecraft.world.level.biome.Biome, EndBiome> getSupplier() { public BiomeSupplier<EndBiome> getSupplier() {
return EmptySmaragdantCaveBiome.Biome::new; return EmptySmaragdantCaveBiome.Biome::new;
} }
} }

View file

@ -8,8 +8,10 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.GenerationStep; import net.minecraft.world.level.levelgen.GenerationStep;
import net.minecraft.world.level.levelgen.feature.Feature; import net.minecraft.world.level.levelgen.feature.Feature;
import ru.bclib.api.biomes.BCLBiomeBuilder; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.api.biomes.BCLBiomeBuilder.BiomeSupplier;
import ru.bclib.api.biomes.BiomeAPI; import ru.bclib.api.biomes.BiomeAPI;
import ru.bclib.util.WeightedList; import ru.bclib.util.WeightedList;
import ru.bclib.world.biomes.BCLBiomeSettings;
import ru.bclib.world.features.BCLFeature; import ru.bclib.world.features.BCLFeature;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
import ru.betterend.registry.EndSounds; import ru.betterend.registry.EndSounds;
@ -17,7 +19,6 @@ import ru.betterend.world.biome.EndBiome;
import ru.betterend.world.features.terrain.caves.CaveChunkPopulatorFeature; import ru.betterend.world.features.terrain.caves.CaveChunkPopulatorFeature;
import java.util.Random; import java.util.Random;
import java.util.function.BiFunction;
public class EndCaveBiome extends EndBiome { public class EndCaveBiome extends EndBiome {
public static abstract class Config extends EndBiome.Config { public static abstract class Config extends EndBiome.Config {
@ -45,7 +46,7 @@ public class EndCaveBiome extends EndBiome {
} }
@Override @Override
public BiFunction<ResourceLocation, Biome, EndBiome> getSupplier() { public BiomeSupplier<EndBiome> getSupplier() {
return EndCaveBiome::new; return EndCaveBiome::new;
} }
} }
@ -53,8 +54,8 @@ public class EndCaveBiome extends EndBiome {
private WeightedList<Feature<?>> floorFeatures = new WeightedList<Feature<?>>(); private WeightedList<Feature<?>> floorFeatures = new WeightedList<Feature<?>>();
private WeightedList<Feature<?>> ceilFeatures = new WeightedList<Feature<?>>(); private WeightedList<Feature<?>> ceilFeatures = new WeightedList<Feature<?>>();
public EndCaveBiome(ResourceLocation biomeID, Biome biome) { public EndCaveBiome(ResourceLocation biomeID, Biome biome, BCLBiomeSettings settings) {
super(biomeID, biome); super(biomeID, biome, settings);
} }
public void addFloorFeature(Feature<?> feature, float weight) { public void addFloorFeature(Feature<?> feature, float weight) {

View file

@ -5,20 +5,20 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth; import net.minecraft.util.Mth;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import ru.bclib.api.biomes.BCLBiomeBuilder; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.api.biomes.BCLBiomeBuilder.BiomeSupplier;
import ru.bclib.world.biomes.BCLBiomeSettings;
import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
import java.util.function.BiFunction;
public class JadeCaveBiome extends EndCaveBiome.Config { public class JadeCaveBiome extends EndCaveBiome.Config {
public static class Biome extends EndCaveBiome { public static class Biome extends EndCaveBiome {
private static final OpenSimplexNoise WALL_NOISE = new OpenSimplexNoise("jade_cave".hashCode()); private static final OpenSimplexNoise WALL_NOISE = new OpenSimplexNoise("jade_cave".hashCode());
private static final OpenSimplexNoise DEPTH_NOISE = new OpenSimplexNoise("depth_noise".hashCode()); private static final OpenSimplexNoise DEPTH_NOISE = new OpenSimplexNoise("depth_noise".hashCode());
private static final BlockState[] JADE = new BlockState[3]; private static final BlockState[] JADE = new BlockState[3];
public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome) { public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome, BCLBiomeSettings settings) {
super(biomeID, biome); super(biomeID, biome, settings);
JADE[0] = EndBlocks.VIRID_JADESTONE.stone.defaultBlockState(); JADE[0] = EndBlocks.VIRID_JADESTONE.stone.defaultBlockState();
JADE[1] = EndBlocks.AZURE_JADESTONE.stone.defaultBlockState(); JADE[1] = EndBlocks.AZURE_JADESTONE.stone.defaultBlockState();
@ -47,7 +47,7 @@ public class JadeCaveBiome extends EndCaveBiome.Config {
} }
@Override @Override
public BiFunction<ResourceLocation, net.minecraft.world.level.biome.Biome, EndBiome> getSupplier() { public BiomeSupplier<EndBiome> getSupplier() {
return JadeCaveBiome.Biome::new; return JadeCaveBiome.Biome::new;
} }
} }

View file

@ -4,19 +4,19 @@ import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import ru.bclib.api.biomes.BCLBiomeBuilder; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.api.biomes.BCLBiomeBuilder.BiomeSupplier;
import ru.bclib.blocks.BlockProperties; import ru.bclib.blocks.BlockProperties;
import ru.bclib.interfaces.SurfaceMaterialProvider; import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.bclib.world.biomes.BCLBiomeSettings;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndParticles; import ru.betterend.registry.EndParticles;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
import java.util.function.BiFunction;
public class LushAuroraCaveBiome extends EndCaveBiome.Config { public class LushAuroraCaveBiome extends EndCaveBiome.Config {
public static class Biome extends EndCaveBiome { public static class Biome extends EndCaveBiome {
public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome) { public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome, BCLBiomeSettings settings) {
super(biomeID, biome); super(biomeID, biome, settings);
this.addFloorFeature(EndFeatures.BIG_AURORA_CRYSTAL, 1); this.addFloorFeature(EndFeatures.BIG_AURORA_CRYSTAL, 1);
this.addFloorFeature(EndFeatures.CAVE_BUSH, 5); this.addFloorFeature(EndFeatures.CAVE_BUSH, 5);
@ -63,7 +63,7 @@ public class LushAuroraCaveBiome extends EndCaveBiome.Config {
} }
@Override @Override
public BiFunction<ResourceLocation, net.minecraft.world.level.biome.Biome, EndBiome> getSupplier() { public BiomeSupplier<EndBiome> getSupplier() {
return LushAuroraCaveBiome.Biome::new; return LushAuroraCaveBiome.Biome::new;
} }

View file

@ -3,18 +3,18 @@ package ru.betterend.world.biome.cave;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import ru.bclib.api.biomes.BCLBiomeBuilder; import ru.bclib.api.biomes.BCLBiomeBuilder;
import ru.bclib.api.biomes.BCLBiomeBuilder.BiomeSupplier;
import ru.bclib.interfaces.SurfaceMaterialProvider; import ru.bclib.interfaces.SurfaceMaterialProvider;
import ru.bclib.world.biomes.BCLBiomeSettings;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndParticles; import ru.betterend.registry.EndParticles;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
import java.util.function.BiFunction;
public class LushSmaragdantCaveBiome extends EndCaveBiome.Config { public class LushSmaragdantCaveBiome extends EndCaveBiome.Config {
public static class Biome extends EndCaveBiome { public static class Biome extends EndCaveBiome {
public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome) { public Biome(ResourceLocation biomeID, net.minecraft.world.level.biome.Biome biome, BCLBiomeSettings settings) {
super(biomeID, biome); super(biomeID, biome, settings);
this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL, 1); this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL, 1);
this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL_SHARD, 20); this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL_SHARD, 20);
@ -48,7 +48,7 @@ public class LushSmaragdantCaveBiome extends EndCaveBiome.Config {
} }
@Override @Override
public BiFunction<ResourceLocation, net.minecraft.world.level.biome.Biome, EndBiome> getSupplier() { public BiomeSupplier<EndBiome> getSupplier() {
return LushSmaragdantCaveBiome.Biome::new; return LushSmaragdantCaveBiome.Biome::new;
} }