Crystal grass & small changes

This commit is contained in:
paulevsGitch 2020-10-26 06:03:54 +03:00
parent 4073e0a32c
commit 7de70c9553
22 changed files with 376 additions and 14 deletions

View file

@ -1,6 +1,5 @@
package ru.betterend.world.biome;
import net.minecraft.block.Blocks;
import net.minecraft.entity.EntityType;
import ru.betterend.registry.BlockRegistry;
import ru.betterend.registry.FeatureRegistry;
@ -11,10 +10,11 @@ public class BiomeCrystalMountains extends EndBiome {
public BiomeCrystalMountains() {
super(new BiomeDefinition("crystal_mountains")
.setPlantsColor(255, 133, 211)
.setSurface(BlockRegistry.CRYSTAL_MOSS, Blocks.END_STONE)
.setSurface(BlockRegistry.CRYSTAL_MOSS)
.setMusic(SoundRegistry.MUSIC_CRYSTAL_MOUNTAINS)
.addStructureFeature(StructureRegistry.MOUNTAIN)
.addFeature(FeatureRegistry.ROUND_CAVE)
.addFeature(FeatureRegistry.CRYSTAL_GRASS)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
}
}

View file

@ -39,7 +39,7 @@ public abstract class ScatterFeature extends DefaultFeature {
protected boolean getGroundPlant(StructureWorldAccess world, Mutable pos) {
int down = BlocksHelper.downRay(world, pos, 16);
if (down > 10) {
if (down > Math.abs(getYOffset() * 2)) {
return false;
}
pos.setY(pos.getY() - down);

View file

@ -11,10 +11,21 @@ import ru.betterend.util.BlocksHelper;
public class SinglePlantFeature extends ScatterFeature {
private final Block plant;
private final boolean rawHeightmap;
public SinglePlantFeature(Block plant, int radius) {
this(plant, radius, true);
}
public SinglePlantFeature(Block plant, int radius, boolean rawHeightmap) {
super(radius);
this.plant = plant;
this.rawHeightmap = rawHeightmap;
}
@Override
protected BlockPos getCenterGround(StructureWorldAccess world, BlockPos pos) {
return rawHeightmap ? getPosOnSurfaceWG(world, pos) : getPosOnSurface(world, pos);
}
@Override

View file

@ -104,8 +104,8 @@ public class MountainPiece extends BasePiece {
maxY *= (float) noise.eval(px * 0.1, pz * 0.1) * 0.1F + 0.8F;
maxY += 56;
int cover = (int) (maxY - 1);
boolean needCover = noise.eval(px * 0.3, pz * 0.3) > 0 && (noise.eval(px * 0.03, pz * 0.03) - (maxY - 60) * 0.2) > 0;
for (int y = minY; y < maxY; y++) {
boolean needCover = (noise.eval(px * 0.1, pz * 0.1) + MHelper.randRange(-0.4, 0.4, random) - (maxY - 70) * 0.1) > 0;
for (int y = minY - 1; y < maxY; y++) {
pos.setY(y);
chunk.setBlockState(pos, needCover && y >= cover ? top : Blocks.END_STONE.getDefaultState(), false);
}