Additional cave biomes
This commit is contained in:
parent
3daf3421ee
commit
2ac1ec8f5a
6 changed files with 133 additions and 0 deletions
|
@ -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