Flesh tendons, new maple/autumn leaf textures

This commit is contained in:
Forstride 2020-07-09 16:04:29 -04:00
parent 6ea9a33bc1
commit 29e6569f3c
9 changed files with 79 additions and 53 deletions

View File

@ -1,5 +1,6 @@
package biomesoplenty.common.biome.nether;
import biomesoplenty.api.block.BOPBlocks;
import biomesoplenty.api.enums.BOPClimates;
import biomesoplenty.common.biome.NetherBiomeBOP;
import biomesoplenty.common.world.biome.BiomeFeatureHelper;
@ -23,7 +24,7 @@ public class VisceralHeapBiome extends NetherBiomeBOP
{
public VisceralHeapBiome()
{
super((new Builder()).surfaceBuilder(BOPBiomeFeatures.FLESH_SURFACE_BUILDER, SurfaceBuilder.CONFIG_HELL).precipitation(RainType.NONE).biomeCategory(Category.NETHER).depth(0.1F).scale(0.2F).temperature(2.0F).downfall(0.0F).specialEffects((new BiomeAmbience.Builder()).waterColor(4159204).waterFogColor(329011).fogColor(0x601F18).ambientLoopSound(SoundEvents.AMBIENT_NETHER_WASTES_LOOP).ambientMoodSound(new MoodSoundAmbience(SoundEvents.AMBIENT_SOUL_SAND_VALLEY_MOOD, 6000, 8, 2.0D)).ambientAdditionsSound(new SoundAdditionsAmbience(SoundEvents.AMBIENT_CRIMSON_FOREST_ADDITIONS, 0.0111D)).backgroundMusic(BackgroundMusicTracks.createGameMusic(SoundEvents.MUSIC_BIOME_CRIMSON_FOREST)).build()).parent((String)null).optimalParameters(ImmutableList.of(new Biome.Attributes(-1.0F, 0.0F, 0.0F, 0.0F, 0.0F))));
super((new Builder()).surfaceBuilder(BOPBiomeFeatures.FLESH_SURFACE_BUILDER, SurfaceBuilder.CONFIG_HELL).precipitation(RainType.NONE).biomeCategory(Category.NETHER).depth(0.1F).scale(0.2F).temperature(2.0F).downfall(0.0F).specialEffects((new BiomeAmbience.Builder()).waterColor(4159204).waterFogColor(329011).fogColor(0x601F18).ambientParticle(new ParticleEffectAmbience(ParticleTypes.FALLING_LAVA, 0.001785F)).ambientLoopSound(SoundEvents.AMBIENT_NETHER_WASTES_LOOP).ambientMoodSound(new MoodSoundAmbience(SoundEvents.AMBIENT_SOUL_SAND_VALLEY_MOOD, 6000, 8, 2.0D)).ambientAdditionsSound(new SoundAdditionsAmbience(SoundEvents.AMBIENT_CRIMSON_FOREST_ADDITIONS, 0.0111D)).backgroundMusic(BackgroundMusicTracks.createGameMusic(SoundEvents.MUSIC_BIOME_CRIMSON_FOREST)).build()).parent((String)null).optimalParameters(ImmutableList.of(new Biome.Attributes(-1.0F, 0.0F, 0.0F, 0.0F, 0.0F))));
//Terrain
this.addStructureStart(DefaultBiomeFeatures.RUINED_PORTAL_NETHER);
@ -33,13 +34,9 @@ public class VisceralHeapBiome extends NetherBiomeBOP
this.addFeature(GenerationStage.Decoration.VEGETAL_DECORATION, Feature.SPRING.configured(DefaultBiomeFeatures.LAVA_SPRING_CONFIG).decorated(Placement.COUNT_VERY_BIASED_RANGE.configured(new CountRangeConfig(20, 8, 16, 256))));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, Feature.SPRING.configured(DefaultBiomeFeatures.OPEN_NETHER_SPRING_CONFIG).decorated(Placement.COUNT_RANGE.configured(new CountRangeConfig(4, 4, 8, 128))));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, Feature.RANDOM_PATCH.configured(DefaultBiomeFeatures.FIRE_CONFIG).decorated(Placement.FIRE.configured(new FrequencyConfig(7))));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, Feature.GLOWSTONE_BLOB.configured(IFeatureConfig.NONE).decorated(Placement.LIGHT_GEM_CHANCE.configured(new FrequencyConfig(7))));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, Feature.GLOWSTONE_BLOB.configured(IFeatureConfig.NONE).decorated(Placement.COUNT_RANGE.configured(new CountRangeConfig(7, 0, 0, 128))));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, BOPBiomeFeatures.FLESH_TENDON.configured(IFeatureConfig.NONE).decorated(Placement.COUNT_HEIGHTMAP_DOUBLE.configured(new FrequencyConfig(20))));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, BOPBiomeFeatures.BONE_SPINE.configured(IFeatureConfig.NONE).decorated(Placement.COUNT_HEIGHTMAP_DOUBLE.configured(new FrequencyConfig(10))));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, BOPBiomeFeatures.SHROOMLIGHT_SCATTER.configured(IFeatureConfig.NONE).decorated(Placement.COUNT_HEIGHTMAP_DOUBLE.configured(new FrequencyConfig(5))));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, BOPBiomeFeatures.FLESH_TENDON.configured(IFeatureConfig.NONE).decorated(Placement.COUNT_HEIGHTMAP_DOUBLE.configured(new FrequencyConfig(65))));
this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, BOPBiomeFeatures.BONE_SPINE.configured(IFeatureConfig.NONE).decorated(Placement.COUNT_HEIGHTMAP_DOUBLE.configured(new FrequencyConfig(6))));
//Base Decorations
this.addFeature(GenerationStage.Decoration.UNDERGROUND_DECORATION, Feature.ORE.configured(new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NETHERRACK, Blocks.NETHER_QUARTZ_ORE.defaultBlockState(), 14)).decorated(Placement.COUNT_RANGE.configured(new CountRangeConfig(16, 10, 20, 128))));

View File

@ -12,6 +12,7 @@ import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import net.minecraft.block.*;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.pathfinding.PathType;
import net.minecraft.state.DirectionProperty;
import net.minecraft.state.StateContainer;
import net.minecraft.state.properties.AttachFace;
@ -83,6 +84,16 @@ public class NetherCrystalBlock extends HorizontalFaceBlock
}
}
@Override
public boolean propagatesSkylightDown(BlockState state, IBlockReader reader, BlockPos pos) {
return state.getFluidState().isEmpty();
}
@Override
public boolean isPathfindable(BlockState state, IBlockReader worldIn, BlockPos pos, PathType type) {
return type == PathType.AIR && !this.hasCollision ? true : super.isPathfindable(state, worldIn, pos, type);
}
@Override
protected void createBlockStateDefinition(StateContainer.Builder<Block, BlockState> builderIn) {
builderIn.add(FACING, FACE);

View File

@ -135,7 +135,6 @@ public class BOPBiomeFeatures
public static final Feature<NoFeatureConfig> SMALL_TOADSTOOL = new SmallToadstoolFeature(NoFeatureConfig.CODEC);
public static final Feature<NoFeatureConfig> HUGE_GLOWSHROOM = new HugeGlowshroomFeature(NoFeatureConfig.CODEC);
public static final Feature<NoFeatureConfig> HUGE_TOADSTOOL = new HugeToadstoolFeature(NoFeatureConfig.CODEC);
public static final Feature<NoFeatureConfig> SHROOMLIGHT_SCATTER = new ShroomlightFeature(NoFeatureConfig.CODEC);
public static final Feature<NoFeatureConfig> SMALL_CRYSTAL = new SmallCrystalFeature(NoFeatureConfig.CODEC);
public static final Feature<NoFeatureConfig> LARGE_CRYSTAL = new LargeCrystalFeature(NoFeatureConfig.CODEC);
public static final Feature<NoFeatureConfig> FLESH_TENDON = new FleshTendonFeature(NoFeatureConfig.CODEC);

View File

@ -23,8 +23,10 @@ import java.util.Random;
public class FleshTendonFeature extends Feature<NoFeatureConfig>
{
protected IBlockPosQuery replace = (world, pos) -> world.getBlockState(pos).canBeReplacedByLeaves(world, pos) || world.getBlockState(pos).getBlock() == BOPBlocks.nether_crystal;
private static final int MIN_DISTANCE = 8;
private static final int MAX_DISTANCE = 16;
private static final int MAX_DISTANCE = 32;
private static final float MID_POS_MULTIPLIER = 0.9F;
private static final float TENDON_STEP = 0.005f;
@ -55,7 +57,7 @@ public class FleshTendonFeature extends Feature<NoFeatureConfig>
int minZ = rand.nextBoolean() ? MIN_DISTANCE : -MIN_DISTANCE;
BlockPos endPos = pos.offset(Math.abs(xOff) < MIN_DISTANCE ? minX : xOff, pos.getY(), Math.abs(zOff) < MIN_DISTANCE ? minZ : zOff);
while (world.isEmptyBlock(endPos) && endPos.getY() < 120)
while (world.isEmptyBlock(endPos) && endPos.getY() < 126)
{
endPos = endPos.above();
}
@ -71,9 +73,68 @@ public class FleshTendonFeature extends Feature<NoFeatureConfig>
for (float d = 0.0f; d < 1.0f; d += TENDON_STEP)
{
BlockPos curPos = quadratic(d, pos, midPos, endPos);
this.setBlock(world, curPos, BOPBlocks.flesh.defaultBlockState());
if (curPos.getY() < 126)
{
this.setBlock(world, curPos, BOPBlocks.flesh.defaultBlockState());
if (rand.nextInt(75) == 0)
{
this.generateFleshBall(world, curPos, rand);
}
}
else
{
break;
}
}
return true;
}
public boolean generateFleshBall(ISeedReader world, BlockPos pos, Random rand)
{
this.setBlock(world, pos, BOPBlocks.flesh.defaultBlockState());
this.setBlock(world, pos.north(), Blocks.SHROOMLIGHT.defaultBlockState(), 2);
this.setBlock(world, pos.south(), Blocks.SHROOMLIGHT.defaultBlockState(), 2);
this.setBlock(world, pos.east(), Blocks.SHROOMLIGHT.defaultBlockState(), 2);
this.setBlock(world, pos.west(), Blocks.SHROOMLIGHT.defaultBlockState(), 2);
this.setBlock(world, pos.north().west(), BOPBlocks.flesh.defaultBlockState());
this.setBlock(world, pos.south().west(), BOPBlocks.flesh.defaultBlockState());
this.setBlock(world, pos.north().east(), BOPBlocks.flesh.defaultBlockState());
this.setBlock(world, pos.south().east(), BOPBlocks.flesh.defaultBlockState());
this.setBlock(world, pos.above(), BOPBlocks.flesh.defaultBlockState());
this.setBlock(world, pos.above().north(), BOPBlocks.flesh.defaultBlockState());
this.setBlock(world, pos.above().south(), BOPBlocks.flesh.defaultBlockState());
this.setBlock(world, pos.above().east(), BOPBlocks.flesh.defaultBlockState());
this.setBlock(world, pos.above().west(), BOPBlocks.flesh.defaultBlockState());
this.setBlock(world, pos.below(), BOPBlocks.flesh.defaultBlockState());
this.setBlock(world, pos.below().north(), BOPBlocks.flesh.defaultBlockState());
this.setBlock(world, pos.below().south(), BOPBlocks.flesh.defaultBlockState());
this.setBlock(world, pos.below().east(), BOPBlocks.flesh.defaultBlockState());
this.setBlock(world, pos.below().west(), BOPBlocks.flesh.defaultBlockState());
return true;
}
public boolean setBlock(IWorld world, BlockPos pos, BlockState state)
{
if (this.replace.matches(world, pos))
{
super.setBlock(world, pos, state);
return true;
}
return false;
}
public boolean setBlock(IWorld world, BlockPos pos, BlockState state, int flags)
{
if (this.replace.matches(world, pos))
{
world.setBlock(pos, state, flags);
return true;
}
return false;
}
}

View File

@ -1,41 +0,0 @@
package biomesoplenty.common.world.gen.feature;
import biomesoplenty.api.block.BOPBlocks;
import com.mojang.serialization.Codec;
import net.minecraft.block.Blocks;
import net.minecraft.block.LeavesBlock;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ISeedReader;
import net.minecraft.world.gen.ChunkGenerator;
import net.minecraft.world.gen.feature.Feature;
import net.minecraft.world.gen.feature.NoFeatureConfig;
import net.minecraft.world.gen.feature.structure.StructureManager;
import java.util.Random;
public class ShroomlightFeature extends Feature<NoFeatureConfig>
{
public ShroomlightFeature(Codec<NoFeatureConfig> deserializer)
{
super(deserializer);
}
@Override
public boolean place(ISeedReader world, StructureManager structureManager, ChunkGenerator chunkGenerator, Random rand, BlockPos pos, NoFeatureConfig config)
{
int i = 0;
for(int j = 0; j < 32; ++j)
{
BlockPos blockpos = pos.offset(rand.nextInt(8) - rand.nextInt(8), rand.nextInt(4) - rand.nextInt(4), rand.nextInt(8) - rand.nextInt(8));
if (world.getBlockState(blockpos).canBeReplacedByLeaves(world, blockpos) && world.getBlockState(blockpos.below()).getBlock() == BOPBlocks.flesh)
{
world.setBlock(blockpos, Blocks.SHROOMLIGHT.defaultBlockState(), 2);
++i;
}
}
return i > 0;
}
}

View File

@ -135,7 +135,6 @@ public class ModFeatures
registerFeatures(BOPBiomeFeatures.SMALL_TOADSTOOL, "small_toadstool");
registerFeatures(BOPBiomeFeatures.HUGE_GLOWSHROOM, "huge_glowshroom");
registerFeatures(BOPBiomeFeatures.HUGE_TOADSTOOL, "huge_toadstool");
registerFeatures(BOPBiomeFeatures.SHROOMLIGHT_SCATTER, "shroomlight_scatter");
registerFeatures(BOPBiomeFeatures.SMALL_CRYSTAL, "small_crystal");
registerFeatures(BOPBiomeFeatures.LARGE_CRYSTAL, "large_crystal");
registerFeatures(BOPBiomeFeatures.FLESH_TENDON, "flesh_tendon");

Binary file not shown.

Before

Width:  |  Height:  |  Size: 361 B

After

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 465 B

After

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 358 B

After

Width:  |  Height:  |  Size: 435 B