Additional cave biomes
This commit is contained in:
parent
3daf3421ee
commit
2ac1ec8f5a
6 changed files with 133 additions and 0 deletions
|
@ -32,9 +32,12 @@ import ru.betterend.config.Configs;
|
||||||
import ru.betterend.integration.Integrations;
|
import ru.betterend.integration.Integrations;
|
||||||
import ru.betterend.util.JsonFactory;
|
import ru.betterend.util.JsonFactory;
|
||||||
import ru.betterend.world.biome.air.BiomeIceStarfield;
|
import ru.betterend.world.biome.air.BiomeIceStarfield;
|
||||||
|
import ru.betterend.world.biome.cave.EmptyAuroraCaveBiome;
|
||||||
import ru.betterend.world.biome.cave.EmptyEndCaveBiome;
|
import ru.betterend.world.biome.cave.EmptyEndCaveBiome;
|
||||||
import ru.betterend.world.biome.cave.EmptySmaragdantCaveBiome;
|
import ru.betterend.world.biome.cave.EmptySmaragdantCaveBiome;
|
||||||
import ru.betterend.world.biome.cave.EndCaveBiome;
|
import ru.betterend.world.biome.cave.EndCaveBiome;
|
||||||
|
import ru.betterend.world.biome.cave.LushAuroraCaveBiome;
|
||||||
|
import ru.betterend.world.biome.cave.LushSmaragdantCaveBiome;
|
||||||
import ru.betterend.world.biome.land.BiomeAmberLand;
|
import ru.betterend.world.biome.land.BiomeAmberLand;
|
||||||
import ru.betterend.world.biome.land.BiomeBlossomingSpires;
|
import ru.betterend.world.biome.land.BiomeBlossomingSpires;
|
||||||
import ru.betterend.world.biome.land.BiomeChorusForest;
|
import ru.betterend.world.biome.land.BiomeChorusForest;
|
||||||
|
@ -101,6 +104,9 @@ public class EndBiomes {
|
||||||
// Better End Caves
|
// Better End Caves
|
||||||
public static final EndCaveBiome EMPTY_END_CAVE = registerCaveBiome(new EmptyEndCaveBiome());
|
public static final EndCaveBiome EMPTY_END_CAVE = registerCaveBiome(new EmptyEndCaveBiome());
|
||||||
public static final EndCaveBiome EMPTY_SMARAGDANT_CAVE = registerCaveBiome(new EmptySmaragdantCaveBiome());
|
public static final EndCaveBiome EMPTY_SMARAGDANT_CAVE = registerCaveBiome(new EmptySmaragdantCaveBiome());
|
||||||
|
public static final EndCaveBiome LUSH_SMARAGDANT_CAVE = registerCaveBiome(new LushSmaragdantCaveBiome());
|
||||||
|
public static final EndCaveBiome EMPTY_AURORA_CAVE = registerCaveBiome(new EmptyAuroraCaveBiome());
|
||||||
|
public static final EndCaveBiome LUSH_AURORA_CAVE = registerCaveBiome(new LushAuroraCaveBiome());
|
||||||
|
|
||||||
public static void register() {}
|
public static void register() {}
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,7 @@ import ru.betterend.world.features.bushes.BushFeature;
|
||||||
import ru.betterend.world.features.bushes.LargeAmaranitaFeature;
|
import ru.betterend.world.features.bushes.LargeAmaranitaFeature;
|
||||||
import ru.betterend.world.features.bushes.Lumecorn;
|
import ru.betterend.world.features.bushes.Lumecorn;
|
||||||
import ru.betterend.world.features.bushes.TenaneaBushFeature;
|
import ru.betterend.world.features.bushes.TenaneaBushFeature;
|
||||||
|
import ru.betterend.world.features.terrain.BigAuroraCrystalFeature;
|
||||||
import ru.betterend.world.features.terrain.EndLakeFeature;
|
import ru.betterend.world.features.terrain.EndLakeFeature;
|
||||||
import ru.betterend.world.features.terrain.FallenPillarFeature;
|
import ru.betterend.world.features.terrain.FallenPillarFeature;
|
||||||
import ru.betterend.world.features.terrain.FloatingSpireFeature;
|
import ru.betterend.world.features.terrain.FloatingSpireFeature;
|
||||||
|
@ -191,6 +192,7 @@ public class EndFeatures {
|
||||||
// Caves
|
// Caves
|
||||||
public static final DefaultFeature SMARAGDANT_CRYSTAL = new SmaragdantCrystalFeature();
|
public static final DefaultFeature SMARAGDANT_CRYSTAL = new SmaragdantCrystalFeature();
|
||||||
public static final DefaultFeature SMARAGDANT_CRYSTAL_SHARD = new SmaragdantCrystalShardFeature();
|
public static final DefaultFeature SMARAGDANT_CRYSTAL_SHARD = new SmaragdantCrystalShardFeature();
|
||||||
|
public static final DefaultFeature BIG_AURORA_CRYSTAL = new BigAuroraCrystalFeature();
|
||||||
|
|
||||||
public static void registerBiomeFeatures(Identifier id, Biome biome, List<List<Supplier<ConfiguredFeature<?, ?>>>> features) {
|
public static void registerBiomeFeatures(Identifier id, Biome biome, List<List<Supplier<ConfiguredFeature<?, ?>>>> features) {
|
||||||
if (id.getNamespace().equals(BetterEnd.MOD_ID)) {
|
if (id.getNamespace().equals(BetterEnd.MOD_ID)) {
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
package ru.betterend.world.biome.cave;
|
||||||
|
|
||||||
|
import ru.betterend.registry.EndFeatures;
|
||||||
|
import ru.betterend.registry.EndParticles;
|
||||||
|
import ru.betterend.registry.EndSounds;
|
||||||
|
import ru.betterend.world.biome.land.BiomeDefinition;
|
||||||
|
|
||||||
|
public class EmptyAuroraCaveBiome extends EndCaveBiome {
|
||||||
|
public EmptyAuroraCaveBiome() {
|
||||||
|
super(new BiomeDefinition("empty_aurora_cave")
|
||||||
|
.setFogColor(150, 30, 68)
|
||||||
|
.setFogDensity(2.0F)
|
||||||
|
.setPlantsColor(108, 25, 46)
|
||||||
|
.setWaterAndFogColor(186, 77, 237)
|
||||||
|
.setMusic(EndSounds.MUSIC_FOREST)
|
||||||
|
.setParticles(EndParticles.GLOWING_SPHERE, 0.001F));
|
||||||
|
this.addFloorFeature(EndFeatures.BIG_AURORA_CRYSTAL, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getFloorDensity() {
|
||||||
|
return 0.01F;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
package ru.betterend.world.biome.cave;
|
||||||
|
|
||||||
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
import ru.betterend.registry.EndFeatures;
|
||||||
|
import ru.betterend.registry.EndParticles;
|
||||||
|
import ru.betterend.registry.EndSounds;
|
||||||
|
import ru.betterend.world.biome.land.BiomeDefinition;
|
||||||
|
|
||||||
|
public class LushAuroraCaveBiome extends EndCaveBiome {
|
||||||
|
public LushAuroraCaveBiome() {
|
||||||
|
super(new BiomeDefinition("lush_aurora_cave")
|
||||||
|
.setFogColor(150, 30, 68)
|
||||||
|
.setFogDensity(2.0F)
|
||||||
|
.setPlantsColor(108, 25, 46)
|
||||||
|
.setWaterAndFogColor(186, 77, 237)
|
||||||
|
.setMusic(EndSounds.MUSIC_FOREST)
|
||||||
|
.setParticles(EndParticles.GLOWING_SPHERE, 0.001F)
|
||||||
|
.setSurface(EndBlocks.CAVE_MOSS));
|
||||||
|
this.addFloorFeature(EndFeatures.BIG_AURORA_CRYSTAL, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getFloorDensity() {
|
||||||
|
return 0.01F;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,27 @@
|
||||||
|
package ru.betterend.world.biome.cave;
|
||||||
|
|
||||||
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
import ru.betterend.registry.EndFeatures;
|
||||||
|
import ru.betterend.registry.EndParticles;
|
||||||
|
import ru.betterend.registry.EndSounds;
|
||||||
|
import ru.betterend.world.biome.land.BiomeDefinition;
|
||||||
|
|
||||||
|
public class LushSmaragdantCaveBiome extends EndCaveBiome {
|
||||||
|
public LushSmaragdantCaveBiome() {
|
||||||
|
super(new BiomeDefinition("lush_smaragdant_cave")
|
||||||
|
.setFogColor(0, 253, 182)
|
||||||
|
.setFogDensity(2.0F)
|
||||||
|
.setPlantsColor(0, 131, 145)
|
||||||
|
.setWaterAndFogColor(31, 167, 212)
|
||||||
|
.setMusic(EndSounds.MUSIC_FOREST)
|
||||||
|
.setParticles(EndParticles.FIREFLY, 0.001F)
|
||||||
|
.setSurface(EndBlocks.CAVE_MOSS));
|
||||||
|
this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL, 1);
|
||||||
|
this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL_SHARD, 20);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getFloorDensity() {
|
||||||
|
return 0.1F;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package ru.betterend.world.features.terrain;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import net.minecraft.block.Material;
|
||||||
|
import net.minecraft.client.util.math.Vector3f;
|
||||||
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.world.StructureWorldAccess;
|
||||||
|
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||||
|
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||||
|
import ru.betterend.registry.EndBlocks;
|
||||||
|
import ru.betterend.registry.EndTags;
|
||||||
|
import ru.betterend.util.BlocksHelper;
|
||||||
|
import ru.betterend.util.MHelper;
|
||||||
|
import ru.betterend.util.sdf.SDF;
|
||||||
|
import ru.betterend.util.sdf.operator.SDFRotation;
|
||||||
|
import ru.betterend.util.sdf.primitive.SDFHexPrism;
|
||||||
|
import ru.betterend.world.features.DefaultFeature;
|
||||||
|
|
||||||
|
public class BigAuroraCrystalFeature extends DefaultFeature {
|
||||||
|
@Override
|
||||||
|
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, DefaultFeatureConfig config) {
|
||||||
|
int maxY = pos.getY() + BlocksHelper.upRay(world, pos, 16);
|
||||||
|
int minY = pos.getY() - BlocksHelper.downRay(world, pos, 16);
|
||||||
|
|
||||||
|
if (maxY - minY < 10) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int y = MHelper.randRange(minY, maxY, random);
|
||||||
|
pos = new BlockPos(pos.getX(), y, pos.getZ());
|
||||||
|
|
||||||
|
int height = MHelper.randRange(5, 25, random);
|
||||||
|
SDF prism = new SDFHexPrism().setHeight(height).setRadius(MHelper.randRange(1.7F, 3F, random)).setBlock(EndBlocks.AURORA_CRYSTAL);
|
||||||
|
Vector3f vec = MHelper.randomHorizontal(random);
|
||||||
|
prism = new SDFRotation().setRotation(vec, random.nextFloat()).setSource(prism);
|
||||||
|
prism.setReplaceFunction((bState) -> {
|
||||||
|
return bState.getMaterial().isReplaceable()
|
||||||
|
|| bState.isIn(EndTags.GEN_TERRAIN)
|
||||||
|
|| bState.getMaterial().equals(Material.PLANT)
|
||||||
|
|| bState.getMaterial().equals(Material.LEAVES);
|
||||||
|
});
|
||||||
|
prism.fillRecursive(world, pos);
|
||||||
|
BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.AURORA_CRYSTAL);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue