Chorus nylium & chorus forest, lake fixes
This commit is contained in:
parent
7af7b26bd6
commit
b0d967ecd4
17 changed files with 105 additions and 18 deletions
|
@ -0,0 +1,24 @@
|
|||
package ru.betterend.world.biome;
|
||||
|
||||
import net.minecraft.entity.EntityType;
|
||||
import ru.betterend.registry.BlockRegistry;
|
||||
import ru.betterend.registry.EntityRegistry;
|
||||
import ru.betterend.registry.FeatureRegistry;
|
||||
import ru.betterend.registry.StructureRegistry;
|
||||
|
||||
public class BiomeChorusForest extends EndBiome {
|
||||
public BiomeChorusForest() {
|
||||
super(new BiomeDefinition("chorus_forest")
|
||||
.setFogColor(87, 26, 87)
|
||||
.setFogDensity(3)
|
||||
.setSurface(BlockRegistry.CHORUS_NYLIUM)
|
||||
//.setParticles(ParticleRegistry.GLOWING_SPHERE, 0.001F)
|
||||
//.setLoop(SoundRegistry.AMBIENT_FOGGY_MUSHROOMLAND)
|
||||
//.setMusic(SoundRegistry.MUSIC_FOGGY_MUSHROOMLAND)
|
||||
.addStructureFeature(StructureRegistry.GIANT_MOSSY_GLOWSHROOM)
|
||||
.addFeature(FeatureRegistry.ENDER_ORE)
|
||||
.addFeature(FeatureRegistry.RARE_END_LAKE)
|
||||
.addMobSpawn(EntityRegistry.END_SLIME, 5, 1, 2)
|
||||
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 4));
|
||||
}
|
||||
}
|
|
@ -8,15 +8,18 @@ import net.minecraft.fluid.FluidState;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockPos.Mutable;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||
import ru.betterend.blocks.BlockEndLily;
|
||||
import ru.betterend.blocks.BlockProperties.TripleShape;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.BiomeRegistry;
|
||||
import ru.betterend.registry.BlockRegistry;
|
||||
import ru.betterend.registry.BlockTagRegistry;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.util.MHelper;
|
||||
import ru.betterend.world.biome.EndBiome;
|
||||
|
||||
public class EndLakeFeature extends DefaultFeature {
|
||||
private static final BlockState END_STONE = Blocks.END_STONE.getDefaultState();
|
||||
|
@ -165,19 +168,9 @@ public class EndLakeFeature extends DefaultFeature {
|
|||
if (world.getBlockState(pos).getBlock().isIn(BlockTagRegistry.GEN_TERRAIN))
|
||||
{
|
||||
BlocksHelper.setWithoutUpdate(world, POS.down(), BlockRegistry.ENDSTONE_DUST.getDefaultState());
|
||||
if (y < waterLevel - 1 && random.nextInt(3) == 0 && ((x + z) & 1) == 0) {
|
||||
if (NOISE.eval(x * 0.1, z * 0.1, 0) > 0) {
|
||||
BlocksHelper.setWithoutUpdate(world, POS, BlockRegistry.BUBBLE_CORAL.getDefaultState());
|
||||
}
|
||||
else if (NOISE.eval(x * 0.1, z * 0.1, 1) > 0) {
|
||||
world.setBlockState(POS, BlockRegistry.END_LILY.getDefaultState().with(BlockEndLily.SHAPE, TripleShape.BOTTOM), 0);
|
||||
BlockPos up = POS.up();
|
||||
while (up.getY() < waterLevel) {
|
||||
BlocksHelper.setWithoutUpdate(world, up, BlockRegistry.END_LILY.getDefaultState().with(BlockEndLily.SHAPE, TripleShape.MIDDLE));
|
||||
up = up.up();
|
||||
}
|
||||
BlocksHelper.setWithoutUpdate(world, up, BlockRegistry.END_LILY.getDefaultState().with(BlockEndLily.SHAPE, TripleShape.TOP));
|
||||
}
|
||||
EndBiome biome = BiomeRegistry.getFromBiome(world.getBiome(POS));
|
||||
if (biome == BiomeRegistry.CHORUS_FOREST) {
|
||||
generateFoggyMushroomland(world, x, z, waterLevel);
|
||||
}
|
||||
}
|
||||
pos = POS.up();
|
||||
|
@ -214,4 +207,19 @@ public class EndLakeFeature extends DefaultFeature {
|
|||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void generateFoggyMushroomland(WorldAccess world, int x, int z, int waterLevel) {
|
||||
if (NOISE.eval(x * 0.1, z * 0.1, 0) > 0) {
|
||||
BlocksHelper.setWithoutUpdate(world, POS, BlockRegistry.BUBBLE_CORAL.getDefaultState());
|
||||
}
|
||||
else if (NOISE.eval(x * 0.1, z * 0.1, 1) > 0) {
|
||||
world.setBlockState(POS, BlockRegistry.END_LILY.getDefaultState().with(BlockEndLily.SHAPE, TripleShape.BOTTOM), 0);
|
||||
BlockPos up = POS.up();
|
||||
while (up.getY() < waterLevel) {
|
||||
BlocksHelper.setWithoutUpdate(world, up, BlockRegistry.END_LILY.getDefaultState().with(BlockEndLily.SHAPE, TripleShape.MIDDLE));
|
||||
up = up.up();
|
||||
}
|
||||
BlocksHelper.setWithoutUpdate(world, up, BlockRegistry.END_LILY.getDefaultState().with(BlockEndLily.SHAPE, TripleShape.TOP));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue