New textures and models
This commit is contained in:
parent
e1f5779b0f
commit
d4f56b152e
43 changed files with 153 additions and 17 deletions
|
@ -5,6 +5,7 @@ import ru.betterend.world.features.DoublePlantFeature;
|
|||
import ru.betterend.world.features.EndFeature;
|
||||
import ru.betterend.world.features.EndLakeFeature;
|
||||
import ru.betterend.world.features.MossyGlowshroomFeature;
|
||||
import ru.betterend.world.features.PythadendronBushFeature;
|
||||
import ru.betterend.world.features.PythadendronTreeFeature;
|
||||
import ru.betterend.world.features.SinglePlantFeature;
|
||||
import ru.betterend.world.features.VineFeature;
|
||||
|
@ -12,13 +13,16 @@ import ru.betterend.world.features.VineFeature;
|
|||
public class FeatureRegistry {
|
||||
// Trees //
|
||||
public static final EndFeature MOSSY_GLOWSHROOM = new EndFeature("mossy_glowshroom", new MossyGlowshroomFeature(), 3);
|
||||
public static final EndFeature PYTHADENDRON_TREE = new EndFeature("pythadendron_tree", new PythadendronTreeFeature(), 1);
|
||||
public static final EndFeature PYTHADENDRON_TREE = new EndFeature("pythadendron_tree", new PythadendronTreeFeature(), 2);
|
||||
|
||||
// Bushes //
|
||||
public static final EndFeature PYTHADENDRON_BUSH = new EndFeature("pythadendron_bush", new PythadendronBushFeature(), 4);
|
||||
|
||||
// Plants //
|
||||
public static final EndFeature UMBRELLA_MOSS = new EndFeature("umbrella_moss", new DoublePlantFeature(BlockRegistry.UMBRELLA_MOSS, BlockRegistry.UMBRELLA_MOSS_TALL, 5), 5);
|
||||
public static final EndFeature CREEPING_MOSS = new EndFeature("creeping_moss", new SinglePlantFeature(BlockRegistry.CREEPING_MOSS, 5), 5);
|
||||
public static final EndFeature BLUE_VINE = new EndFeature("blue_vine", new BlueVineFeature(), 1);
|
||||
public static final EndFeature CHORUS_GRASS = new EndFeature("chorus_grass", new SinglePlantFeature(BlockRegistry.CHORUS_GRASS, 4), 4);
|
||||
public static final EndFeature CHORUS_GRASS = new EndFeature("chorus_grass", new SinglePlantFeature(BlockRegistry.CHORUS_GRASS, 4), 5);
|
||||
|
||||
public static final EndFeature DENSE_VINE = new EndFeature("dense_vine", new VineFeature(BlockRegistry.DENSE_VINE, 24), 3);
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package ru.betterend.world.biome;
|
||||
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.world.gen.GenerationStep.Feature;
|
||||
import net.minecraft.world.gen.feature.ConfiguredFeatures;
|
||||
import ru.betterend.registry.BlockRegistry;
|
||||
import ru.betterend.registry.EntityRegistry;
|
||||
import ru.betterend.registry.FeatureRegistry;
|
||||
|
@ -17,6 +19,8 @@ public class BiomeChorusForest extends EndBiome {
|
|||
.addFeature(FeatureRegistry.ENDER_ORE)
|
||||
.addFeature(FeatureRegistry.RARE_END_LAKE)
|
||||
.addFeature(FeatureRegistry.PYTHADENDRON_TREE)
|
||||
.addFeature(FeatureRegistry.PYTHADENDRON_BUSH)
|
||||
.addFeature(Feature.VEGETAL_DECORATION, ConfiguredFeatures.CHORUS_PLANT)
|
||||
.addFeature(FeatureRegistry.CHORUS_GRASS)
|
||||
.addMobSpawn(EntityRegistry.END_SLIME, 5, 1, 2)
|
||||
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 4));
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
package ru.betterend.world.features;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.function.Function;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.LeavesBlock;
|
||||
import net.minecraft.block.Material;
|
||||
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.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.BlockRegistry;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
import ru.betterend.util.MHelper;
|
||||
import ru.betterend.util.sdf.SDF;
|
||||
import ru.betterend.util.sdf.operator.SDFDisplacement;
|
||||
import ru.betterend.util.sdf.operator.SDFScale3D;
|
||||
import ru.betterend.util.sdf.operator.SDFSubtraction;
|
||||
import ru.betterend.util.sdf.operator.SDFTranslate;
|
||||
import ru.betterend.util.sdf.primitive.SDFSphere;
|
||||
|
||||
public class PythadendronBushFeature extends DefaultFeature {
|
||||
private static final Function<BlockState, Boolean> REPLACE;
|
||||
|
||||
@Override
|
||||
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, DefaultFeatureConfig config) {
|
||||
if (world.getBlockState(pos.down()).getBlock() != BlockRegistry.CHORUS_NYLIUM) return false;
|
||||
|
||||
float radius = MHelper.randRange(1.8F, 4.5F, random);
|
||||
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextInt());
|
||||
SDF sphere = new SDFSphere().setRadius(radius).setBlock(BlockRegistry.PYTHADENDRON_LEAVES.getDefaultState().with(LeavesBlock.DISTANCE, 1));
|
||||
sphere = new SDFScale3D().setScale(1, 0.5F, 1).setSource(sphere);
|
||||
sphere = new SDFDisplacement().setFunction((vec) -> { return (float) noise.eval(vec.getX() * 0.2, vec.getY() * 0.2, vec.getZ() * 0.2) * 3; }).setSource(sphere);
|
||||
sphere = new SDFDisplacement().setFunction((vec) -> { return random.nextFloat() * 3F - 1.5F; }).setSource(sphere);
|
||||
sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere));
|
||||
sphere.setReplaceFunction(REPLACE);
|
||||
sphere.fillRecursive(world, pos);
|
||||
BlocksHelper.setWithoutUpdate(world, pos, BlockRegistry.PYTHADENDRON.bark);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static {
|
||||
REPLACE = (state) -> {
|
||||
if (state.getMaterial().equals(Material.PLANT)) {
|
||||
return true;
|
||||
}
|
||||
return state.getMaterial().isReplaceable();
|
||||
};
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue