Update to BCLib 0.3.0

This commit is contained in:
paulevsGitch 2021-07-20 00:39:58 +03:00
parent 1a52251af0
commit b2431153dc
294 changed files with 7484 additions and 1440 deletions

View file

@ -10,6 +10,16 @@ import ru.betterend.world.biome.EndBiome;
public class BiomeIceStarfield extends EndBiome {
public BiomeIceStarfield() {
super(new BCLBiomeDef(BetterEnd.makeID("ice_starfield")).addCustomData("has_caves", false).addStructureFeature(EndStructures.GIANT_ICE_STAR.getFeatureConfigured()).setFogColor(224, 245, 254).setTemperature(0F).setFogDensity(2.2F).setFoliageColor(193, 244, 244).setGenChance(0.25F).setParticles(EndParticles.SNOWFLAKE, 0.002F).addFeature(EndFeatures.ICE_STAR).addFeature(EndFeatures.ICE_STAR_SMALL).addMobSpawn(EntityType.ENDERMAN, 20, 1, 4));
super(new BCLBiomeDef(BetterEnd.makeID("ice_starfield")).addCustomData("has_caves", false)
.addStructureFeature(EndStructures.GIANT_ICE_STAR.getFeatureConfigured())
.setFogColor(224, 245, 254)
.setTemperature(0F)
.setFogDensity(2.2F)
.setFoliageColor(193, 244, 244)
.setGenChance(0.25F)
.setParticles(EndParticles.SNOWFLAKE, 0.002F)
.addFeature(EndFeatures.ICE_STAR)
.addFeature(EndFeatures.ICE_STAR_SMALL)
.addMobSpawn(EntityType.ENDERMAN, 20, 1, 4));
}
}

View file

@ -7,7 +7,11 @@ import ru.betterend.registry.EndParticles;
public class EmptyAuroraCaveBiome extends EndCaveBiome {
public EmptyAuroraCaveBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("empty_aurora_cave")).setFogColor(150, 30, 68).setFogDensity(2.0F).setPlantsColor(108, 25, 46).setWaterAndFogColor(186, 77, 237).setParticles(EndParticles.GLOWING_SPHERE, 0.001F));
super(new BCLBiomeDef(BetterEnd.makeID("empty_aurora_cave")).setFogColor(150, 30, 68)
.setFogDensity(2.0F)
.setPlantsColor(108, 25, 46)
.setWaterAndFogColor(186, 77, 237)
.setParticles(EndParticles.GLOWING_SPHERE, 0.001F));
this.addFloorFeature(EndFeatures.BIG_AURORA_CRYSTAL, 1);

View file

@ -7,7 +7,11 @@ import ru.betterend.registry.EndParticles;
public class EmptySmaragdantCaveBiome extends EndCaveBiome {
public EmptySmaragdantCaveBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("empty_smaragdant_cave")).setFogColor(0, 253, 182).setFogDensity(2.0F).setPlantsColor(0, 131, 145).setWaterAndFogColor(31, 167, 212).setParticles(EndParticles.SMARAGDANT, 0.001F));
super(new BCLBiomeDef(BetterEnd.makeID("empty_smaragdant_cave")).setFogColor(0, 253, 182)
.setFogDensity(2.0F)
.setPlantsColor(0, 131, 145)
.setWaterAndFogColor(31, 167, 212)
.setParticles(EndParticles.SMARAGDANT, 0.001F));
this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL, 1);
this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL_SHARD, 20);

View file

@ -9,8 +9,8 @@ import ru.bclib.api.BiomeAPI;
import ru.bclib.world.biomes.BCLBiomeDef;
import ru.bclib.world.features.BCLFeature;
import ru.betterend.BetterEnd;
import ru.betterend.registry.EndSounds;
import ru.betterend.interfaces.ShuffelingListExtended;
import ru.betterend.registry.EndSounds;
import ru.betterend.world.biome.EndBiome;
import ru.betterend.world.features.terrain.caves.CaveChunkPopulatorFeature;
@ -23,7 +23,11 @@ public class EndCaveBiome extends EndBiome {
}
private static BCLBiomeDef makeDef(BCLBiomeDef definition) {
BCLFeature feature = BCLFeature.makeChunkFeature(BetterEnd.makeID(definition.getID().getPath() + "_cave_populator"), new CaveChunkPopulatorFeature(() -> (EndCaveBiome) BiomeAPI.getBiome(definition.getID())));
BCLFeature feature = BCLFeature.makeChunkFeature(
BetterEnd.makeID(definition.getID()
.getPath() + "_cave_populator"),
new CaveChunkPopulatorFeature(() -> (EndCaveBiome) BiomeAPI.getBiome(definition.getID()))
);
definition.setCategory(BiomeCategory.NONE).addFeature(feature);
definition.setMusic(EndSounds.MUSIC_CAVES);
definition.setLoop(EndSounds.AMBIENT_CAVES);
@ -39,11 +43,13 @@ public class EndCaveBiome extends EndBiome {
}
public Feature<?> getFloorFeature() {
return ((ShuffelingListExtended<Feature<?>>) floorFeatures).isEmpty() ? null : ((ShuffelingListExtended<Feature<?>>) floorFeatures).getOne();
return ((ShuffelingListExtended<Feature<?>>) floorFeatures).isEmpty() ? null : ((ShuffelingListExtended<Feature<?>>) floorFeatures)
.getOne();
}
public Feature<?> getCeilFeature() {
return ((ShuffelingListExtended<Feature<?>>) ceilFeatures).isEmpty() ? null : ((ShuffelingListExtended<Feature<?>>) ceilFeatures).getOne();
return ((ShuffelingListExtended<Feature<?>>) ceilFeatures).isEmpty() ? null : ((ShuffelingListExtended<Feature<?>>) ceilFeatures)
.getOne();
}
public float getFloorDensity() {

View file

@ -14,7 +14,9 @@ public class JadeCaveBiome extends EndCaveBiome {
private static final BlockState[] JADE = new BlockState[3];
public JadeCaveBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("jade_cave")).setFogColor(118, 150, 112).setFogDensity(2.0F).setWaterAndFogColor(95, 223, 255));
super(new BCLBiomeDef(BetterEnd.makeID("jade_cave")).setFogColor(118, 150, 112)
.setFogDensity(2.0F)
.setWaterAndFogColor(95, 223, 255));
JADE[0] = EndBlocks.VIRID_JADESTONE.stone.defaultBlockState();
JADE[1] = EndBlocks.AZURE_JADESTONE.stone.defaultBlockState();
JADE[2] = EndBlocks.SANDY_JADESTONE.stone.defaultBlockState();

View file

@ -11,7 +11,12 @@ import ru.betterend.registry.EndParticles;
public class LushAuroraCaveBiome extends EndCaveBiome {
public LushAuroraCaveBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("lush_aurora_cave")).setFogColor(150, 30, 68).setFogDensity(2.0F).setPlantsColor(108, 25, 46).setWaterAndFogColor(186, 77, 237).setParticles(EndParticles.GLOWING_SPHERE, 0.001F).setSurface(EndBlocks.CAVE_MOSS));
super(new BCLBiomeDef(BetterEnd.makeID("lush_aurora_cave")).setFogColor(150, 30, 68)
.setFogDensity(2.0F)
.setPlantsColor(108, 25, 46)
.setWaterAndFogColor(186, 77, 237)
.setParticles(EndParticles.GLOWING_SPHERE, 0.001F)
.setSurface(EndBlocks.CAVE_MOSS));
this.addFloorFeature(EndFeatures.BIG_AURORA_CRYSTAL, 1);
this.addFloorFeature(EndFeatures.CAVE_BUSH, 5);
@ -37,6 +42,7 @@ public class LushAuroraCaveBiome extends EndCaveBiome {
@Override
public BlockState getCeil(BlockPos pos) {
return EndBlocks.CAVE_MOSS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.TOP);
return EndBlocks.CAVE_MOSS.defaultBlockState()
.setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.TOP);
}
}

View file

@ -8,7 +8,12 @@ import ru.betterend.registry.EndParticles;
public class LushSmaragdantCaveBiome extends EndCaveBiome {
public LushSmaragdantCaveBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("lush_smaragdant_cave")).setFogColor(0, 253, 182).setFogDensity(2.0F).setPlantsColor(0, 131, 145).setWaterAndFogColor(31, 167, 212).setParticles(EndParticles.SMARAGDANT, 0.001F).setSurface(EndBlocks.CAVE_MOSS));
super(new BCLBiomeDef(BetterEnd.makeID("lush_smaragdant_cave")).setFogColor(0, 253, 182)
.setFogDensity(2.0F)
.setPlantsColor(0, 131, 145)
.setWaterAndFogColor(31, 167, 212)
.setParticles(EndParticles.SMARAGDANT, 0.001F)
.setSurface(EndBlocks.CAVE_MOSS));
this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL, 1);
this.addFloorFeature(EndFeatures.SMARAGDANT_CRYSTAL_SHARD, 20);

View file

@ -13,6 +13,27 @@ import ru.betterend.world.biome.EndBiome;
public class AmberLandBiome extends EndBiome {
public AmberLandBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("amber_land")).setFogColor(255, 184, 71).setFogDensity(2.0F).setPlantsColor(219, 115, 38).setWaterAndFogColor(145, 108, 72).setMusic(EndSounds.MUSIC_FOREST).setLoop(EndSounds.AMBIENT_AMBER_LAND).setParticles(EndParticles.AMBER_SPHERE, 0.001F).setSurface(EndBlocks.AMBER_MOSS).addFeature(EndFeatures.AMBER_ORE).addFeature(EndFeatures.END_LAKE_RARE).addFeature(EndFeatures.HELIX_TREE).addFeature(EndFeatures.LANCELEAF).addFeature(EndFeatures.GLOW_PILLAR).addFeature(EndFeatures.AMBER_GRASS).addFeature(EndFeatures.AMBER_ROOT).addFeature(EndFeatures.BULB_MOSS).addFeature(EndFeatures.BULB_MOSS_WOOD).addFeature(EndFeatures.CHARNIA_ORANGE).addFeature(EndFeatures.CHARNIA_RED).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EntityType.ENDERMAN, 50, 1, 4).addMobSpawn(EndEntities.END_SLIME, 30, 1, 2));
super(new BCLBiomeDef(BetterEnd.makeID("amber_land")).setFogColor(255, 184, 71)
.setFogDensity(2.0F)
.setPlantsColor(219, 115, 38)
.setWaterAndFogColor(145, 108, 72)
.setMusic(EndSounds.MUSIC_FOREST)
.setLoop(EndSounds.AMBIENT_AMBER_LAND)
.setParticles(EndParticles.AMBER_SPHERE, 0.001F)
.setSurface(EndBlocks.AMBER_MOSS)
.addFeature(EndFeatures.AMBER_ORE)
.addFeature(EndFeatures.END_LAKE_RARE)
.addFeature(EndFeatures.HELIX_TREE)
.addFeature(EndFeatures.LANCELEAF)
.addFeature(EndFeatures.GLOW_PILLAR)
.addFeature(EndFeatures.AMBER_GRASS)
.addFeature(EndFeatures.AMBER_ROOT)
.addFeature(EndFeatures.BULB_MOSS)
.addFeature(EndFeatures.BULB_MOSS_WOOD)
.addFeature(EndFeatures.CHARNIA_ORANGE)
.addFeature(EndFeatures.CHARNIA_RED)
.addStructureFeature(StructureFeatures.END_CITY)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 4)
.addMobSpawn(EndEntities.END_SLIME, 30, 1, 2));
}
}

View file

@ -11,6 +11,25 @@ import ru.betterend.world.biome.EndBiome;
public class BlossomingSpiresBiome extends EndBiome {
public BlossomingSpiresBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("blossoming_spires")).addCustomData("has_caves", false).setFogColor(241, 146, 229).setFogDensity(1.7F).setPlantsColor(122, 45, 122).setSurface(EndBlocks.PINK_MOSS).setMusic(EndSounds.MUSIC_FOREST).setLoop(EndSounds.AMBIENT_BLOSSOMING_SPIRES).addFeature(EndFeatures.SPIRE).addFeature(EndFeatures.FLOATING_SPIRE).addFeature(EndFeatures.TENANEA).addFeature(EndFeatures.TENANEA_BUSH).addFeature(EndFeatures.BULB_VINE).addFeature(EndFeatures.BUSHY_GRASS).addFeature(EndFeatures.BUSHY_GRASS_WG).addFeature(EndFeatures.BLOSSOM_BERRY).addFeature(EndFeatures.TWISTED_MOSS).addFeature(EndFeatures.TWISTED_MOSS_WOOD).addFeature(EndFeatures.SILK_MOTH_NEST).addMobSpawn(EntityType.ENDERMAN, 50, 1, 4).addMobSpawn(EndEntities.SILK_MOTH, 5, 1, 2));
super(new BCLBiomeDef(BetterEnd.makeID("blossoming_spires")).addCustomData("has_caves", false)
.setFogColor(241, 146, 229)
.setFogDensity(1.7F)
.setPlantsColor(122, 45, 122)
.setSurface(EndBlocks.PINK_MOSS)
.setMusic(EndSounds.MUSIC_FOREST)
.setLoop(EndSounds.AMBIENT_BLOSSOMING_SPIRES)
.addFeature(EndFeatures.SPIRE)
.addFeature(EndFeatures.FLOATING_SPIRE)
.addFeature(EndFeatures.TENANEA)
.addFeature(EndFeatures.TENANEA_BUSH)
.addFeature(EndFeatures.BULB_VINE)
.addFeature(EndFeatures.BUSHY_GRASS)
.addFeature(EndFeatures.BUSHY_GRASS_WG)
.addFeature(EndFeatures.BLOSSOM_BERRY)
.addFeature(EndFeatures.TWISTED_MOSS)
.addFeature(EndFeatures.TWISTED_MOSS_WOOD)
.addFeature(EndFeatures.SILK_MOTH_NEST)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 4)
.addMobSpawn(EndEntities.SILK_MOTH, 5, 1, 2));
}
}

View file

@ -15,6 +15,35 @@ import ru.betterend.world.biome.EndBiome;
public class ChorusForestBiome extends EndBiome {
public ChorusForestBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("chorus_forest")).setFogColor(87, 26, 87).setFogDensity(1.5F).setPlantsColor(122, 45, 122).setWaterAndFogColor(73, 30, 73).setSurface(EndBlocks.CHORUS_NYLIUM).setParticles(ParticleTypes.PORTAL, 0.01F).setLoop(EndSounds.AMBIENT_CHORUS_FOREST).setMusic(EndSounds.MUSIC_DARK).addFeature(EndFeatures.VIOLECITE_LAYER).addFeature(EndFeatures.END_LAKE_RARE).addFeature(EndFeatures.PYTHADENDRON_TREE).addFeature(EndFeatures.PYTHADENDRON_BUSH).addFeature(EndFeatures.PURPLE_POLYPORE).addFeature(Decoration.VEGETAL_DECORATION, Features.CHORUS_PLANT).addFeature(Decoration.VEGETAL_DECORATION, Features.CHORUS_PLANT).addFeature(EndFeatures.CHORUS_GRASS).addFeature(EndFeatures.CHORUS_MUSHROOM).addFeature(EndFeatures.TAIL_MOSS).addFeature(EndFeatures.TAIL_MOSS_WOOD).addFeature(EndFeatures.CHARNIA_PURPLE).addFeature(EndFeatures.CHARNIA_RED_RARE).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EndEntities.END_SLIME, 5, 1, 2).addMobSpawn(EntityType.ENDERMAN, 50, 1, 4));
super(new BCLBiomeDef(BetterEnd.makeID("chorus_forest")).setFogColor(87, 26, 87)
.setFogDensity(1.5F)
.setPlantsColor(122, 45, 122)
.setWaterAndFogColor(73, 30, 73)
.setSurface(EndBlocks.CHORUS_NYLIUM)
.setParticles(ParticleTypes.PORTAL, 0.01F)
.setLoop(EndSounds.AMBIENT_CHORUS_FOREST)
.setMusic(EndSounds.MUSIC_DARK)
.addFeature(EndFeatures.VIOLECITE_LAYER)
.addFeature(EndFeatures.END_LAKE_RARE)
.addFeature(EndFeatures.PYTHADENDRON_TREE)
.addFeature(EndFeatures.PYTHADENDRON_BUSH)
.addFeature(EndFeatures.PURPLE_POLYPORE)
.addFeature(
Decoration.VEGETAL_DECORATION,
Features.CHORUS_PLANT
)
.addFeature(
Decoration.VEGETAL_DECORATION,
Features.CHORUS_PLANT
)
.addFeature(EndFeatures.CHORUS_GRASS)
.addFeature(EndFeatures.CHORUS_MUSHROOM)
.addFeature(EndFeatures.TAIL_MOSS)
.addFeature(EndFeatures.TAIL_MOSS_WOOD)
.addFeature(EndFeatures.CHARNIA_PURPLE)
.addFeature(EndFeatures.CHARNIA_RED_RARE)
.addStructureFeature(StructureFeatures.END_CITY)
.addMobSpawn(EndEntities.END_SLIME, 5, 1, 2)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 4));
}
}

View file

@ -11,6 +11,12 @@ import ru.betterend.world.biome.EndBiome;
public class CrystalMountainsBiome extends EndBiome {
public CrystalMountainsBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("crystal_mountains")).addStructureFeature(EndStructures.MOUNTAIN.getFeatureConfigured()).setPlantsColor(255, 133, 211).setSurface(EndBlocks.CRYSTAL_MOSS).setMusic(EndSounds.MUSIC_OPENSPACE).addFeature(EndFeatures.ROUND_CAVE).addFeature(EndFeatures.CRYSTAL_GRASS).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
super(new BCLBiomeDef(BetterEnd.makeID("crystal_mountains")).addStructureFeature(EndStructures.MOUNTAIN.getFeatureConfigured())
.setPlantsColor(255, 133, 211)
.setSurface(EndBlocks.CRYSTAL_MOSS)
.setMusic(EndSounds.MUSIC_OPENSPACE)
.addFeature(EndFeatures.ROUND_CAVE)
.addFeature(EndFeatures.CRYSTAL_GRASS)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
}
}

View file

@ -11,6 +11,23 @@ import ru.betterend.world.biome.EndBiome;
public class DragonGraveyardsBiome extends EndBiome {
public DragonGraveyardsBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("dragon_graveyards")).setGenChance(0.1F).setFogColor(244, 46, 79).setFogDensity(1.3F).setParticles(EndParticles.FIREFLY, 0.0007F).setMusic(EndSounds.MUSIC_OPENSPACE).setLoop(EndSounds.AMBIENT_GLOWING_GRASSLANDS).setSurface(EndBlocks.SANGNUM).setWaterAndFogColor(203, 59, 167).setPlantsColor(244, 46, 79).addFeature(EndFeatures.OBSIDIAN_PILLAR_BASEMENT).addFeature(EndFeatures.FALLEN_PILLAR).addFeature(EndFeatures.OBSIDIAN_BOULDER).addFeature(EndFeatures.GIGANTIC_AMARANITA).addFeature(EndFeatures.LARGE_AMARANITA).addFeature(EndFeatures.SMALL_AMARANITA).addFeature(EndFeatures.GLOBULAGUS).addFeature(EndFeatures.CLAWFERN).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
super(new BCLBiomeDef(BetterEnd.makeID("dragon_graveyards")).setGenChance(0.1F)
.setFogColor(244, 46, 79)
.setFogDensity(1.3F)
.setParticles(EndParticles.FIREFLY, 0.0007F)
.setMusic(EndSounds.MUSIC_OPENSPACE)
.setLoop(EndSounds.AMBIENT_GLOWING_GRASSLANDS)
.setSurface(EndBlocks.SANGNUM)
.setWaterAndFogColor(203, 59, 167)
.setPlantsColor(244, 46, 79)
.addFeature(EndFeatures.OBSIDIAN_PILLAR_BASEMENT)
.addFeature(EndFeatures.FALLEN_PILLAR)
.addFeature(EndFeatures.OBSIDIAN_BOULDER)
.addFeature(EndFeatures.GIGANTIC_AMARANITA)
.addFeature(EndFeatures.LARGE_AMARANITA)
.addFeature(EndFeatures.SMALL_AMARANITA)
.addFeature(EndFeatures.GLOBULAGUS)
.addFeature(EndFeatures.CLAWFERN)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
}
}

View file

@ -11,6 +11,18 @@ import ru.betterend.world.biome.EndBiome;
public class DryShrublandBiome extends EndBiome {
public DryShrublandBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("dry_shrubland")).setFogColor(132, 35, 13).setFogDensity(1.2F).setWaterAndFogColor(113, 88, 53).setPlantsColor(237, 122, 66).setSurface(EndBlocks.RUTISCUS).setMusic(EndSounds.MUSIC_OPENSPACE).addFeature(EndFeatures.LUCERNIA_BUSH_RARE).addFeature(EndFeatures.ORANGO).addFeature(EndFeatures.AERIDIUM).addFeature(EndFeatures.LUTEBUS).addFeature(EndFeatures.LAMELLARIUM).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
super(new BCLBiomeDef(BetterEnd.makeID("dry_shrubland")).setFogColor(132, 35, 13)
.setFogDensity(1.2F)
.setWaterAndFogColor(113, 88, 53)
.setPlantsColor(237, 122, 66)
.setSurface(EndBlocks.RUTISCUS)
.setMusic(EndSounds.MUSIC_OPENSPACE)
.addFeature(EndFeatures.LUCERNIA_BUSH_RARE)
.addFeature(EndFeatures.ORANGO)
.addFeature(EndFeatures.AERIDIUM)
.addFeature(EndFeatures.LUTEBUS)
.addFeature(EndFeatures.LAMELLARIUM)
.addStructureFeature(StructureFeatures.END_CITY)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
}
}

View file

@ -11,6 +11,15 @@ import ru.betterend.world.biome.EndBiome;
public class DustWastelandsBiome extends EndBiome {
public DustWastelandsBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("dust_wastelands")).setFogColor(226, 239, 168).setFogDensity(2).setWaterAndFogColor(192, 180, 131).setSurface(EndBlocks.ENDSTONE_DUST).setDepth(1.5F).setParticles(ParticleTypes.WHITE_ASH, 0.01F).setLoop(EndSounds.AMBIENT_DUST_WASTELANDS).setMusic(EndSounds.MUSIC_OPENSPACE).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
super(new BCLBiomeDef(BetterEnd.makeID("dust_wastelands")).setFogColor(226, 239, 168)
.setFogDensity(2)
.setWaterAndFogColor(192, 180, 131)
.setSurface(EndBlocks.ENDSTONE_DUST)
.setDepth(1.5F)
.setParticles(ParticleTypes.WHITE_ASH, 0.01F)
.setLoop(EndSounds.AMBIENT_DUST_WASTELANDS)
.setMusic(EndSounds.MUSIC_OPENSPACE)
.addStructureFeature(StructureFeatures.END_CITY)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
}
}

View file

@ -14,8 +14,38 @@ import ru.betterend.world.biome.EndBiome;
public class FoggyMushroomlandBiome extends EndBiome {
public FoggyMushroomlandBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("foggy_mushroomland")).addStructureFeature(EndStructures.GIANT_MOSSY_GLOWSHROOM.getFeatureConfigured()).setPlantsColor(73, 210, 209).setFogColor(41, 122, 173).setFogDensity(3).setWaterAndFogColor(119, 227, 250).setSurface(EndBlocks.END_MOSS, EndBlocks.END_MYCELIUM).setParticles(EndParticles.GLOWING_SPHERE, 0.001F).setLoop(EndSounds.AMBIENT_FOGGY_MUSHROOMLAND).setMusic(EndSounds.MUSIC_FOREST).addFeature(EndFeatures.END_LAKE).addFeature(EndFeatures.MOSSY_GLOWSHROOM).addFeature(EndFeatures.BLUE_VINE).addFeature(EndFeatures.UMBRELLA_MOSS).addFeature(EndFeatures.CREEPING_MOSS).addFeature(EndFeatures.DENSE_VINE)
//.addFeature(EndFeatures.PEARLBERRY)
.addFeature(EndFeatures.CYAN_MOSS).addFeature(EndFeatures.CYAN_MOSS_WOOD).addFeature(EndFeatures.END_LILY).addFeature(EndFeatures.BUBBLE_CORAL).addFeature(EndFeatures.CHARNIA_CYAN).addFeature(EndFeatures.CHARNIA_LIGHT_BLUE).addFeature(EndFeatures.CHARNIA_RED_RARE).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EndEntities.DRAGONFLY, 80, 2, 5).addMobSpawn(EndEntities.END_FISH, 20, 2, 5).addMobSpawn(EndEntities.CUBOZOA, 10, 3, 8).addMobSpawn(EndEntities.END_SLIME, 10, 1, 2).addMobSpawn(EntityType.ENDERMAN, 10, 1, 2));
super(new BCLBiomeDef(BetterEnd.makeID("foggy_mushroomland")).addStructureFeature(EndStructures.GIANT_MOSSY_GLOWSHROOM
.getFeatureConfigured())
.setPlantsColor(73, 210, 209)
.setFogColor(41, 122, 173)
.setFogDensity(3)
.setWaterAndFogColor(119, 227, 250)
.setSurface(
EndBlocks.END_MOSS,
EndBlocks.END_MYCELIUM
)
.setParticles(EndParticles.GLOWING_SPHERE, 0.001F)
.setLoop(EndSounds.AMBIENT_FOGGY_MUSHROOMLAND)
.setMusic(EndSounds.MUSIC_FOREST)
.addFeature(EndFeatures.END_LAKE)
.addFeature(EndFeatures.MOSSY_GLOWSHROOM)
.addFeature(EndFeatures.BLUE_VINE)
.addFeature(EndFeatures.UMBRELLA_MOSS)
.addFeature(EndFeatures.CREEPING_MOSS)
.addFeature(EndFeatures.DENSE_VINE)
//.addFeature(EndFeatures.PEARLBERRY)
.addFeature(EndFeatures.CYAN_MOSS)
.addFeature(EndFeatures.CYAN_MOSS_WOOD)
.addFeature(EndFeatures.END_LILY)
.addFeature(EndFeatures.BUBBLE_CORAL)
.addFeature(EndFeatures.CHARNIA_CYAN)
.addFeature(EndFeatures.CHARNIA_LIGHT_BLUE)
.addFeature(EndFeatures.CHARNIA_RED_RARE)
.addStructureFeature(StructureFeatures.END_CITY)
.addMobSpawn(EndEntities.DRAGONFLY, 80, 2, 5)
.addMobSpawn(EndEntities.END_FISH, 20, 2, 5)
.addMobSpawn(EndEntities.CUBOZOA, 10, 3, 8)
.addMobSpawn(EndEntities.END_SLIME, 10, 1, 2)
.addMobSpawn(EntityType.ENDERMAN, 10, 1, 2));
}
}

View file

@ -12,6 +12,28 @@ import ru.betterend.world.biome.EndBiome;
public class GlowingGrasslandsBiome extends EndBiome {
public GlowingGrasslandsBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("glowing_grasslands")).setFogColor(99, 228, 247).setFogDensity(1.3F).setParticles(EndParticles.FIREFLY, 0.001F).setMusic(EndSounds.MUSIC_OPENSPACE).setLoop(EndSounds.AMBIENT_GLOWING_GRASSLANDS).setSurface(EndBlocks.END_MOSS).setWaterAndFogColor(92, 250, 230).setPlantsColor(73, 210, 209).addFeature(EndFeatures.END_LAKE_RARE).addFeature(EndFeatures.LUMECORN).addFeature(EndFeatures.BLOOMING_COOKSONIA).addFeature(EndFeatures.SALTEAGO).addFeature(EndFeatures.VAIOLUSH_FERN).addFeature(EndFeatures.FRACTURN).addFeature(EndFeatures.UMBRELLA_MOSS_RARE).addFeature(EndFeatures.CREEPING_MOSS_RARE).addFeature(EndFeatures.TWISTED_UMBRELLA_MOSS_RARE).addFeature(EndFeatures.CHARNIA_CYAN).addFeature(EndFeatures.CHARNIA_GREEN).addFeature(EndFeatures.CHARNIA_LIGHT_BLUE).addFeature(EndFeatures.CHARNIA_RED_RARE).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
super(new BCLBiomeDef(BetterEnd.makeID("glowing_grasslands")).setFogColor(99, 228, 247)
.setFogDensity(1.3F)
.setParticles(EndParticles.FIREFLY, 0.001F)
.setMusic(EndSounds.MUSIC_OPENSPACE)
.setLoop(EndSounds.AMBIENT_GLOWING_GRASSLANDS)
.setSurface(EndBlocks.END_MOSS)
.setWaterAndFogColor(92, 250, 230)
.setPlantsColor(73, 210, 209)
.addFeature(EndFeatures.END_LAKE_RARE)
.addFeature(EndFeatures.LUMECORN)
.addFeature(EndFeatures.BLOOMING_COOKSONIA)
.addFeature(EndFeatures.SALTEAGO)
.addFeature(EndFeatures.VAIOLUSH_FERN)
.addFeature(EndFeatures.FRACTURN)
.addFeature(EndFeatures.UMBRELLA_MOSS_RARE)
.addFeature(EndFeatures.CREEPING_MOSS_RARE)
.addFeature(EndFeatures.TWISTED_UMBRELLA_MOSS_RARE)
.addFeature(EndFeatures.CHARNIA_CYAN)
.addFeature(EndFeatures.CHARNIA_GREEN)
.addFeature(EndFeatures.CHARNIA_LIGHT_BLUE)
.addFeature(EndFeatures.CHARNIA_RED_RARE)
.addStructureFeature(StructureFeatures.END_CITY)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
}
}

View file

@ -12,6 +12,28 @@ import ru.betterend.world.biome.EndBiome;
public class LanternWoodsBiome extends EndBiome {
public LanternWoodsBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("lantern_woods")).setFogColor(189, 82, 70).setFogDensity(1.1F).setWaterAndFogColor(171, 234, 226).setPlantsColor(254, 85, 57).setSurface(EndBlocks.RUTISCUS).setMusic(EndSounds.MUSIC_FOREST).setParticles(EndParticles.GLOWING_SPHERE, 0.001F).addFeature(EndFeatures.END_LAKE_NORMAL).addFeature(EndFeatures.FLAMAEA).addFeature(EndFeatures.LUCERNIA).addFeature(EndFeatures.LUCERNIA_BUSH).addFeature(EndFeatures.FILALUX).addFeature(EndFeatures.AERIDIUM).addFeature(EndFeatures.LAMELLARIUM).addFeature(EndFeatures.BOLUX_MUSHROOM).addFeature(EndFeatures.AURANT_POLYPORE).addFeature(EndFeatures.POND_ANEMONE).addFeature(EndFeatures.CHARNIA_ORANGE).addFeature(EndFeatures.CHARNIA_RED).addFeature(EndFeatures.RUSCUS).addFeature(EndFeatures.RUSCUS_WOOD).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
super(new BCLBiomeDef(BetterEnd.makeID("lantern_woods")).setFogColor(189, 82, 70)
.setFogDensity(1.1F)
.setWaterAndFogColor(171, 234, 226)
.setPlantsColor(254, 85, 57)
.setSurface(EndBlocks.RUTISCUS)
.setMusic(EndSounds.MUSIC_FOREST)
.setParticles(EndParticles.GLOWING_SPHERE, 0.001F)
.addFeature(EndFeatures.END_LAKE_NORMAL)
.addFeature(EndFeatures.FLAMAEA)
.addFeature(EndFeatures.LUCERNIA)
.addFeature(EndFeatures.LUCERNIA_BUSH)
.addFeature(EndFeatures.FILALUX)
.addFeature(EndFeatures.AERIDIUM)
.addFeature(EndFeatures.LAMELLARIUM)
.addFeature(EndFeatures.BOLUX_MUSHROOM)
.addFeature(EndFeatures.AURANT_POLYPORE)
.addFeature(EndFeatures.POND_ANEMONE)
.addFeature(EndFeatures.CHARNIA_ORANGE)
.addFeature(EndFeatures.CHARNIA_RED)
.addFeature(EndFeatures.RUSCUS)
.addFeature(EndFeatures.RUSCUS_WOOD)
.addStructureFeature(StructureFeatures.END_CITY)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
}
}

View file

@ -12,8 +12,30 @@ import ru.betterend.world.biome.EndBiome;
public class MegalakeBiome extends EndBiome {
public MegalakeBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("megalake")).addStructureFeature(EndStructures.MEGALAKE.getFeatureConfigured()).setPlantsColor(73, 210, 209).setFogColor(178, 209, 248).setWaterAndFogColor(96, 163, 255).setFogDensity(1.75F).setMusic(EndSounds.MUSIC_WATER).setLoop(EndSounds.AMBIENT_MEGALAKE).setSurface(EndBlocks.END_MOSS, EndBlocks.ENDSTONE_DUST).setDepth(0F).addFeature(EndFeatures.END_LOTUS).addFeature(EndFeatures.END_LOTUS_LEAF).addFeature(EndFeatures.BUBBLE_CORAL_RARE).addFeature(EndFeatures.END_LILY_RARE).addFeature(EndFeatures.UMBRELLA_MOSS).addFeature(EndFeatures.CREEPING_MOSS)
//.addFeature(EndFeatures.PEARLBERRY)
.addFeature(EndFeatures.CHARNIA_CYAN).addFeature(EndFeatures.CHARNIA_LIGHT_BLUE).addFeature(EndFeatures.CHARNIA_RED_RARE).addFeature(EndFeatures.MENGER_SPONGE).addMobSpawn(EndEntities.DRAGONFLY, 50, 1, 3).addMobSpawn(EndEntities.END_FISH, 50, 3, 8).addMobSpawn(EndEntities.CUBOZOA, 50, 3, 8).addMobSpawn(EndEntities.END_SLIME, 5, 1, 2).addMobSpawn(EntityType.ENDERMAN, 10, 1, 2));
super(new BCLBiomeDef(BetterEnd.makeID("megalake")).addStructureFeature(EndStructures.MEGALAKE.getFeatureConfigured())
.setPlantsColor(73, 210, 209)
.setFogColor(178, 209, 248)
.setWaterAndFogColor(96, 163, 255)
.setFogDensity(1.75F)
.setMusic(EndSounds.MUSIC_WATER)
.setLoop(EndSounds.AMBIENT_MEGALAKE)
.setSurface(EndBlocks.END_MOSS, EndBlocks.ENDSTONE_DUST)
.setDepth(0F)
.addFeature(EndFeatures.END_LOTUS)
.addFeature(EndFeatures.END_LOTUS_LEAF)
.addFeature(EndFeatures.BUBBLE_CORAL_RARE)
.addFeature(EndFeatures.END_LILY_RARE)
.addFeature(EndFeatures.UMBRELLA_MOSS)
.addFeature(EndFeatures.CREEPING_MOSS)
//.addFeature(EndFeatures.PEARLBERRY)
.addFeature(EndFeatures.CHARNIA_CYAN)
.addFeature(EndFeatures.CHARNIA_LIGHT_BLUE)
.addFeature(EndFeatures.CHARNIA_RED_RARE)
.addFeature(EndFeatures.MENGER_SPONGE)
.addMobSpawn(EndEntities.DRAGONFLY, 50, 1, 3)
.addMobSpawn(EndEntities.END_FISH, 50, 3, 8)
.addMobSpawn(EndEntities.CUBOZOA, 50, 3, 8)
.addMobSpawn(EndEntities.END_SLIME, 5, 1, 2)
.addMobSpawn(EntityType.ENDERMAN, 10, 1, 2));
}
}

View file

@ -13,8 +13,32 @@ import ru.betterend.world.biome.EndBiome;
public class MegalakeGroveBiome extends EndBiome {
public MegalakeGroveBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("megalake_grove")).addStructureFeature(EndStructures.MEGALAKE_SMALL.getFeatureConfigured()).setPlantsColor(73, 210, 209).setFogColor(178, 209, 248).setWaterAndFogColor(96, 163, 255).setFogDensity(2.0F).setParticles(EndParticles.GLOWING_SPHERE, 0.001F).setMusic(EndSounds.MUSIC_WATER).setLoop(EndSounds.AMBIENT_MEGALAKE_GROVE).setSurface(EndBlocks.END_MOSS).setDepth(0F).addFeature(EndFeatures.LACUGROVE).addFeature(EndFeatures.END_LOTUS).addFeature(EndFeatures.END_LOTUS_LEAF).addFeature(EndFeatures.BUBBLE_CORAL_RARE).addFeature(EndFeatures.END_LILY_RARE).addFeature(EndFeatures.UMBRELLA_MOSS)
//.addFeature(EndFeatures.PEARLBERRY)
.addFeature(EndFeatures.CREEPING_MOSS).addFeature(EndFeatures.CHARNIA_CYAN).addFeature(EndFeatures.CHARNIA_LIGHT_BLUE).addFeature(EndFeatures.CHARNIA_RED_RARE).addFeature(EndFeatures.MENGER_SPONGE).addMobSpawn(EndEntities.DRAGONFLY, 20, 1, 3).addMobSpawn(EndEntities.END_FISH, 20, 3, 8).addMobSpawn(EndEntities.CUBOZOA, 50, 3, 8).addMobSpawn(EndEntities.END_SLIME, 5, 1, 2).addMobSpawn(EntityType.ENDERMAN, 10, 1, 2));
super(new BCLBiomeDef(BetterEnd.makeID("megalake_grove")).addStructureFeature(EndStructures.MEGALAKE_SMALL.getFeatureConfigured())
.setPlantsColor(73, 210, 209)
.setFogColor(178, 209, 248)
.setWaterAndFogColor(96, 163, 255)
.setFogDensity(2.0F)
.setParticles(EndParticles.GLOWING_SPHERE, 0.001F)
.setMusic(EndSounds.MUSIC_WATER)
.setLoop(EndSounds.AMBIENT_MEGALAKE_GROVE)
.setSurface(EndBlocks.END_MOSS)
.setDepth(0F)
.addFeature(EndFeatures.LACUGROVE)
.addFeature(EndFeatures.END_LOTUS)
.addFeature(EndFeatures.END_LOTUS_LEAF)
.addFeature(EndFeatures.BUBBLE_CORAL_RARE)
.addFeature(EndFeatures.END_LILY_RARE)
.addFeature(EndFeatures.UMBRELLA_MOSS)
//.addFeature(EndFeatures.PEARLBERRY)
.addFeature(EndFeatures.CREEPING_MOSS)
.addFeature(EndFeatures.CHARNIA_CYAN)
.addFeature(EndFeatures.CHARNIA_LIGHT_BLUE)
.addFeature(EndFeatures.CHARNIA_RED_RARE)
.addFeature(EndFeatures.MENGER_SPONGE)
.addMobSpawn(EndEntities.DRAGONFLY, 20, 1, 3)
.addMobSpawn(EndEntities.END_FISH, 20, 3, 8)
.addMobSpawn(EndEntities.CUBOZOA, 50, 3, 8)
.addMobSpawn(EndEntities.END_SLIME, 5, 1, 2)
.addMobSpawn(EntityType.ENDERMAN, 10, 1, 2));
}
}

View file

@ -12,6 +12,22 @@ import ru.betterend.world.biome.EndBiome;
public class NeonOasisBiome extends EndBiome {
public NeonOasisBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("neon_oasis")).setGenChance(0.5F).setFogColor(226, 239, 168).setFogDensity(2).setWaterAndFogColor(106, 238, 215).setSurface(EndBlocks.ENDSTONE_DUST, EndBlocks.END_MOSS).setParticles(ParticleTypes.WHITE_ASH, 0.01F).setLoop(EndSounds.AMBIENT_DUST_WASTELANDS).setMusic(EndSounds.MUSIC_OPENSPACE).addFeature(EndFeatures.DESERT_LAKE).addFeature(EndFeatures.NEON_CACTUS).addFeature(EndFeatures.UMBRELLA_MOSS).addFeature(EndFeatures.CREEPING_MOSS).addFeature(EndFeatures.CHARNIA_GREEN).addFeature(EndFeatures.CHARNIA_CYAN).addFeature(EndFeatures.CHARNIA_RED).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
super(new BCLBiomeDef(BetterEnd.makeID("neon_oasis")).setGenChance(0.5F)
.setFogColor(226, 239, 168)
.setFogDensity(2)
.setWaterAndFogColor(106, 238, 215)
.setSurface(EndBlocks.ENDSTONE_DUST, EndBlocks.END_MOSS)
.setParticles(ParticleTypes.WHITE_ASH, 0.01F)
.setLoop(EndSounds.AMBIENT_DUST_WASTELANDS)
.setMusic(EndSounds.MUSIC_OPENSPACE)
.addFeature(EndFeatures.DESERT_LAKE)
.addFeature(EndFeatures.NEON_CACTUS)
.addFeature(EndFeatures.UMBRELLA_MOSS)
.addFeature(EndFeatures.CREEPING_MOSS)
.addFeature(EndFeatures.CHARNIA_GREEN)
.addFeature(EndFeatures.CHARNIA_CYAN)
.addFeature(EndFeatures.CHARNIA_RED)
.addStructureFeature(StructureFeatures.END_CITY)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
}
}

View file

@ -11,6 +11,14 @@ import ru.betterend.world.biome.EndBiome;
public class PaintedMountainsBiome extends EndBiome {
public PaintedMountainsBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("painted_mountains")).addStructureFeature(EndStructures.PAINTED_MOUNTAIN.getFeatureConfigured()).setFogColor(226, 239, 168).setFogDensity(2).setWaterAndFogColor(192, 180, 131).setMusic(EndSounds.MUSIC_OPENSPACE).setLoop(EndSounds.AMBIENT_DUST_WASTELANDS).setSurface(EndBlocks.ENDSTONE_DUST).setParticles(ParticleTypes.WHITE_ASH, 0.01F).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
super(new BCLBiomeDef(BetterEnd.makeID("painted_mountains")).addStructureFeature(EndStructures.PAINTED_MOUNTAIN.getFeatureConfigured())
.setFogColor(226, 239, 168)
.setFogDensity(2)
.setWaterAndFogColor(192, 180, 131)
.setMusic(EndSounds.MUSIC_OPENSPACE)
.setLoop(EndSounds.AMBIENT_DUST_WASTELANDS)
.setSurface(EndBlocks.ENDSTONE_DUST)
.setParticles(ParticleTypes.WHITE_ASH, 0.01F)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
}
}

View file

@ -13,6 +13,31 @@ import ru.betterend.world.biome.EndBiome;
public class ShadowForestBiome extends EndBiome {
public ShadowForestBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("shadow_forest")).setFogColor(0, 0, 0).setFogDensity(2.5F).setPlantsColor(45, 45, 45).setWaterAndFogColor(42, 45, 80).setSurface(EndBlocks.SHADOW_GRASS).setParticles(ParticleTypes.MYCELIUM, 0.01F).setLoop(EndSounds.AMBIENT_CHORUS_FOREST).setMusic(EndSounds.MUSIC_DARK).addFeature(EndFeatures.VIOLECITE_LAYER).addFeature(EndFeatures.END_LAKE_RARE).addFeature(EndFeatures.DRAGON_TREE).addFeature(EndFeatures.DRAGON_TREE_BUSH).addFeature(EndFeatures.SHADOW_PLANT).addFeature(EndFeatures.MURKWEED).addFeature(EndFeatures.NEEDLEGRASS).addFeature(EndFeatures.SHADOW_BERRY).addFeature(EndFeatures.TWISTED_VINE).addFeature(EndFeatures.PURPLE_POLYPORE).addFeature(EndFeatures.TAIL_MOSS).addFeature(EndFeatures.TAIL_MOSS_WOOD).addFeature(EndFeatures.CHARNIA_PURPLE).addFeature(EndFeatures.CHARNIA_RED_RARE).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EndEntities.SHADOW_WALKER, 80, 2, 4).addMobSpawn(EntityType.ENDERMAN, 40, 1, 4).addMobSpawn(EntityType.PHANTOM, 1, 1, 2));
super(new BCLBiomeDef(BetterEnd.makeID("shadow_forest")).setFogColor(0, 0, 0)
.setFogDensity(2.5F)
.setPlantsColor(45, 45, 45)
.setWaterAndFogColor(42, 45, 80)
.setSurface(EndBlocks.SHADOW_GRASS)
.setParticles(ParticleTypes.MYCELIUM, 0.01F)
.setLoop(EndSounds.AMBIENT_CHORUS_FOREST)
.setMusic(EndSounds.MUSIC_DARK)
.addFeature(EndFeatures.VIOLECITE_LAYER)
.addFeature(EndFeatures.END_LAKE_RARE)
.addFeature(EndFeatures.DRAGON_TREE)
.addFeature(EndFeatures.DRAGON_TREE_BUSH)
.addFeature(EndFeatures.SHADOW_PLANT)
.addFeature(EndFeatures.MURKWEED)
.addFeature(EndFeatures.NEEDLEGRASS)
.addFeature(EndFeatures.SHADOW_BERRY)
.addFeature(EndFeatures.TWISTED_VINE)
.addFeature(EndFeatures.PURPLE_POLYPORE)
.addFeature(EndFeatures.TAIL_MOSS)
.addFeature(EndFeatures.TAIL_MOSS_WOOD)
.addFeature(EndFeatures.CHARNIA_PURPLE)
.addFeature(EndFeatures.CHARNIA_RED_RARE)
.addStructureFeature(StructureFeatures.END_CITY)
.addMobSpawn(EndEntities.SHADOW_WALKER, 80, 2, 4)
.addMobSpawn(EntityType.ENDERMAN, 40, 1, 4)
.addMobSpawn(EntityType.PHANTOM, 1, 1, 2));
}
}

View file

@ -12,6 +12,27 @@ import ru.betterend.world.surface.SurfaceBuilders;
public class SulphurSpringsBiome extends EndBiome {
public SulphurSpringsBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("sulphur_springs")).addCustomData("has_caves", false).setSurface(SurfaceBuilders.SULPHURIC_SURFACE.configured(SurfaceBuilders.DEFAULT_END_CONFIG)).setMusic(EndSounds.MUSIC_OPENSPACE).setLoop(EndSounds.AMBIENT_SULPHUR_SPRINGS).setWaterColor(25, 90, 157).setWaterFogColor(30, 65, 61).setFogColor(207, 194, 62).setFogDensity(1.5F).setDepth(0F).setParticles(EndParticles.SULPHUR_PARTICLE, 0.001F).addFeature(EndFeatures.GEYSER).addFeature(EndFeatures.SURFACE_VENT).addFeature(EndFeatures.SULPHURIC_LAKE).addFeature(EndFeatures.SULPHURIC_CAVE).addFeature(EndFeatures.HYDRALUX).addFeature(EndFeatures.CHARNIA_GREEN).addFeature(EndFeatures.CHARNIA_ORANGE).addFeature(EndFeatures.CHARNIA_RED_RARE).addMobSpawn(EndEntities.END_FISH, 50, 3, 8).addMobSpawn(EndEntities.CUBOZOA, 50, 3, 8).addMobSpawn(EntityType.ENDERMAN, 50, 1, 4));
super(new BCLBiomeDef(BetterEnd.makeID("sulphur_springs")).addCustomData("has_caves", false)
.setSurface(SurfaceBuilders.SULPHURIC_SURFACE.configured(
SurfaceBuilders.DEFAULT_END_CONFIG))
.setMusic(EndSounds.MUSIC_OPENSPACE)
.setLoop(EndSounds.AMBIENT_SULPHUR_SPRINGS)
.setWaterColor(25, 90, 157)
.setWaterFogColor(30, 65, 61)
.setFogColor(207, 194, 62)
.setFogDensity(1.5F)
.setDepth(0F)
.setParticles(EndParticles.SULPHUR_PARTICLE, 0.001F)
.addFeature(EndFeatures.GEYSER)
.addFeature(EndFeatures.SURFACE_VENT)
.addFeature(EndFeatures.SULPHURIC_LAKE)
.addFeature(EndFeatures.SULPHURIC_CAVE)
.addFeature(EndFeatures.HYDRALUX)
.addFeature(EndFeatures.CHARNIA_GREEN)
.addFeature(EndFeatures.CHARNIA_ORANGE)
.addFeature(EndFeatures.CHARNIA_RED_RARE)
.addMobSpawn(EndEntities.END_FISH, 50, 3, 8)
.addMobSpawn(EndEntities.CUBOZOA, 50, 3, 8)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 4));
}
}

View file

@ -2,7 +2,6 @@ package ru.betterend.world.biome.land;
import ru.bclib.world.biomes.BCLBiomeDef;
import ru.betterend.BetterEnd;
import ru.betterend.registry.EndBlocks;
import ru.betterend.world.biome.EndBiome;
import ru.betterend.world.surface.SurfaceBuilders;
@ -10,10 +9,10 @@ public class UmbraValleyBiome extends EndBiome {
public UmbraValleyBiome() {
super(
new BCLBiomeDef(BetterEnd.makeID("umbra_valley"))
.setFogColor(100, 100, 100)
.setPlantsColor(200, 200, 200)
.setWaterAndFogColor(69, 104, 134)
.setSurface(SurfaceBuilders.UMBRA_SURFACE.configured(SurfaceBuilders.DEFAULT_END_CONFIG))
.setFogColor(100, 100, 100)
.setPlantsColor(200, 200, 200)
.setWaterAndFogColor(69, 104, 134)
.setSurface(SurfaceBuilders.UMBRA_SURFACE.configured(SurfaceBuilders.DEFAULT_END_CONFIG))
);
}
}

View file

@ -12,6 +12,32 @@ import ru.betterend.world.biome.EndBiome;
public class UmbrellaJungleBiome extends EndBiome {
public UmbrellaJungleBiome() {
super(new BCLBiomeDef(BetterEnd.makeID("umbrella_jungle")).setFogColor(87, 223, 221).setWaterAndFogColor(119, 198, 253).setFoliageColor(27, 183, 194).setFogDensity(2.3F).setParticles(EndParticles.JUNGLE_SPORE, 0.001F).setMusic(EndSounds.MUSIC_FOREST).setLoop(EndSounds.AMBIENT_UMBRELLA_JUNGLE).setSurface(EndBlocks.JUNGLE_MOSS).addFeature(EndFeatures.END_LAKE).addFeature(EndFeatures.UMBRELLA_TREE).addFeature(EndFeatures.JELLYSHROOM).addFeature(EndFeatures.TWISTED_UMBRELLA_MOSS).addFeature(EndFeatures.SMALL_JELLYSHROOM_FLOOR).addFeature(EndFeatures.JUNGLE_GRASS).addFeature(EndFeatures.CYAN_MOSS).addFeature(EndFeatures.CYAN_MOSS_WOOD).addFeature(EndFeatures.JUNGLE_FERN_WOOD).addFeature(EndFeatures.SMALL_JELLYSHROOM_WALL).addFeature(EndFeatures.SMALL_JELLYSHROOM_WOOD).addFeature(EndFeatures.SMALL_JELLYSHROOM_CEIL).addFeature(EndFeatures.JUNGLE_VINE).addFeature(EndFeatures.CHARNIA_CYAN).addFeature(EndFeatures.CHARNIA_GREEN).addFeature(EndFeatures.CHARNIA_LIGHT_BLUE).addFeature(EndFeatures.CHARNIA_RED_RARE).addStructureFeature(StructureFeatures.END_CITY).addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
super(new BCLBiomeDef(BetterEnd.makeID("umbrella_jungle")).setFogColor(87, 223, 221)
.setWaterAndFogColor(119, 198, 253)
.setFoliageColor(27, 183, 194)
.setFogDensity(2.3F)
.setParticles(EndParticles.JUNGLE_SPORE, 0.001F)
.setMusic(EndSounds.MUSIC_FOREST)
.setLoop(EndSounds.AMBIENT_UMBRELLA_JUNGLE)
.setSurface(EndBlocks.JUNGLE_MOSS)
.addFeature(EndFeatures.END_LAKE)
.addFeature(EndFeatures.UMBRELLA_TREE)
.addFeature(EndFeatures.JELLYSHROOM)
.addFeature(EndFeatures.TWISTED_UMBRELLA_MOSS)
.addFeature(EndFeatures.SMALL_JELLYSHROOM_FLOOR)
.addFeature(EndFeatures.JUNGLE_GRASS)
.addFeature(EndFeatures.CYAN_MOSS)
.addFeature(EndFeatures.CYAN_MOSS_WOOD)
.addFeature(EndFeatures.JUNGLE_FERN_WOOD)
.addFeature(EndFeatures.SMALL_JELLYSHROOM_WALL)
.addFeature(EndFeatures.SMALL_JELLYSHROOM_WOOD)
.addFeature(EndFeatures.SMALL_JELLYSHROOM_CEIL)
.addFeature(EndFeatures.JUNGLE_VINE)
.addFeature(EndFeatures.CHARNIA_CYAN)
.addFeature(EndFeatures.CHARNIA_GREEN)
.addFeature(EndFeatures.CHARNIA_LIGHT_BLUE)
.addFeature(EndFeatures.CHARNIA_RED_RARE)
.addStructureFeature(StructureFeatures.END_CITY)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
}
}

View file

@ -59,7 +59,10 @@ public class BiomeIslandFeature extends DefaultFeature {
float deltaZ = Math.abs(pos.z());
if (deltaY < 2.0f && (deltaX < 3.0f || deltaZ < 3.0F)) return 0.0f;
return (float) simplexNoise.eval(CENTER.getX() + pos.x(), CENTER.getY() + pos.y(), CENTER.getZ() + pos.z());
}).setSource(sdfCone).setReplaceFunction(state -> BlocksHelper.isFluid(state) || state.getMaterial().isReplaceable());
})
.setSource(sdfCone)
.setReplaceFunction(state -> BlocksHelper.isFluid(state) || state.getMaterial()
.isReplaceable());
return sdfCone;
}

View file

@ -18,7 +18,10 @@ public class BlueVineFeature extends ScatterFeature {
@Override
public boolean canGenerate(WorldGenLevel world, Random random, BlockPos center, BlockPos blockPos, float radius) {
float d = MHelper.length(center.getX() - blockPos.getX(), center.getZ() - blockPos.getZ()) / radius * 0.6F + random.nextFloat() * 0.4F;
float d = MHelper.length(
center.getX() - blockPos.getX(),
center.getZ() - blockPos.getZ()
) / radius * 0.6F + random.nextFloat() * 0.4F;
small = d > 0.5F;
return EndBlocks.BLUE_VINE_SEED.canSurvive(AIR, world, blockPos);
}
@ -26,7 +29,11 @@ public class BlueVineFeature extends ScatterFeature {
@Override
public void generate(WorldGenLevel world, Random random, BlockPos blockPos) {
if (small) {
BlocksHelper.setWithoutUpdate(world, blockPos, EndBlocks.BLUE_VINE_SEED.defaultBlockState().setValue(EndPlantWithAgeBlock.AGE, random.nextInt(4)));
BlocksHelper.setWithoutUpdate(
world,
blockPos,
EndBlocks.BLUE_VINE_SEED.defaultBlockState().setValue(EndPlantWithAgeBlock.AGE, random.nextInt(4))
);
}
else {
EndPlantWithAgeBlock seed = ((EndPlantWithAgeBlock) EndBlocks.BLUE_VINE_SEED);

View file

@ -18,14 +18,23 @@ public class CavePumpkinFeature extends DefaultFeature {
final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.above()).is(TagAPI.GEN_TERRAIN) || !world.isEmptyBlock(pos) || !world.isEmptyBlock(pos.below())) {
if (!world.getBlockState(pos.above()).is(TagAPI.GEN_TERRAIN) || !world.isEmptyBlock(pos) || !world.isEmptyBlock(
pos.below())) {
return false;
}
int age = random.nextInt(4);
BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.CAVE_PUMPKIN_SEED.defaultBlockState().setValue(EndBlockProperties.AGE, age));
BlocksHelper.setWithoutUpdate(
world,
pos,
EndBlocks.CAVE_PUMPKIN_SEED.defaultBlockState().setValue(EndBlockProperties.AGE, age)
);
if (age > 1) {
BlocksHelper.setWithoutUpdate(world, pos.below(), EndBlocks.CAVE_PUMPKIN.defaultBlockState().setValue(EndBlockProperties.SMALL, age < 3));
BlocksHelper.setWithoutUpdate(
world,
pos.below(),
EndBlocks.CAVE_PUMPKIN.defaultBlockState().setValue(EndBlockProperties.SMALL, age < 3)
);
}
return true;

View file

@ -90,7 +90,12 @@ public class CrashedShipFeature extends NBTStructureFeature {
StructureTemplate structure = getStructure(world, center, random);
Rotation rotation = getRotation(world, center, random);
Mirror mirror = getMirror(world, center, random);
BlockPos offset = StructureTemplate.transform(new BlockPos(structure.getSize()), mirror, rotation, BlockPos.ZERO);
BlockPos offset = StructureTemplate.transform(
new BlockPos(structure.getSize()),
mirror,
rotation,
BlockPos.ZERO
);
center = center.offset(0, getYOffset(structure, world, center, random) + 0.5, 0);
StructurePlaceSettings placementData = new StructurePlaceSettings().setRotation(rotation).setMirror(mirror);
center = center.offset(-offset.getX() * 0.5, 0, -offset.getZ() * 0.5);
@ -102,7 +107,11 @@ public class CrashedShipFeature extends NBTStructureFeature {
structure.placeInWorld(world, center, center, placementData.setBoundingBox(bounds), random, 2);
StructureHelper.erodeIntense(world, bounds, random);
BlockFixer.fixBlocks(world, new BlockPos(bounds.minX(), bounds.minY(), bounds.minZ()), new BlockPos(bounds.maxX(), bounds.maxY(), bounds.maxZ()));
BlockFixer.fixBlocks(
world,
new BlockPos(bounds.minX(), bounds.minY(), bounds.minZ()),
new BlockPos(bounds.maxX(), bounds.maxY(), bounds.maxZ())
);
return true;
}

View file

@ -23,7 +23,10 @@ public class DoublePlantFeature extends ScatterFeature {
@Override
public boolean canGenerate(WorldGenLevel world, Random random, BlockPos center, BlockPos blockPos, float radius) {
float d = MHelper.length(center.getX() - blockPos.getX(), center.getZ() - blockPos.getZ()) / radius * 0.6F + random.nextFloat() * 0.4F;
float d = MHelper.length(
center.getX() - blockPos.getX(),
center.getZ() - blockPos.getZ()
) / radius * 0.6F + random.nextFloat() * 0.4F;
plant = d < 0.5F ? largePlant : smallPlant;
return plant.canSurvive(plant.defaultBlockState(), world, blockPos);
}

View file

@ -40,12 +40,22 @@ public class EndLotusLeafFeature extends ScatterFeature {
BlockState leaf = EndBlocks.END_LOTUS_LEAF.defaultBlockState();
BlocksHelper.setWithoutUpdate(world, pos, leaf.setValue(EndLotusLeafBlock.SHAPE, TripleShape.BOTTOM));
for (Direction move : BlocksHelper.HORIZONTAL) {
BlocksHelper.setWithoutUpdate(world, p.set(pos).move(move), leaf.setValue(EndLotusLeafBlock.HORIZONTAL_FACING, move).setValue(EndLotusLeafBlock.SHAPE, TripleShape.MIDDLE));
BlocksHelper.setWithoutUpdate(
world,
p.set(pos).move(move),
leaf.setValue(EndLotusLeafBlock.HORIZONTAL_FACING, move)
.setValue(EndLotusLeafBlock.SHAPE, TripleShape.MIDDLE)
);
}
for (int i = 0; i < 4; i++) {
Direction d1 = BlocksHelper.HORIZONTAL[i];
Direction d2 = BlocksHelper.HORIZONTAL[(i + 1) & 3];
BlocksHelper.setWithoutUpdate(world, p.set(pos).move(d1).move(d2), leaf.setValue(EndLotusLeafBlock.HORIZONTAL_FACING, d1).setValue(EndLotusLeafBlock.SHAPE, TripleShape.TOP));
BlocksHelper.setWithoutUpdate(
world,
p.set(pos).move(d1).move(d2),
leaf.setValue(EndLotusLeafBlock.HORIZONTAL_FACING, d1)
.setValue(EndLotusLeafBlock.SHAPE, TripleShape.TOP)
);
}
}

View file

@ -23,9 +23,17 @@ public class FilaluxFeature extends SkyScatterFeature {
BlockState vine = EndBlocks.FILALUX.defaultBlockState();
BlockState wings = EndBlocks.FILALUX_WINGS.defaultBlockState();
BlocksHelper.setWithoutUpdate(world, blockPos, EndBlocks.FILALUX_LANTERN);
BlocksHelper.setWithoutUpdate(world, blockPos.above(), wings.setValue(BlockStateProperties.FACING, Direction.UP));
BlocksHelper.setWithoutUpdate(
world,
blockPos.above(),
wings.setValue(BlockStateProperties.FACING, Direction.UP)
);
for (Direction dir : BlocksHelper.HORIZONTAL) {
BlocksHelper.setWithoutUpdate(world, blockPos.relative(dir), wings.setValue(BlockStateProperties.FACING, dir));
BlocksHelper.setWithoutUpdate(
world,
blockPos.relative(dir),
wings.setValue(BlockStateProperties.FACING, dir)
);
}
int length = MHelper.randRange(1, 3, random);
for (int i = 1; i <= length; i++) {

View file

@ -75,7 +75,13 @@ public abstract class ScatterFeature extends DefaultFeature {
float z = pr * (float) Math.sin(theta);
POS.set(center.getX() + x, center.getY() + getYOffset(), center.getZ() + z);
if (getGroundPlant(world, POS) && canGenerate(world, random, center, POS, r) && (getChance() < 2 || random.nextInt(getChance()) == 0)) {
if (getGroundPlant(world, POS) && canGenerate(
world,
random,
center,
POS,
r
) && (getChance() < 2 || random.nextInt(getChance()) == 0)) {
generate(world, random, POS);
}
}

View file

@ -45,9 +45,19 @@ public class SilkMothNestFeature extends DefaultFeature {
POS.setY(y);
if (canGenerate(world, POS)) {
Direction dir = BlocksHelper.randomHorizontal(random);
BlocksHelper.setWithoutUpdate(world, POS, EndBlocks.SILK_MOTH_NEST.defaultBlockState().setValue(BlockStateProperties.HORIZONTAL_FACING, dir).setValue(BlockProperties.ACTIVE, false));
BlocksHelper.setWithoutUpdate(
world,
POS,
EndBlocks.SILK_MOTH_NEST.defaultBlockState()
.setValue(BlockStateProperties.HORIZONTAL_FACING, dir)
.setValue(BlockProperties.ACTIVE, false)
);
POS.setY(y - 1);
BlocksHelper.setWithoutUpdate(world, POS, EndBlocks.SILK_MOTH_NEST.defaultBlockState().setValue(BlockStateProperties.HORIZONTAL_FACING, dir));
BlocksHelper.setWithoutUpdate(
world,
POS,
EndBlocks.SILK_MOTH_NEST.defaultBlockState().setValue(BlockStateProperties.HORIZONTAL_FACING, dir)
);
return true;
}
}

View file

@ -39,7 +39,8 @@ public class BushFeature extends DefaultFeature {
final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND) && !world.getBlockState(pos.above()).is(TagAPI.END_GROUND))
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND) && !world.getBlockState(pos.above())
.is(TagAPI.END_GROUND))
return false;
float radius = MHelper.randRange(1.8F, 3.5F, random);
@ -52,7 +53,8 @@ public class BushFeature extends DefaultFeature {
sphere = new SDFDisplacement().setFunction((vec) -> {
return MHelper.randRange(-2F, 2F, random);
}).setSource(sphere);
sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere));
sphere = new SDFSubtraction().setSourceA(sphere)
.setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere));
sphere.setReplaceFunction(REPLACE);
sphere.addPostProcess((info) -> {
if (info.getState().getBlock() instanceof LeavesBlock) {
@ -72,7 +74,11 @@ public class BushFeature extends DefaultFeature {
BlockPos p = pos.relative(d);
if (world.isEmptyBlock(p)) {
if (leaves instanceof LeavesBlock) {
BlocksHelper.setWithoutUpdate(world, p, leaves.defaultBlockState().setValue(LeavesBlock.DISTANCE, 1));
BlocksHelper.setWithoutUpdate(
world,
p,
leaves.defaultBlockState().setValue(LeavesBlock.DISTANCE, 1)
);
}
else {
BlocksHelper.setWithoutUpdate(world, p, leaves.defaultBlockState());

View file

@ -43,7 +43,8 @@ public class BushWithOuterFeature extends DefaultFeature {
final Random random = featureConfig.random();
final BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level();
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND) && !world.getBlockState(pos.above()).is(TagAPI.END_GROUND))
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND) && !world.getBlockState(pos.above())
.is(TagAPI.END_GROUND))
return false;
float radius = MHelper.randRange(1.8F, 3.5F, random);
@ -56,7 +57,8 @@ public class BushWithOuterFeature extends DefaultFeature {
sphere = new SDFDisplacement().setFunction((vec) -> {
return MHelper.randRange(-2F, 2F, random);
}).setSource(sphere);
sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere));
sphere = new SDFSubtraction().setSourceA(sphere)
.setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere));
sphere.setReplaceFunction(REPLACE);
sphere.addPostProcess((info) -> {
if (info.getState().getBlock() instanceof LeavesBlock) {
@ -74,7 +76,10 @@ public class BushWithOuterFeature extends DefaultFeature {
MHelper.shuffle(DIRECTIONS, random);
for (Direction dir : DIRECTIONS) {
if (info.getState(dir).isAir()) {
info.setBlockPos(info.getPos().relative(dir), outer_leaves.defaultBlockState().setValue(BlockStateProperties.FACING, dir));
info.setBlockPos(
info.getPos().relative(dir),
outer_leaves.defaultBlockState().setValue(BlockStateProperties.FACING, dir)
);
}
}
}
@ -86,7 +91,11 @@ public class BushWithOuterFeature extends DefaultFeature {
BlockPos p = pos.relative(d);
if (world.isEmptyBlock(p)) {
if (leaves instanceof LeavesBlock) {
BlocksHelper.setWithoutUpdate(world, p, leaves.defaultBlockState().setValue(LeavesBlock.DISTANCE, 1));
BlocksHelper.setWithoutUpdate(
world,
p,
leaves.defaultBlockState().setValue(LeavesBlock.DISTANCE, 1)
);
}
else {
BlocksHelper.setWithoutUpdate(world, p, leaves.defaultBlockState());

View file

@ -38,9 +38,17 @@ public class LargeAmaranitaFeature extends DefaultFeature {
BlockState state = EndBlocks.LARGE_AMARANITA_MUSHROOM.defaultBlockState();
BlocksHelper.setWithUpdate(world, mut, state.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM));
if (height > 2) {
BlocksHelper.setWithUpdate(world, mut.move(Direction.UP), state.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE));
BlocksHelper.setWithUpdate(
world,
mut.move(Direction.UP),
state.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE)
);
}
BlocksHelper.setWithUpdate(world, mut.move(Direction.UP), state.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP));
BlocksHelper.setWithUpdate(
world,
mut.move(Direction.UP),
state.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP)
);
return true;
}

View file

@ -34,23 +34,42 @@ public class Lumecorn extends DefaultFeature {
}
}
mut.set(pos);
BlockState topMiddle = EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.LIGHT_TOP_MIDDLE);
BlockState middle = EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.LIGHT_MIDDLE);
BlockState bottom = EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.LIGHT_BOTTOM);
BlockState topMiddle = EndBlocks.LUMECORN.defaultBlockState()
.setValue(LumecornBlock.SHAPE, LumecornShape.LIGHT_TOP_MIDDLE);
BlockState middle = EndBlocks.LUMECORN.defaultBlockState()
.setValue(LumecornBlock.SHAPE, LumecornShape.LIGHT_MIDDLE);
BlockState bottom = EndBlocks.LUMECORN.defaultBlockState()
.setValue(LumecornBlock.SHAPE, LumecornShape.LIGHT_BOTTOM);
BlockState top = EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.LIGHT_TOP);
if (height == 4) {
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.BOTTOM_SMALL));
BlocksHelper.setWithoutUpdate(
world,
mut,
EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.BOTTOM_SMALL)
);
BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), bottom);
BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), topMiddle);
BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), top);
return true;
}
if (random.nextBoolean()) {
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.BOTTOM_SMALL));
BlocksHelper.setWithoutUpdate(
world,
mut,
EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.BOTTOM_SMALL)
);
}
else {
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.BOTTOM_BIG));
BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.MIDDLE));
BlocksHelper.setWithoutUpdate(
world,
mut,
EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.BOTTOM_BIG)
);
BlocksHelper.setWithoutUpdate(
world,
mut.move(Direction.UP),
EndBlocks.LUMECORN.defaultBlockState().setValue(LumecornBlock.SHAPE, LumecornShape.MIDDLE)
);
height--;
}
BlocksHelper.setWithoutUpdate(world, mut.move(Direction.UP), bottom);

View file

@ -49,9 +49,14 @@ public class TenaneaBushFeature extends DefaultFeature {
BlockState leaves = EndBlocks.TENANEA_LEAVES.defaultBlockState();
SDF sphere = new SDFSphere().setRadius(radius).setBlock(leaves);
sphere = new SDFScale3D().setScale(1, 0.75F, 1).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> (float) noise.eval(vec.x() * 0.2, vec.y() * 0.2, vec.z() * 0.2) * 3).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> (float) noise.eval(
vec.x() * 0.2,
vec.y() * 0.2,
vec.z() * 0.2
) * 3).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> MHelper.randRange(-2F, 2F, random)).setSource(sphere);
sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere));
sphere = new SDFSubtraction().setSourceA(sphere)
.setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere));
sphere.setReplaceFunction(REPLACE);
List<BlockPos> support = Lists.newArrayList();
sphere.addPostProcess((info) -> {
@ -66,7 +71,10 @@ public class TenaneaBushFeature extends DefaultFeature {
MHelper.shuffle(DIRECTIONS, random);
for (Direction d : DIRECTIONS) {
if (info.getState(d).isAir()) {
info.setBlockPos(info.getPos().relative(d), EndBlocks.TENANEA_OUTER_LEAVES.defaultBlockState().setValue(FurBlock.FACING, d));
info.setBlockPos(
info.getPos().relative(d),
EndBlocks.TENANEA_OUTER_LEAVES.defaultBlockState().setValue(FurBlock.FACING, d)
);
}
}
@ -89,9 +97,12 @@ public class TenaneaBushFeature extends DefaultFeature {
}
MutableBlockPos mut = new MutableBlockPos();
BlockState top = EndBlocks.TENANEA_FLOWERS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP);
BlockState middle = EndBlocks.TENANEA_FLOWERS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE);
BlockState bottom = EndBlocks.TENANEA_FLOWERS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM);
BlockState top = EndBlocks.TENANEA_FLOWERS.defaultBlockState()
.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP);
BlockState middle = EndBlocks.TENANEA_FLOWERS.defaultBlockState()
.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE);
BlockState bottom = EndBlocks.TENANEA_FLOWERS.defaultBlockState()
.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM);
support.forEach((bpos) -> {
BlockState state = world.getBlockState(bpos);
if (state.isAir() || state.is(EndBlocks.TENANEA_OUTER_LEAVES)) {

View file

@ -34,11 +34,16 @@ public class BigAuroraCrystalFeature extends DefaultFeature {
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);
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.is(TagAPI.GEN_TERRAIN) || bState.getMaterial().equals(Material.PLANT) || bState.getMaterial().equals(Material.LEAVES);
return bState.getMaterial().isReplaceable() || bState.is(TagAPI.GEN_TERRAIN) || bState.getMaterial()
.equals(Material.PLANT) || bState
.getMaterial()
.equals(Material.LEAVES);
});
prism.fillRecursive(world, pos);
BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.AURORA_CRYSTAL);

View file

@ -109,7 +109,11 @@ public class DesertLakeFeature extends DefaultFeature {
size *= 0.8;
add = 5;
}
double r = (add * 1.8 + radius * (NOISE.eval(x * 0.2, y * 0.2, z * 0.2) * 0.25 + 0.75)) - 1.0 / size;
double r = (add * 1.8 + radius * (NOISE.eval(
x * 0.2,
y * 0.2,
z * 0.2
) * 0.25 + 0.75)) - 1.0 / size;
if (r > 0) {
r *= r;
if (x2 + z2 <= r) {
@ -119,12 +123,23 @@ public class DesertLakeFeature extends DefaultFeature {
}
pos = POS.below();
if (world.getBlockState(pos).is(TagAPI.GEN_TERRAIN)) {
state = world.getBiome(pos).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
state = world.getBiome(pos)
.getGenerationSettings()
.getSurfaceBuilderConfig()
.getTopMaterial();
if (y > waterLevel + 1) BlocksHelper.setWithoutUpdate(world, pos, state);
else if (y > waterLevel)
BlocksHelper.setWithoutUpdate(world, pos, random.nextBoolean() ? state : EndBlocks.ENDSTONE_DUST.defaultBlockState());
BlocksHelper.setWithoutUpdate(
world,
pos,
random.nextBoolean() ? state : EndBlocks.ENDSTONE_DUST.defaultBlockState()
);
else
BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.ENDSTONE_DUST.defaultBlockState());
BlocksHelper.setWithoutUpdate(
world,
pos,
EndBlocks.ENDSTONE_DUST.defaultBlockState()
);
}
}
}
@ -169,7 +184,8 @@ public class DesertLakeFeature extends DefaultFeature {
BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.ENDSTONE_DUST.defaultBlockState());
}
pos = POS.above();
while (canReplace(state = world.getBlockState(pos)) && !state.isAir() && state.getFluidState().isEmpty()) {
while (canReplace(state = world.getBlockState(pos)) && !state.isAir() && state.getFluidState()
.isEmpty()) {
BlocksHelper.setWithoutUpdate(world, pos, pos.getY() < waterLevel ? WATER : AIR);
pos = pos.above();
}
@ -182,12 +198,23 @@ public class DesertLakeFeature extends DefaultFeature {
}
else if (y < waterLevel) {
if (world.isEmptyBlock(POS.above())) {
state = world.getBiome(POS).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
BlocksHelper.setWithoutUpdate(world, POS, random.nextBoolean() ? state : EndBlocks.ENDSTONE_DUST.defaultBlockState());
state = world.getBiome(POS)
.getGenerationSettings()
.getSurfaceBuilderConfig()
.getTopMaterial();
BlocksHelper.setWithoutUpdate(
world,
POS,
random.nextBoolean() ? state : EndBlocks.ENDSTONE_DUST.defaultBlockState()
);
BlocksHelper.setWithoutUpdate(world, POS.below(), END_STONE);
}
else {
BlocksHelper.setWithoutUpdate(world, POS, EndBlocks.ENDSTONE_DUST.defaultBlockState());
BlocksHelper.setWithoutUpdate(
world,
POS,
EndBlocks.ENDSTONE_DUST.defaultBlockState()
);
BlocksHelper.setWithoutUpdate(world, POS.below(), END_STONE);
}
}
@ -197,12 +224,21 @@ public class DesertLakeFeature extends DefaultFeature {
}
}
BlockFixer.fixBlocks(world, new BlockPos(minX - 2, waterLevel - 2, minZ - 2), new BlockPos(maxX + 2, blockPos.getY() + 20, maxZ + 2));
BlockFixer.fixBlocks(
world,
new BlockPos(minX - 2, waterLevel - 2, minZ - 2),
new BlockPos(maxX + 2, blockPos.getY() + 20, maxZ + 2)
);
return true;
}
private boolean canReplace(BlockState state) {
return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.is(EndBlocks.ENDSTONE_DUST) || state.getMaterial().equals(Material.PLANT) || state.getMaterial().equals(Material.WATER_PLANT);
return state.getMaterial()
.isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.is(EndBlocks.ENDSTONE_DUST) || state.getMaterial()
.equals(
Material.PLANT) || state
.getMaterial()
.equals(Material.WATER_PLANT);
}
}

View file

@ -109,7 +109,11 @@ public class EndLakeFeature extends DefaultFeature {
size *= 0.8;
add = 5;
}
double r = (add * 1.8 + radius * (NOISE.eval(x * 0.2, y * 0.2, z * 0.2) * 0.25 + 0.75)) - 1.0 / size;
double r = (add * 1.8 + radius * (NOISE.eval(
x * 0.2,
y * 0.2,
z * 0.2
) * 0.25 + 0.75)) - 1.0 / size;
if (r > 0) {
r *= r;
if (x2 + z2 <= r) {
@ -119,12 +123,23 @@ public class EndLakeFeature extends DefaultFeature {
}
pos = POS.below();
if (world.getBlockState(pos).is(TagAPI.GEN_TERRAIN)) {
state = world.getBiome(pos).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
state = world.getBiome(pos)
.getGenerationSettings()
.getSurfaceBuilderConfig()
.getTopMaterial();
if (y > waterLevel + 1) BlocksHelper.setWithoutUpdate(world, pos, state);
else if (y > waterLevel)
BlocksHelper.setWithoutUpdate(world, pos, random.nextBoolean() ? state : EndBlocks.ENDSTONE_DUST.defaultBlockState());
BlocksHelper.setWithoutUpdate(
world,
pos,
random.nextBoolean() ? state : EndBlocks.ENDSTONE_DUST.defaultBlockState()
);
else
BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.ENDSTONE_DUST.defaultBlockState());
BlocksHelper.setWithoutUpdate(
world,
pos,
EndBlocks.ENDSTONE_DUST.defaultBlockState()
);
}
}
}
@ -169,7 +184,8 @@ public class EndLakeFeature extends DefaultFeature {
BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.ENDSTONE_DUST.defaultBlockState());
}
pos = POS.above();
while (canReplace(state = world.getBlockState(pos)) && !state.isAir() && state.getFluidState().isEmpty()) {
while (canReplace(state = world.getBlockState(pos)) && !state.isAir() && state.getFluidState()
.isEmpty()) {
BlocksHelper.setWithoutUpdate(world, pos, pos.getY() < waterLevel ? WATER : AIR);
pos = pos.above();
}
@ -177,8 +193,15 @@ public class EndLakeFeature extends DefaultFeature {
// Make border
else if (y < waterLevel && y2 + x2 + z2 <= rb) {
if (world.isEmptyBlock(POS.above())) {
state = world.getBiome(POS).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
BlocksHelper.setWithoutUpdate(world, POS, random.nextBoolean() ? state : EndBlocks.ENDSTONE_DUST.defaultBlockState());
state = world.getBiome(POS)
.getGenerationSettings()
.getSurfaceBuilderConfig()
.getTopMaterial();
BlocksHelper.setWithoutUpdate(
world,
POS,
random.nextBoolean() ? state : EndBlocks.ENDSTONE_DUST.defaultBlockState()
);
BlocksHelper.setWithoutUpdate(world, POS.below(), END_STONE);
}
else {
@ -191,12 +214,21 @@ public class EndLakeFeature extends DefaultFeature {
}
}
BlockFixer.fixBlocks(world, new BlockPos(minX - 2, waterLevel - 2, minZ - 2), new BlockPos(maxX + 2, blockPos.getY() + 20, maxZ + 2));
BlockFixer.fixBlocks(
world,
new BlockPos(minX - 2, waterLevel - 2, minZ - 2),
new BlockPos(maxX + 2, blockPos.getY() + 20, maxZ + 2)
);
return true;
}
private boolean canReplace(BlockState state) {
return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.is(EndBlocks.ENDSTONE_DUST) || state.getMaterial().equals(Material.PLANT) || state.getMaterial().equals(Material.WATER_PLANT);
return state.getMaterial()
.isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.is(EndBlocks.ENDSTONE_DUST) || state.getMaterial()
.equals(
Material.PLANT) || state
.getMaterial()
.equals(Material.WATER_PLANT);
}
}

View file

@ -27,14 +27,20 @@ public class FallenPillarFeature extends DefaultFeature {
final Random random = featureConfig.random();
BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level();
pos = getPosOnSurface(world, new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16)));
pos = getPosOnSurface(
world,
new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16))
);
if (!world.getBlockState(pos.below(5)).is(TagAPI.GEN_TERRAIN)) {
return false;
}
float height = MHelper.randRange(20F, 40F, random);
float radius = MHelper.randRange(2F, 4F, random);
SDF pillar = new SDFCappedCone().setRadius1(radius).setRadius2(radius).setHeight(height * 0.5F).setBlock(Blocks.OBSIDIAN);
SDF pillar = new SDFCappedCone().setRadius1(radius)
.setRadius2(radius)
.setHeight(height * 0.5F)
.setBlock(Blocks.OBSIDIAN);
pillar = new SDFTranslate().setTranslate(0, radius * 0.5F - 2, 0).setSource(pillar);
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong());
pillar = new SDFDisplacement().setFunction((vec) -> {
@ -51,7 +57,8 @@ public class FallenPillarFeature extends DefaultFeature {
}
return info.getState();
}).setReplaceFunction((state) -> {
return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.getMaterial().equals(Material.PLANT);
return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.getMaterial()
.equals(Material.PLANT);
}).fillRecursive(world, pos);
return true;

View file

@ -28,7 +28,11 @@ public class FloatingSpireFeature extends SpireFeature {
final WorldGenLevel world = featureConfig.level();
final ChunkGenerator chunkGenerator = featureConfig.chunkGenerator();
int minY = getYOnSurface(world, pos.getX(), pos.getZ());
int y = minY > 57 ? MHelper.floor(MHelper.randRange(minY, minY * 2, random) * 0.5F + 32) : MHelper.randRange(64, 192, random);
int y = minY > 57 ? MHelper.floor(MHelper.randRange(minY, minY * 2, random) * 0.5F + 32) : MHelper.randRange(
64,
192,
random
);
pos = new BlockPos(pos.getX(), y, pos.getZ());
SDF sdf = new SDFSphere().setRadius(MHelper.randRange(2, 3, random)).setBlock(Blocks.END_STONE);
@ -45,7 +49,11 @@ public class FloatingSpireFeature extends SpireFeature {
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong());
sdf = new SDFDisplacement().setFunction((vec) -> {
return (float) (Math.abs(noise.eval(vec.x() * 0.1, vec.y() * 0.1, vec.z() * 0.1)) * 3F + Math.abs(noise.eval(vec.x() * 0.3, vec.y() * 0.3 + 100, vec.z() * 0.3)) * 1.3F);
return (float) (Math.abs(noise.eval(
vec.x() * 0.1,
vec.y() * 0.1,
vec.z() * 0.1
)) * 3F + Math.abs(noise.eval(vec.x() * 0.3, vec.y() * 0.3 + 100, vec.z() * 0.3)) * 1.3F);
}).setSource(sdf);
final BlockPos center = pos;
List<BlockPos> support = Lists.newArrayList();
@ -57,7 +65,10 @@ public class FloatingSpireFeature extends SpireFeature {
return world.getBiome(info.getPos()).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
}
else if (info.getState(Direction.UP, 3).isAir()) {
return world.getBiome(info.getPos()).getGenerationSettings().getSurfaceBuilderConfig().getUnderMaterial();
return world.getBiome(info.getPos())
.getGenerationSettings()
.getSurfaceBuilderConfig()
.getUnderMaterial();
}
return info.getState();
});
@ -65,7 +76,8 @@ public class FloatingSpireFeature extends SpireFeature {
support.forEach((bpos) -> {
if (BiomeAPI.getFromBiome(world.getBiome(bpos)) == EndBiomes.BLOSSOMING_SPIRES) {
EndFeatures.TENANEA_BUSH.getFeature().place(new FeaturePlaceContext<>(world, chunkGenerator, random, bpos, null));
EndFeatures.TENANEA_BUSH.getFeature()
.place(new FeaturePlaceContext<>(world, chunkGenerator, random, bpos, null));
}
});

View file

@ -72,7 +72,10 @@ public class GeyserFeature extends DefaultFeature {
int halfHeight = MHelper.randRange(10, 20, random);
float radius1 = halfHeight * 0.5F;
float radius2 = halfHeight * 0.1F + 0.5F;
SDF sdf = new SDFCappedCone().setHeight(halfHeight).setRadius1(radius1).setRadius2(radius2).setBlock(EndBlocks.SULPHURIC_ROCK.stone);
SDF sdf = new SDFCappedCone().setHeight(halfHeight)
.setRadius1(radius1)
.setRadius2(radius2)
.setBlock(EndBlocks.SULPHURIC_ROCK.stone);
sdf = new SDFTranslate().setTranslate(0, halfHeight - 3, 0).setSource(sdf);
int count = halfHeight;
@ -81,9 +84,15 @@ public class GeyserFeature extends DefaultFeature {
float delta = (float) i / (float) (count - 1);
float radius = Mth.lerp(delta, radius1, radius2) * 1.3F;
SDF bowl = new SDFCappedCone().setHeight(radius).setRadius1(0).setRadius2(radius).setBlock(EndBlocks.SULPHURIC_ROCK.stone);
SDF bowl = new SDFCappedCone().setHeight(radius)
.setRadius1(0)
.setRadius2(radius)
.setBlock(EndBlocks.SULPHURIC_ROCK.stone);
SDF brimstone = new SDFCappedCone().setHeight(radius).setRadius1(0).setRadius2(radius).setBlock(EndBlocks.BRIMSTONE);
SDF brimstone = new SDFCappedCone().setHeight(radius)
.setRadius1(0)
.setRadius2(radius)
.setBlock(EndBlocks.BRIMSTONE);
brimstone = new SDFTranslate().setTranslate(0, 2F, 0).setSource(brimstone);
bowl = new SDFSubtraction().setSourceA(bowl).setSourceB(brimstone);
bowl = new SDFUnion().setSourceA(brimstone).setSourceB(bowl);
@ -172,7 +181,11 @@ public class GeyserFeature extends DefaultFeature {
}
for (int i = 0; i < 150; i++) {
mut.set(pos).move(MHelper.floor(random.nextGaussian() * 4 + 0.5), -halfHeight - 10, MHelper.floor(random.nextGaussian() * 4 + 0.5));
mut.set(pos)
.move(MHelper.floor(random.nextGaussian() * 4 + 0.5),
-halfHeight - 10,
MHelper.floor(random.nextGaussian() * 4 + 0.5)
);
float distRaw = MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ());
int dist = MHelper.floor(6 - distRaw) + random.nextInt(2);
if (dist >= 0) {
@ -188,12 +201,18 @@ public class GeyserFeature extends DefaultFeature {
for (Direction dir : HORIZONTAL) {
BlockPos p = mut.relative(dir);
if (random.nextBoolean() && world.getBlockState(p).is(Blocks.WATER)) {
BlocksHelper.setWithoutUpdate(world, p, EndBlocks.TUBE_WORM.defaultBlockState().setValue(HorizontalDirectionalBlock.FACING, dir));
BlocksHelper.setWithoutUpdate(
world,
p,
EndBlocks.TUBE_WORM.defaultBlockState()
.setValue(HorizontalDirectionalBlock.FACING, dir)
);
}
}
mut.setY(mut.getY() + 1);
}
state = EndBlocks.HYDROTHERMAL_VENT.defaultBlockState().setValue(HydrothermalVentBlock.ACTIVATED, distRaw < 2);
state = EndBlocks.HYDROTHERMAL_VENT.defaultBlockState()
.setValue(HydrothermalVentBlock.ACTIVATED, distRaw < 2);
BlocksHelper.setWithoutUpdate(world, mut, state);
mut.setY(mut.getY() + 1);
state = world.getBlockState(mut);
@ -207,7 +226,11 @@ public class GeyserFeature extends DefaultFeature {
}
for (int i = 0; i < 10; i++) {
mut.set(pos).move(MHelper.floor(random.nextGaussian() * 0.7 + 0.5), -halfHeight - 10, MHelper.floor(random.nextGaussian() * 0.7 + 0.5));
mut.set(pos)
.move(MHelper.floor(random.nextGaussian() * 0.7 + 0.5),
-halfHeight - 10,
MHelper.floor(random.nextGaussian() * 0.7 + 0.5)
);
float distRaw = MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ());
int dist = MHelper.floor(6 - distRaw) + random.nextInt(2);
if (dist >= 0) {
@ -221,7 +244,8 @@ public class GeyserFeature extends DefaultFeature {
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone);
mut.setY(mut.getY() + 1);
}
state = EndBlocks.HYDROTHERMAL_VENT.defaultBlockState().setValue(HydrothermalVentBlock.ACTIVATED, distRaw < 2);
state = EndBlocks.HYDROTHERMAL_VENT.defaultBlockState()
.setValue(HydrothermalVentBlock.ACTIVATED, distRaw < 2);
BlocksHelper.setWithoutUpdate(world, mut, state);
mut.setY(mut.getY() + 1);
state = world.getBlockState(mut);
@ -234,7 +258,8 @@ public class GeyserFeature extends DefaultFeature {
}
}
EndFeatures.SULPHURIC_LAKE.getFeature().place(new FeaturePlaceContext<>(world, chunkGenerator, random, pos, null));
EndFeatures.SULPHURIC_LAKE.getFeature()
.place(new FeaturePlaceContext<>(world, chunkGenerator, random, pos, null));
double distance = radius1 * 1.7;
BlockPos start = pos.offset(-distance, -halfHeight - 15 - distance, -distance);
@ -260,7 +285,8 @@ public class GeyserFeature extends DefaultFeature {
};
IGNORE = (state) -> {
return state.is(Blocks.WATER) || state.is(Blocks.CAVE_AIR) || state.is(EndBlocks.SULPHURIC_ROCK.stone) || state.is(EndBlocks.BRIMSTONE);
return state.is(Blocks.WATER) || state.is(Blocks.CAVE_AIR) || state.is(EndBlocks.SULPHURIC_ROCK.stone) || state
.is(EndBlocks.BRIMSTONE);
};
}
}

View file

@ -41,7 +41,10 @@ public class IceStarFeature extends DefaultFeature {
int count = MHelper.randRange(minCount, maxCount, random);
List<Vector3f> points = getFibonacciPoints(count);
SDF sdf = null;
SDF spike = new SDFCappedCone().setRadius1(3 + (size - 5) * 0.2F).setRadius2(0).setHeight(size).setBlock(EndBlocks.DENSE_SNOW);
SDF spike = new SDFCappedCone().setRadius1(3 + (size - 5) * 0.2F)
.setRadius2(0)
.setHeight(size)
.setBlock(EndBlocks.DENSE_SNOW);
spike = new SDFTranslate().setTranslate(0, size - 0.5F, 0).setSource(spike);
for (Vector3f point : points) {
SDF rotated = spike;
@ -77,7 +80,11 @@ public class IceStarFeature extends DefaultFeature {
float px = bpos.getX() - center.getX();
float py = bpos.getY() - center.getY();
float pz = bpos.getZ() - center.getZ();
float distance = MHelper.length(px, py, pz) + sdfCopy.getDistance(px, py, pz) * 0.4F + random.nextFloat() * randScale;
float distance = MHelper.length(px, py, pz) + sdfCopy.getDistance(
px,
py,
pz
) * 0.4F + random.nextFloat() * randScale;
if (distance < ancientRadius) {
return ancient;
}

View file

@ -25,14 +25,20 @@ public class ObsidianBoulderFeature extends DefaultFeature {
final Random random = featureConfig.random();
BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level();
pos = getPosOnSurface(world, new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16)));
pos = getPosOnSurface(
world,
new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16))
);
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) {
return false;
}
int count = MHelper.randRange(1, 5, random);
for (int i = 0; i < count; i++) {
BlockPos p = getPosOnSurface(world, new BlockPos(pos.getX() + random.nextInt(16) - 8, pos.getY(), pos.getZ() + random.nextInt(16) - 8));
BlockPos p = getPosOnSurface(
world,
new BlockPos(pos.getX() + random.nextInt(16) - 8, pos.getY(), pos.getZ() + random.nextInt(16) - 8)
);
makeBoulder(world, p, random);
}
@ -62,7 +68,8 @@ public class ObsidianBoulderFeature extends DefaultFeature {
}
return info.getState();
}).setReplaceFunction((state) -> {
return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.getMaterial().equals(Material.PLANT);
return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.getMaterial()
.equals(Material.PLANT);
}).fillRecursive(world, pos);
}
}

View file

@ -29,14 +29,20 @@ public class ObsidianPillarBasementFeature extends DefaultFeature {
final Random random = featureConfig.random();
BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level();
pos = getPosOnSurface(world, new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16)));
pos = getPosOnSurface(
world,
new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16))
);
if (!world.getBlockState(pos.below(5)).is(TagAPI.GEN_TERRAIN)) {
return false;
}
float height = MHelper.randRange(10F, 35F, random);
float radius = MHelper.randRange(2F, 5F, random);
SDF pillar = new SDFCappedCone().setRadius1(radius).setRadius2(radius).setHeight(height * 0.5F).setBlock(Blocks.OBSIDIAN);
SDF pillar = new SDFCappedCone().setRadius1(radius)
.setRadius2(radius)
.setHeight(height * 0.5F)
.setBlock(Blocks.OBSIDIAN);
pillar = new SDFTranslate().setTranslate(0, height * 0.5F - 3, 0).setSource(pillar);
SDF cut = new SDFFlatland().setBlock(Blocks.OBSIDIAN);
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong());
@ -58,7 +64,8 @@ public class ObsidianPillarBasementFeature extends DefaultFeature {
}
return info.getState();
}).setReplaceFunction((state) -> {
return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.getMaterial().equals(Material.PLANT);
return state.getMaterial().isReplaceable() || state.is(TagAPI.GEN_TERRAIN) || state.getMaterial()
.equals(Material.PLANT);
}).fillRecursive(world, pos);
return true;

View file

@ -30,8 +30,12 @@ public class SmaragdantCrystalFeature extends DefaultFeature {
BlockState crystal = EndBlocks.SMARAGDANT_CRYSTAL.defaultBlockState();
BlockState shard = EndBlocks.SMARAGDANT_CRYSTAL_SHARD.defaultBlockState();
for (int i = 0; i < count; i++) {
mut.set(pos).move(MHelper.floor(random.nextGaussian() * 2 + 0.5), 5, MHelper.floor(random.nextGaussian() * 2 + 0.5));
int dist = MHelper.floor(1.5F - MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ())) + random.nextInt(3);
mut.set(pos)
.move(MHelper.floor(random.nextGaussian() * 2 + 0.5), 5, MHelper.floor(random.nextGaussian() * 2 + 0.5));
int dist = MHelper.floor(1.5F - MHelper.length(
mut.getX() - pos.getX(),
mut.getZ() - pos.getZ()
)) + random.nextInt(3);
if (dist > 0) {
BlockState state = world.getBlockState(mut);
for (int n = 0; n < 10 && state.isAir(); n++) {
@ -44,7 +48,11 @@ public class SmaragdantCrystalFeature extends DefaultFeature {
mut.setY(mut.getY() + 1);
}
boolean waterlogged = !world.getFluidState(mut).isEmpty();
BlocksHelper.setWithoutUpdate(world, mut, shard.setValue(BlockStateProperties.WATERLOGGED, waterlogged));
BlocksHelper.setWithoutUpdate(
world,
mut,
shard.setValue(BlockStateProperties.WATERLOGGED, waterlogged)
);
}
}
}

View file

@ -38,7 +38,9 @@ public class SpireFeature extends DefaultFeature {
final WorldGenLevel world = featureConfig.level();
final ChunkGenerator chunkGenerator = featureConfig.chunkGenerator();
pos = getPosOnSurfaceWG(world, pos);
if (pos.getY() < 10 || !world.getBlockState(pos.below(3)).is(TagAPI.GEN_TERRAIN) || !world.getBlockState(pos.below(6)).is(TagAPI.GEN_TERRAIN)) {
if (pos.getY() < 10 || !world.getBlockState(pos.below(3))
.is(TagAPI.GEN_TERRAIN) || !world.getBlockState(pos.below(6))
.is(TagAPI.GEN_TERRAIN)) {
return false;
}
@ -50,7 +52,11 @@ public class SpireFeature extends DefaultFeature {
}
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong());
sdf = new SDFDisplacement().setFunction((vec) -> {
return (float) (Math.abs(noise.eval(vec.x() * 0.1, vec.y() * 0.1, vec.z() * 0.1)) * 3F + Math.abs(noise.eval(vec.x() * 0.3, vec.y() * 0.3 + 100, vec.z() * 0.3)) * 1.3F);
return (float) (Math.abs(noise.eval(
vec.x() * 0.1,
vec.y() * 0.1,
vec.z() * 0.1
)) * 3F + Math.abs(noise.eval(vec.x() * 0.3, vec.y() * 0.3 + 100, vec.z() * 0.3)) * 1.3F);
}).setSource(sdf);
final BlockPos center = pos;
List<BlockPos> support = Lists.newArrayList();
@ -62,14 +68,18 @@ public class SpireFeature extends DefaultFeature {
return world.getBiome(info.getPos()).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
}
else if (info.getState(Direction.UP, 3).isAir()) {
return world.getBiome(info.getPos()).getGenerationSettings().getSurfaceBuilderConfig().getUnderMaterial();
return world.getBiome(info.getPos())
.getGenerationSettings()
.getSurfaceBuilderConfig()
.getUnderMaterial();
}
return info.getState();
}).fillRecursive(world, center);
support.forEach((bpos) -> {
if (BiomeAPI.getFromBiome(world.getBiome(bpos)) == EndBiomes.BLOSSOMING_SPIRES) {
EndFeatures.TENANEA_BUSH.getFeature().place(new FeaturePlaceContext<>(world, chunkGenerator, random, bpos, null));
EndFeatures.TENANEA_BUSH.getFeature()
.place(new FeaturePlaceContext<>(world, chunkGenerator, random, bpos, null));
}
});
@ -78,7 +88,8 @@ public class SpireFeature extends DefaultFeature {
protected SDF addSegment(SDF sdf, float radius, Random random) {
SDF sphere = new SDFSphere().setRadius(radius).setBlock(Blocks.END_STONE);
SDF offseted = new SDFTranslate().setTranslate(0, radius + random.nextFloat() * 0.25F * radius, 0).setSource(sdf);
SDF offseted = new SDFTranslate().setTranslate(0, radius + random.nextFloat() * 0.25F * radius, 0)
.setSource(sdf);
return new SDFSmoothUnion().setRadius(radius * 0.5F).setSourceA(sphere).setSourceB(offseted);
}

View file

@ -60,8 +60,13 @@ public class StalactiteFeature extends DefaultFeature {
mut.setY(pos.getY() + i * dir);
int size = stalagnate ? Mth.clamp((int) (Mth.abs(i - center) + 1), 1, 7) : height - i - 1;
boolean waterlogged = !world.getFluidState(mut).isEmpty();
BlockState base = block.defaultBlockState().setValue(StalactiteBlock.SIZE, size).setValue(BlockStateProperties.WATERLOGGED, waterlogged);
BlockState state = stalagnate ? base.setValue(StalactiteBlock.IS_FLOOR, dir > 0 ? i < center : i > center) : base.setValue(StalactiteBlock.IS_FLOOR, dir > 0);
BlockState base = block.defaultBlockState()
.setValue(StalactiteBlock.SIZE, size)
.setValue(BlockStateProperties.WATERLOGGED, waterlogged);
BlockState state = stalagnate ? base.setValue(
StalactiteBlock.IS_FLOOR,
dir > 0 ? i < center : i > center
) : base.setValue(StalactiteBlock.IS_FLOOR, dir > 0);
BlocksHelper.setWithoutUpdate(world, mut, state);
}

View file

@ -106,7 +106,11 @@ public class SulphuricCaveFeature extends DefaultFeature {
else if (dist < r2 * r2) {
state = world.getBlockState(mut);
if (state.is(TagAPI.GEN_TERRAIN) || state.is(Blocks.AIR)) {
double v = noise.eval(x * 0.1, y * 0.1, z * 0.1) + noise.eval(x * 0.03, y * 0.03, z * 0.03) * 0.5;
double v = noise.eval(x * 0.1, y * 0.1, z * 0.1) + noise.eval(
x * 0.03,
y * 0.03,
z * 0.03
) * 0.5;
if (v > 0.4) {
brimstone.add(mut.immutable());
}
@ -125,22 +129,35 @@ public class SulphuricCaveFeature extends DefaultFeature {
if (random.nextInt(4) == 0) {
int count = MHelper.randRange(5, 20, random);
for (int i = 0; i < count; i++) {
mut.set(pos).move(MHelper.floor(random.nextGaussian() * 2 + 0.5), 0, MHelper.floor(random.nextGaussian() * 2 + 0.5));
int dist = MHelper.floor(3 - MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ())) + random.nextInt(2);
mut.set(pos)
.move(MHelper.floor(random.nextGaussian() * 2 + 0.5),
0,
MHelper.floor(random.nextGaussian() * 2 + 0.5)
);
int dist = MHelper.floor(3 - MHelper.length(
mut.getX() - pos.getX(),
mut.getZ() - pos.getZ()
)) + random.nextInt(2);
if (dist > 0) {
state = world.getBlockState(mut);
while (!state.getFluidState().isEmpty() || state.getMaterial().equals(Material.WATER_PLANT)) {
mut.setY(mut.getY() - 1);
state = world.getBlockState(mut);
}
if (state.is(TagAPI.GEN_TERRAIN) && !world.getBlockState(mut.above()).is(EndBlocks.HYDROTHERMAL_VENT)) {
if (state.is(TagAPI.GEN_TERRAIN) && !world.getBlockState(mut.above())
.is(EndBlocks.HYDROTHERMAL_VENT)) {
for (int j = 0; j <= dist; j++) {
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.SULPHURIC_ROCK.stone);
MHelper.shuffle(HORIZONTAL, random);
for (Direction dir : HORIZONTAL) {
BlockPos p = mut.relative(dir);
if (random.nextBoolean() && world.getBlockState(p).is(Blocks.WATER)) {
BlocksHelper.setWithoutUpdate(world, p, EndBlocks.TUBE_WORM.defaultBlockState().setValue(HorizontalDirectionalBlock.FACING, dir));
BlocksHelper.setWithoutUpdate(
world,
p,
EndBlocks.TUBE_WORM.defaultBlockState()
.setValue(HorizontalDirectionalBlock.FACING, dir)
);
}
}
mut.setY(mut.getY() + 1);
@ -150,7 +167,8 @@ public class SulphuricCaveFeature extends DefaultFeature {
state = world.getBlockState(mut);
while (state.is(Blocks.WATER)) {
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.VENT_BUBBLE_COLUMN.defaultBlockState());
world.getBlockTicks().scheduleTick(mut, EndBlocks.VENT_BUBBLE_COLUMN, MHelper.randRange(8, 32, random));
world.getBlockTicks()
.scheduleTick(mut, EndBlocks.VENT_BUBBLE_COLUMN, MHelper.randRange(8, 32, random));
mut.setY(mut.getY() + 1);
state = world.getBlockState(mut);
}
@ -165,7 +183,11 @@ public class SulphuricCaveFeature extends DefaultFeature {
}
private boolean isReplaceable(BlockState state) {
return state.is(TagAPI.GEN_TERRAIN) || state.is(EndBlocks.HYDROTHERMAL_VENT) || state.is(EndBlocks.VENT_BUBBLE_COLUMN) || state.is(EndBlocks.SULPHUR_CRYSTAL) || state.getMaterial().isReplaceable() || state.getMaterial().equals(Material.PLANT) || state.getMaterial().equals(Material.WATER_PLANT) || state.getMaterial().equals(Material.LEAVES);
return state.is(TagAPI.GEN_TERRAIN) || state.is(EndBlocks.HYDROTHERMAL_VENT) || state.is(EndBlocks.VENT_BUBBLE_COLUMN) || state
.is(EndBlocks.SULPHUR_CRYSTAL) || state.getMaterial().isReplaceable() || state.getMaterial()
.equals(Material.PLANT) || state
.getMaterial()
.equals(Material.WATER_PLANT) || state.getMaterial().equals(Material.LEAVES);
}
private void placeBrimstone(WorldGenLevel world, BlockPos pos, Random random) {
@ -189,7 +211,10 @@ public class SulphuricCaveFeature extends DefaultFeature {
for (Direction dir : BlocksHelper.DIRECTIONS) {
BlockPos side;
if (random.nextInt(16) == 0 && world.getBlockState((side = pos.relative(dir))).is(Blocks.WATER)) {
BlockState state = EndBlocks.SULPHUR_CRYSTAL.defaultBlockState().setValue(SulphurCrystalBlock.WATERLOGGED, true).setValue(SulphurCrystalBlock.FACING, dir).setValue(SulphurCrystalBlock.AGE, random.nextInt(3));
BlockState state = EndBlocks.SULPHUR_CRYSTAL.defaultBlockState()
.setValue(SulphurCrystalBlock.WATERLOGGED, true)
.setValue(SulphurCrystalBlock.FACING, dir)
.setValue(SulphurCrystalBlock.AGE, random.nextInt(3));
BlocksHelper.setWithoutUpdate(world, side, state);
}
}

View file

@ -166,7 +166,11 @@ public class SulphuricLakeFeature extends DefaultFeature {
private boolean isDeepWater(WorldGenLevel world, BlockPos pos) {
int y = pos.getY() + 1;
for (Direction dir : BlocksHelper.DIRECTIONS) {
if (getYOnSurface(world, pos.getX() + dir.getStepX(), pos.getZ() + dir.getStepZ()) < y || getYOnSurface(world, pos.getX() + dir.getStepX() * 2, pos.getZ() + dir.getStepZ() * 2) < y || getYOnSurface(world, pos.getX() + dir.getStepX() * 3, pos.getZ() + dir.getStepZ() * 3) < y) {
if (getYOnSurface(world, pos.getX() + dir.getStepX(), pos.getZ() + dir.getStepZ()) < y || getYOnSurface(
world,
pos.getX() + dir.getStepX() * 2,
pos.getZ() + dir.getStepZ() * 2
) < y || getYOnSurface(world, pos.getX() + dir.getStepX() * 3, pos.getZ() + dir.getStepZ() * 3) < y) {
return false;
}
}
@ -194,7 +198,10 @@ public class SulphuricLakeFeature extends DefaultFeature {
for (Direction dir : BlocksHelper.DIRECTIONS) {
BlockPos side;
if (random.nextInt(16) == 0 && world.getBlockState((side = pos.relative(dir))).is(Blocks.WATER)) {
BlockState state = EndBlocks.SULPHUR_CRYSTAL.defaultBlockState().setValue(SulphurCrystalBlock.WATERLOGGED, true).setValue(SulphurCrystalBlock.FACING, dir).setValue(SulphurCrystalBlock.AGE, random.nextInt(3));
BlockState state = EndBlocks.SULPHUR_CRYSTAL.defaultBlockState()
.setValue(SulphurCrystalBlock.WATERLOGGED, true)
.setValue(SulphurCrystalBlock.FACING, dir)
.setValue(SulphurCrystalBlock.AGE, random.nextInt(3));
BlocksHelper.setWithoutUpdate(world, side, state);
}
}

View file

@ -21,17 +21,25 @@ public class SurfaceVentFeature extends DefaultFeature {
final Random random = featureConfig.random();
BlockPos pos = featureConfig.origin();
final WorldGenLevel world = featureConfig.level();
pos = getPosOnSurface(world, new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16)));
pos = getPosOnSurface(
world,
new BlockPos(pos.getX() + random.nextInt(16), pos.getY(), pos.getZ() + random.nextInt(16))
);
if (!world.getBlockState(pos.below(3)).is(TagAPI.GEN_TERRAIN)) {
return false;
}
MutableBlockPos mut = new MutableBlockPos();
int count = MHelper.randRange(15, 30, random);
BlockState vent = EndBlocks.HYDROTHERMAL_VENT.defaultBlockState().setValue(HydrothermalVentBlock.WATERLOGGED, false);
BlockState vent = EndBlocks.HYDROTHERMAL_VENT.defaultBlockState()
.setValue(HydrothermalVentBlock.WATERLOGGED, false);
for (int i = 0; i < count; i++) {
mut.set(pos).move(MHelper.floor(random.nextGaussian() * 2 + 0.5), 5, MHelper.floor(random.nextGaussian() * 2 + 0.5));
int dist = MHelper.floor(2 - MHelper.length(mut.getX() - pos.getX(), mut.getZ() - pos.getZ())) + random.nextInt(2);
mut.set(pos)
.move(MHelper.floor(random.nextGaussian() * 2 + 0.5), 5, MHelper.floor(random.nextGaussian() * 2 + 0.5));
int dist = MHelper.floor(2 - MHelper.length(
mut.getX() - pos.getX(),
mut.getZ() - pos.getZ()
)) + random.nextInt(2);
if (dist > 0) {
BlockState state = world.getBlockState(mut);
for (int n = 0; n < 10 && state.isAir(); n++) {

View file

@ -74,7 +74,10 @@ public abstract class EndCaveFeature extends DefaultFeature {
}
}
});
BlockState surfaceBlock = biome.getBiome().getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
BlockState surfaceBlock = biome.getBiome()
.getGenerationSettings()
.getSurfaceBuilderConfig()
.getTopMaterial();
placeFloor(world, biome, floorPositions, random, surfaceBlock);
placeCeil(world, biome, ceilPositions, random);
placeWalls(world, biome, caveBlocks, random);
@ -126,7 +129,8 @@ public abstract class EndCaveFeature extends DefaultFeature {
if (wallBlock != null) {
for (Vec3i offset : SPHERE) {
BlockPos wallPos = pos.offset(offset);
if (!positions.contains(wallPos) && !placed.contains(wallPos) && world.getBlockState(wallPos).is(TagAPI.GEN_TERRAIN)) {
if (!positions.contains(wallPos) && !placed.contains(wallPos) && world.getBlockState(wallPos)
.is(TagAPI.GEN_TERRAIN)) {
wallBlock = biome.getWall(wallPos);
BlocksHelper.setWithoutUpdate(world, wallPos, wallBlock);
placed.add(wallPos);
@ -256,6 +260,6 @@ public abstract class EndCaveFeature extends DefaultFeature {
}
}
}
SPHERE = prePos.toArray(new Vec3i[]{});
SPHERE = prePos.toArray(new Vec3i[] {});
}
}

View file

@ -74,6 +74,9 @@ public class RoundCaveFeature extends EndCaveFeature {
}
private boolean isReplaceable(BlockState state) {
return state.is(TagAPI.GEN_TERRAIN) || state.getMaterial().isReplaceable() || state.getMaterial().equals(Material.PLANT) || state.getMaterial().equals(Material.LEAVES);
return state.is(TagAPI.GEN_TERRAIN) || state.getMaterial().isReplaceable() || state.getMaterial()
.equals(Material.PLANT) || state
.getMaterial()
.equals(Material.LEAVES);
}
}

View file

@ -74,7 +74,10 @@ public class TunelCaveFeature extends EndCaveFeature {
break;
}
float val = Mth.abs((float) noiseH.eval(pos.getX() * 0.02, y * 0.01, pos.getZ() * 0.02));
float vert = Mth.sin((y + (float) noiseV.eval(pos.getX() * 0.01, pos.getZ() * 0.01) * 20) * 0.1F) * 0.9F;
float vert = Mth.sin((y + (float) noiseV.eval(
pos.getX() * 0.01,
pos.getZ() * 0.01
) * 20) * 0.1F) * 0.9F;
float dist = (float) noiseD.eval(pos.getX() * 0.1, y * 0.1, pos.getZ() * 0.1) * 0.12F;
val = (val + vert * vert + dist) + density + gradient;
if (val < 0.15 && world.getBlockState(pos).is(TagAPI.GEN_TERRAIN) && noWaterNear(world, pos)) {
@ -163,7 +166,10 @@ public class TunelCaveFeature extends EndCaveFeature {
}
floorSets.forEach((biome, floorPositions) -> {
BlockState surfaceBlock = biome.getBiome().getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
BlockState surfaceBlock = biome.getBiome()
.getGenerationSettings()
.getSurfaceBuilderConfig()
.getTopMaterial();
placeFloor(world, biome, floorPositions, random, surfaceBlock);
});
ceilSets.forEach((biome, ceilPositions) -> {
@ -215,7 +221,10 @@ public class TunelCaveFeature extends EndCaveFeature {
}
protected boolean hasCaves(WorldGenLevel world, BlockPos pos) {
return hasCavesInBiome(world, pos.offset(-8, 0, -8)) && hasCavesInBiome(world, pos.offset(8, 0, -8)) && hasCavesInBiome(world, pos.offset(-8, 0, 8)) && hasCavesInBiome(world, pos.offset(8, 0, 8));
return hasCavesInBiome(world, pos.offset(-8, 0, -8)) && hasCavesInBiome(
world,
pos.offset(8, 0, -8)
) && hasCavesInBiome(world, pos.offset(-8, 0, 8)) && hasCavesInBiome(world, pos.offset(8, 0, 8));
}
protected boolean hasCavesInBiome(WorldGenLevel world, BlockPos pos) {

View file

@ -118,7 +118,9 @@ public class DragonTreeFeature extends DefaultFeature {
}
private void leavesBall(WorldGenLevel world, BlockPos pos, float radius, Random random, OpenSimplexNoise noise) {
SDF sphere = new SDFSphere().setRadius(radius).setBlock(EndBlocks.DRAGON_TREE_LEAVES.defaultBlockState().setValue(LeavesBlock.DISTANCE, 6));
SDF sphere = new SDFSphere().setRadius(radius)
.setBlock(EndBlocks.DRAGON_TREE_LEAVES.defaultBlockState()
.setValue(LeavesBlock.DISTANCE, 6));
SDF sub = new SDFScale().setScale(5).setSource(sphere);
sub = new SDFTranslate().setTranslate(0, -radius * 5, 0).setSource(sub);
sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(sub);
@ -169,7 +171,11 @@ public class DragonTreeFeature extends DefaultFeature {
if (radius > 5) {
int count = (int) (radius * 2.5F);
for (int i = 0; i < count; i++) {
BlockPos p = pos.offset(random.nextGaussian() * 1, random.nextGaussian() * 1, random.nextGaussian() * 1);
BlockPos p = pos.offset(
random.nextGaussian() * 1,
random.nextGaussian() * 1,
random.nextGaussian() * 1
);
boolean place = true;
for (Direction d : Direction.values()) {
BlockState state = world.getBlockState(p.relative(d));
@ -212,7 +218,13 @@ public class DragonTreeFeature extends DefaultFeature {
return info.getState();
};
BRANCH = Lists.newArrayList(new Vector3f(0, 0, 0), new Vector3f(0.1F, 0.3F, 0), new Vector3f(0.4F, 0.6F, 0), new Vector3f(0.8F, 0.8F, 0), new Vector3f(1, 1, 0));
BRANCH = Lists.newArrayList(
new Vector3f(0, 0, 0),
new Vector3f(0.1F, 0.3F, 0),
new Vector3f(0.4F, 0.6F, 0),
new Vector3f(0.8F, 0.8F, 0),
new Vector3f(1, 1, 0)
);
SIDE1 = Lists.newArrayList(new Vector3f(0.4F, 0.6F, 0), new Vector3f(0.8F, 0.8F, 0), new Vector3f(1, 1, 0));
SIDE2 = SplineHelper.copySpline(SIDE1);
@ -226,7 +238,13 @@ public class DragonTreeFeature extends DefaultFeature {
SplineHelper.offset(SIDE1, offset2);
SplineHelper.offset(SIDE2, offset2);
ROOT = Lists.newArrayList(new Vector3f(0F, 1F, 0), new Vector3f(0.1F, 0.7F, 0), new Vector3f(0.3F, 0.3F, 0), new Vector3f(0.7F, 0.05F, 0), new Vector3f(0.8F, -0.2F, 0));
ROOT = Lists.newArrayList(
new Vector3f(0F, 1F, 0),
new Vector3f(0.1F, 0.7F, 0),
new Vector3f(0.3F, 0.3F, 0),
new Vector3f(0.7F, 0.05F, 0),
new Vector3f(0.8F, -0.2F, 0)
);
SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0));
}
}

View file

@ -48,7 +48,12 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
BlocksHelper.setWithoutUpdate(world, pos, AIR);
float radius = size * 0.17F;// MHelper.randRange(0.8F, 1.2F, random);
SDF function = SplineHelper.buildSDF(spline, radius, 0.2F, (bpos) -> EndBlocks.AMARANITA_STEM.defaultBlockState());
SDF function = SplineHelper.buildSDF(
spline,
radius,
0.2F,
(bpos) -> EndBlocks.AMARANITA_STEM.defaultBlockState()
);
Vector3f capPos = spline.get(spline.size() - 1);
makeHead(world, pos.offset(capPos.x() + 0.5F, capPos.y() + 1.5F, capPos.z() + 0.5F), Mth.floor(size / 1.6F));
@ -96,7 +101,12 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_LANTERN);
mut.move(Direction.DOWN);
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_FUR.defaultBlockState().setValue(BaseAttachedBlock.FACING, Direction.DOWN));
BlocksHelper.setWithoutUpdate(
world,
mut,
EndBlocks.AMARANITA_FUR.defaultBlockState()
.setValue(BaseAttachedBlock.FACING, Direction.DOWN)
);
}
}
}
@ -159,13 +169,25 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
int distance = axis == Axis.X ? x < 0 ? -1 : 1 : z < 0 ? -1 : 1;
BlockPos offseted = mut.relative(axis, distance);
if (world.getBlockState(offseted).getMaterial().isReplaceable()) {
Direction dir = Direction.fromAxisAndDirection(axis, distance < 0 ? AxisDirection.NEGATIVE : AxisDirection.POSITIVE);
BlocksHelper.setWithoutUpdate(world, offseted, EndBlocks.AMARANITA_FUR.defaultBlockState().setValue(BaseAttachedBlock.FACING, dir));
Direction dir = Direction.fromAxisAndDirection(
axis,
distance < 0 ? AxisDirection.NEGATIVE : AxisDirection.POSITIVE
);
BlocksHelper.setWithoutUpdate(
world,
offseted,
EndBlocks.AMARANITA_FUR.defaultBlockState().setValue(BaseAttachedBlock.FACING, dir)
);
}
mut.move(Direction.DOWN);
}
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_FUR.defaultBlockState().setValue(BaseAttachedBlock.FACING, Direction.DOWN));
BlocksHelper.setWithoutUpdate(
world,
mut,
EndBlocks.AMARANITA_FUR.defaultBlockState()
.setValue(BaseAttachedBlock.FACING, Direction.DOWN)
);
}
}
}
@ -252,7 +274,10 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
}
for (int i = 0; i < 4; i++) {
mut.set(pos).move(Direction.UP).move(BlocksHelper.HORIZONTAL[i], 3).move(BlocksHelper.HORIZONTAL[(i + 1) & 3], 3);
mut.set(pos)
.move(Direction.UP)
.move(BlocksHelper.HORIZONTAL[i], 3)
.move(BlocksHelper.HORIZONTAL[(i + 1) & 3], 3);
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_HYMENOPHORE);
}
@ -270,13 +295,25 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
int distance = axis == Axis.X ? x < 0 ? -1 : 1 : z < 0 ? -1 : 1;
BlockPos offseted = mut.relative(axis, distance);
if (world.getBlockState(offseted).getMaterial().isReplaceable()) {
Direction dir = Direction.fromAxisAndDirection(axis, distance < 0 ? AxisDirection.NEGATIVE : AxisDirection.POSITIVE);
BlocksHelper.setWithoutUpdate(world, offseted, EndBlocks.AMARANITA_FUR.defaultBlockState().setValue(BaseAttachedBlock.FACING, dir));
Direction dir = Direction.fromAxisAndDirection(
axis,
distance < 0 ? AxisDirection.NEGATIVE : AxisDirection.POSITIVE
);
BlocksHelper.setWithoutUpdate(
world,
offseted,
EndBlocks.AMARANITA_FUR.defaultBlockState().setValue(BaseAttachedBlock.FACING, dir)
);
}
mut.move(Direction.DOWN);
}
if (world.getBlockState(mut).getMaterial().isReplaceable()) {
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_FUR.defaultBlockState().setValue(BaseAttachedBlock.FACING, Direction.DOWN));
BlocksHelper.setWithoutUpdate(
world,
mut,
EndBlocks.AMARANITA_FUR.defaultBlockState()
.setValue(BaseAttachedBlock.FACING, Direction.DOWN)
);
}
}
}
@ -303,12 +340,16 @@ public class GiganticAmaranitaFeature extends DefaultFeature {
for (int z = -2; z < 3; z++) {
mut.setZ(pos.getZ() + z);
if (y < 6) {
if (((x / 2) == 0 || (z / 2) == 0) && world.getBlockState(mut).getMaterial().isReplaceable()) {
if (((x / 2) == 0 || (z / 2) == 0) && world.getBlockState(mut)
.getMaterial()
.isReplaceable()) {
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_CAP);
}
}
else {
if ((x == 0 || z == 0) && (Math.abs(x) < 2 && Math.abs(z) < 2) && world.getBlockState(mut).getMaterial().isReplaceable()) {
if ((x == 0 || z == 0) && (Math.abs(x) < 2 && Math.abs(z) < 2) && world.getBlockState(mut)
.getMaterial()
.isReplaceable()) {
BlocksHelper.setWithoutUpdate(world, mut, EndBlocks.AMARANITA_CAP);
}
}

View file

@ -82,9 +82,15 @@ public class HelixTreeFeature extends DefaultFeature {
});
SplineHelper.scale(spline2, scale);
BlockPos leafStart = pos.offset(lastPoint.x() + 0.5, lastPoint.y() + 0.5, lastPoint.z() + 0.5);
SplineHelper.fillSplineForce(spline2, world, EndBlocks.HELIX_TREE.log.defaultBlockState(), leafStart, (state) -> {
return state.getMaterial().isReplaceable();
});
SplineHelper.fillSplineForce(
spline2,
world,
EndBlocks.HELIX_TREE.log.defaultBlockState(),
leafStart,
(state) -> {
return state.getMaterial().isReplaceable();
}
);
spline.clear();
float rad = MHelper.randRange(8F, 11F, random);

View file

@ -113,7 +113,12 @@ public class JellyshroomFeature extends DefaultFeature {
}
static {
ROOT = Lists.newArrayList(new Vector3f(0.1F, 0.70F, 0), new Vector3f(0.3F, 0.30F, 0), new Vector3f(0.7F, 0.05F, 0), new Vector3f(0.8F, -0.20F, 0));
ROOT = Lists.newArrayList(
new Vector3f(0.1F, 0.70F, 0),
new Vector3f(0.3F, 0.30F, 0),
new Vector3f(0.7F, 0.05F, 0),
new Vector3f(0.8F, -0.20F, 0)
);
SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0));
REPLACE = (state) -> {

View file

@ -92,8 +92,13 @@ public class LacugroveFeature extends DefaultFeature {
for (int y = top; y >= minY; y--) {
mut.setY(y);
BlockState state = world.getBlockState(mut);
if (state.getMaterial().isReplaceable() || state.getMaterial().equals(Material.PLANT) || state.is(TagAPI.END_GROUND)) {
BlocksHelper.setWithoutUpdate(world, mut, y == top ? EndBlocks.LACUGROVE.bark : EndBlocks.LACUGROVE.log);
if (state.getMaterial().isReplaceable() || state.getMaterial()
.equals(Material.PLANT) || state.is(TagAPI.END_GROUND)) {
BlocksHelper.setWithoutUpdate(
world,
mut,
y == top ? EndBlocks.LACUGROVE.bark : EndBlocks.LACUGROVE.log
);
}
else {
break;
@ -108,14 +113,17 @@ public class LacugroveFeature extends DefaultFeature {
}
private void leavesBall(WorldGenLevel world, BlockPos pos, float radius, Random random, OpenSimplexNoise noise) {
SDF sphere = new SDFSphere().setRadius(radius).setBlock(EndBlocks.LACUGROVE_LEAVES.defaultBlockState().setValue(LeavesBlock.DISTANCE, 6));
SDF sphere = new SDFSphere().setRadius(radius)
.setBlock(EndBlocks.LACUGROVE_LEAVES.defaultBlockState()
.setValue(LeavesBlock.DISTANCE, 6));
sphere = new SDFDisplacement().setFunction((vec) -> {
return (float) noise.eval(vec.x() * 0.2, vec.y() * 0.2, vec.z() * 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 - 2, 0).setSource(sphere));
sphere = new SDFSubtraction().setSourceA(sphere)
.setSourceB(new SDFTranslate().setTranslate(0, -radius - 2, 0).setSource(sphere));
MutableBlockPos mut = new MutableBlockPos();
sphere.addPostProcess((info) -> {
if (random.nextInt(5) == 0) {
@ -156,7 +164,11 @@ public class LacugroveFeature extends DefaultFeature {
if (radius > 5) {
int count = (int) (radius * 2.5F);
for (int i = 0; i < count; i++) {
BlockPos p = pos.offset(random.nextGaussian() * 1, random.nextGaussian() * 1, random.nextGaussian() * 1);
BlockPos p = pos.offset(
random.nextGaussian() * 1,
random.nextGaussian() * 1,
random.nextGaussian() * 1
);
boolean place = true;
for (Direction d : Direction.values()) {
BlockState state = world.getBlockState(p.relative(d));

View file

@ -71,12 +71,18 @@ public class LucerniaFeature extends DefaultFeature {
}
private void leavesBall(WorldGenLevel world, BlockPos pos, float radius, Random random, OpenSimplexNoise noise, boolean natural) {
SDF sphere = new SDFSphere().setRadius(radius).setBlock(EndBlocks.LUCERNIA_LEAVES.defaultBlockState().setValue(LeavesBlock.DISTANCE, 6));
SDF sphere = new SDFSphere().setRadius(radius)
.setBlock(EndBlocks.LUCERNIA_LEAVES.defaultBlockState()
.setValue(LeavesBlock.DISTANCE, 6));
SDF sub = new SDFScale().setScale(5).setSource(sphere);
sub = new SDFTranslate().setTranslate(0, -radius * 5, 0).setSource(sub);
sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(sub);
sphere = new SDFScale3D().setScale(1, 0.75F, 1).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> (float) noise.eval(vec.x() * 0.2, vec.y() * 0.2, vec.z() * 0.2) * 2F).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> (float) noise.eval(
vec.x() * 0.2,
vec.y() * 0.2,
vec.z() * 0.2
) * 2F).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> MHelper.randRange(-1.5F, 1.5F, random)).setSource(sphere);
MutableBlockPos mut = new MutableBlockPos();
@ -90,8 +96,10 @@ public class LucerniaFeature extends DefaultFeature {
}
BlockState top = EndBlocks.FILALUX.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP);
BlockState middle = EndBlocks.FILALUX.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE);
BlockState bottom = EndBlocks.FILALUX.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM);
BlockState middle = EndBlocks.FILALUX.defaultBlockState()
.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE);
BlockState bottom = EndBlocks.FILALUX.defaultBlockState()
.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM);
BlockState outer = EndBlocks.LUCERNIA_OUTER_LEAVES.defaultBlockState();
List<BlockPos> support = Lists.newArrayList();
@ -200,9 +208,21 @@ public class LucerniaFeature extends DefaultFeature {
IGNORE = EndBlocks.LUCERNIA::isTreeLog;
SPLINE = Lists.newArrayList(new Vector3f(0.00F, 0.00F, 0.00F), new Vector3f(0.10F, 0.35F, 0.00F), new Vector3f(0.20F, 0.50F, 0.00F), new Vector3f(0.30F, 0.55F, 0.00F), new Vector3f(0.42F, 0.70F, 0.00F), new Vector3f(0.50F, 1.00F, 0.00F));
SPLINE = Lists.newArrayList(
new Vector3f(0.00F, 0.00F, 0.00F),
new Vector3f(0.10F, 0.35F, 0.00F),
new Vector3f(0.20F, 0.50F, 0.00F),
new Vector3f(0.30F, 0.55F, 0.00F),
new Vector3f(0.42F, 0.70F, 0.00F),
new Vector3f(0.50F, 1.00F, 0.00F)
);
ROOT = Lists.newArrayList(new Vector3f(0.1F, 0.70F, 0), new Vector3f(0.3F, 0.30F, 0), new Vector3f(0.7F, 0.05F, 0), new Vector3f(0.8F, -0.20F, 0));
ROOT = Lists.newArrayList(
new Vector3f(0.1F, 0.70F, 0),
new Vector3f(0.3F, 0.30F, 0),
new Vector3f(0.7F, 0.05F, 0),
new Vector3f(0.8F, -0.20F, 0)
);
SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0));
}
}

View file

@ -83,17 +83,20 @@ public class MossyGlowshroomFeature extends DefaultFeature {
new SDFScale().setScale(scale).setSource(FUNCTION).setReplaceFunction(REPLACE).addPostProcess((info) -> {
if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getState())) {
if (random.nextBoolean() && info.getStateUp().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) {
info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState().setValue(MossyGlowshroomCapBlock.TRANSITION, true));
info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState()
.setValue(MossyGlowshroomCapBlock.TRANSITION, true));
return info.getState();
}
else if (!EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateUp()) || !EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown())) {
else if (!EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateUp()) || !EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(
info.getStateDown())) {
info.setState(EndBlocks.MOSSY_GLOWSHROOM.bark.defaultBlockState());
return info.getState();
}
}
else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) {
if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown().getBlock())) {
info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState().setValue(MossyGlowshroomCapBlock.TRANSITION, true));
info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState()
.setValue(MossyGlowshroomCapBlock.TRANSITION, true));
return info.getState();
}
@ -103,12 +106,18 @@ public class MossyGlowshroomFeature extends DefaultFeature {
else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) {
for (Direction dir : BlocksHelper.HORIZONTAL) {
if (info.getState(dir) == AIR) {
info.setBlockPos(info.getPos().relative(dir), EndBlocks.MOSSY_GLOWSHROOM_FUR.defaultBlockState().setValue(FurBlock.FACING, dir));
info.setBlockPos(
info.getPos().relative(dir),
EndBlocks.MOSSY_GLOWSHROOM_FUR.defaultBlockState().setValue(FurBlock.FACING, dir)
);
}
}
if (info.getStateDown().getBlock() != EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) {
info.setBlockPos(info.getPos().below(), EndBlocks.MOSSY_GLOWSHROOM_FUR.defaultBlockState().setValue(FurBlock.FACING, Direction.DOWN));
info.setBlockPos(
info.getPos().below(),
EndBlocks.MOSSY_GLOWSHROOM_FUR.defaultBlockState().setValue(FurBlock.FACING, Direction.DOWN)
);
}
}
return info.getState();
@ -121,7 +130,8 @@ public class MossyGlowshroomFeature extends DefaultFeature {
SDFCappedCone cone1 = new SDFCappedCone().setHeight(2.5F).setRadius1(1.5F).setRadius2(2.5F);
SDFCappedCone cone2 = new SDFCappedCone().setHeight(3F).setRadius1(2.5F).setRadius2(13F);
SDF posedCone2 = new SDFTranslate().setTranslate(0, 5, 0).setSource(cone2);
SDF posedCone3 = new SDFTranslate().setTranslate(0, 12F, 0).setSource(new SDFScale().setScale(2).setSource(cone2));
SDF posedCone3 = new SDFTranslate().setTranslate(0, 12F, 0)
.setSource(new SDFScale().setScale(2).setSource(cone2));
SDF upCone = new SDFSubtraction().setSourceA(posedCone2).setSourceB(posedCone3);
SDF wave = new SDFFlatWave().setRaysCount(12).setIntensity(1.3F).setSource(upCone);
SDF cones = new SDFSmoothUnion().setRadius(3).setSourceA(cone1).setSourceB(wave);
@ -143,18 +153,23 @@ public class MossyGlowshroomFeature extends DefaultFeature {
OpenSimplexNoise noise = new OpenSimplexNoise(1234);
cones = new SDFCoordModify().setFunction((pos) -> {
float dist = MHelper.length(pos.x(), pos.z());
float y = pos.y() + (float) noise.eval(pos.x() * 0.1 + CENTER.x(), pos.z() * 0.1 + CENTER.z()) * dist * 0.3F - dist * 0.15F;
float y = pos.y() + (float) noise.eval(
pos.x() * 0.1 + CENTER.x(),
pos.z() * 0.1 + CENTER.z()
) * dist * 0.3F - dist * 0.15F;
pos.set(pos.x(), y, pos.z());
}).setSource(cones);
HEAD_POS = (SDFTranslate) new SDFTranslate().setSource(new SDFTranslate().setTranslate(0, 2.5F, 0).setSource(cones));
HEAD_POS = (SDFTranslate) new SDFTranslate().setSource(new SDFTranslate().setTranslate(0, 2.5F, 0)
.setSource(cones));
SDF roots = new SDFSphere().setRadius(4F);
ROOTS = (SDFPrimitive) roots;
roots = new SDFScale3D().setScale(1, 0.7F, 1).setSource(roots);
ROOTS_ROT = (SDFFlatWave) new SDFFlatWave().setRaysCount(5).setIntensity(1.5F).setSource(roots);
FUNCTION = new SDFSmoothUnion().setRadius(4).setSourceB(new SDFUnion().setSourceA(HEAD_POS).setSourceB(ROOTS_ROT));
FUNCTION = new SDFSmoothUnion().setRadius(4)
.setSourceB(new SDFUnion().setSourceA(HEAD_POS).setSourceB(ROOTS_ROT));
REPLACE = (state) -> {
if (state.is(TagAPI.END_GROUND)) {

View file

@ -51,7 +51,17 @@ public class PythadendronTreeFeature extends DefaultFeature {
int depth = MHelper.floor((size - 10F) * 3F / 10F + 1F);
float bsize = (10F - (size - 10F)) / 10F + 1.5F;
branch(last.x(), last.y(), last.z(), size * bsize, MHelper.randRange(0, MHelper.PI2, random), random, depth, world, pos);
branch(
last.x(),
last.y(),
last.z(),
size * bsize,
MHelper.randRange(0, MHelper.PI2, random),
random,
depth,
world,
pos
);
SDF function = SplineHelper.buildSDF(spline, 1.7F, 1.1F, (bpos) -> {
return EndBlocks.PYTHADENDRON.bark.defaultBlockState();
@ -79,14 +89,26 @@ public class PythadendronTreeFeature extends DefaultFeature {
SplineHelper.offsetParts(spline, random, 0.3F, 0, 0.3F);
Vector3f pos1 = spline.get(spline.size() - 1);
boolean s1 = SplineHelper.fillSpline(spline, world, EndBlocks.PYTHADENDRON.bark.defaultBlockState(), pos, REPLACE);
boolean s1 = SplineHelper.fillSpline(
spline,
world,
EndBlocks.PYTHADENDRON.bark.defaultBlockState(),
pos,
REPLACE
);
spline = SplineHelper.makeSpline(x, y, z, x2, y, z2, 5);
SplineHelper.powerOffset(spline, size * MHelper.randRange(1.0F, 2.0F, random), 4);
SplineHelper.offsetParts(spline, random, 0.3F, 0, 0.3F);
Vector3f pos2 = spline.get(spline.size() - 1);
boolean s2 = SplineHelper.fillSpline(spline, world, EndBlocks.PYTHADENDRON.bark.defaultBlockState(), pos, REPLACE);
boolean s2 = SplineHelper.fillSpline(
spline,
world,
EndBlocks.PYTHADENDRON.bark.defaultBlockState(),
pos,
REPLACE
);
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextInt());
if (depth < 3) {
@ -114,7 +136,9 @@ public class PythadendronTreeFeature extends DefaultFeature {
private void leavesBall(WorldGenLevel world, BlockPos pos, Random random, OpenSimplexNoise noise) {
float radius = MHelper.randRange(4.5F, 6.5F, random);
SDF sphere = new SDFSphere().setRadius(radius).setBlock(EndBlocks.PYTHADENDRON_LEAVES.defaultBlockState().setValue(LeavesBlock.DISTANCE, 6));
SDF sphere = new SDFSphere().setRadius(radius)
.setBlock(EndBlocks.PYTHADENDRON_LEAVES.defaultBlockState()
.setValue(LeavesBlock.DISTANCE, 6));
sphere = new SDFScale3D().setScale(1, 0.6F, 1).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> {
return (float) noise.eval(vec.x() * 0.2, vec.y() * 0.2, vec.z() * 0.2) * 3;
@ -122,7 +146,8 @@ public class PythadendronTreeFeature extends DefaultFeature {
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 = new SDFSubtraction().setSourceA(sphere)
.setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere));
MutableBlockPos mut = new MutableBlockPos();
sphere.addPostProcess((info) -> {
if (random.nextInt(5) == 0) {

View file

@ -67,12 +67,18 @@ public class TenaneaFeature extends DefaultFeature {
}
private void leavesBall(WorldGenLevel world, BlockPos pos, float radius, Random random, OpenSimplexNoise noise) {
SDF sphere = new SDFSphere().setRadius(radius).setBlock(EndBlocks.TENANEA_LEAVES.defaultBlockState().setValue(LeavesBlock.DISTANCE, 6));
SDF sphere = new SDFSphere().setRadius(radius)
.setBlock(EndBlocks.TENANEA_LEAVES.defaultBlockState()
.setValue(LeavesBlock.DISTANCE, 6));
SDF sub = new SDFScale().setScale(5).setSource(sphere);
sub = new SDFTranslate().setTranslate(0, -radius * 5, 0).setSource(sub);
sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(sub);
sphere = new SDFScale3D().setScale(1, 0.75F, 1).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> (float) noise.eval(vec.x() * 0.2, vec.y() * 0.2, vec.z() * 0.2) * 2F).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> (float) noise.eval(
vec.x() * 0.2,
vec.y() * 0.2,
vec.z() * 0.2
) * 2F).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> MHelper.randRange(-1.5F, 1.5F, random)).setSource(sphere);
MutableBlockPos mut = new MutableBlockPos();
@ -85,9 +91,12 @@ public class TenaneaFeature extends DefaultFeature {
}
}
BlockState top = EndBlocks.TENANEA_FLOWERS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP);
BlockState middle = EndBlocks.TENANEA_FLOWERS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE);
BlockState bottom = EndBlocks.TENANEA_FLOWERS.defaultBlockState().setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM);
BlockState top = EndBlocks.TENANEA_FLOWERS.defaultBlockState()
.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP);
BlockState middle = EndBlocks.TENANEA_FLOWERS.defaultBlockState()
.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE);
BlockState bottom = EndBlocks.TENANEA_FLOWERS.defaultBlockState()
.setValue(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM);
BlockState outer = EndBlocks.TENANEA_OUTER_LEAVES.defaultBlockState();
List<BlockPos> support = Lists.newArrayList();
@ -180,6 +189,13 @@ public class TenaneaFeature extends DefaultFeature {
IGNORE = EndBlocks.TENANEA::isTreeLog;
SPLINE = Lists.newArrayList(new Vector3f(0.00F, 0.00F, 0.00F), new Vector3f(0.10F, 0.35F, 0.00F), new Vector3f(0.20F, 0.50F, 0.00F), new Vector3f(0.30F, 0.55F, 0.00F), new Vector3f(0.42F, 0.70F, 0.00F), new Vector3f(0.50F, 1.00F, 0.00F));
SPLINE = Lists.newArrayList(
new Vector3f(0.00F, 0.00F, 0.00F),
new Vector3f(0.10F, 0.35F, 0.00F),
new Vector3f(0.20F, 0.50F, 0.00F),
new Vector3f(0.30F, 0.55F, 0.00F),
new Vector3f(0.42F, 0.70F, 0.00F),
new Vector3f(0.50F, 1.00F, 0.00F)
);
}
}

View file

@ -47,9 +47,12 @@ public class UmbrellaTreeFeature extends DefaultFeature {
if (!world.getBlockState(pos.below()).is(TagAPI.END_GROUND)) return false;
BlockState wood = EndBlocks.UMBRELLA_TREE.bark.defaultBlockState();
BlockState membrane = EndBlocks.UMBRELLA_TREE_MEMBRANE.defaultBlockState().setValue(UmbrellaTreeMembraneBlock.COLOR, 1);
BlockState center = EndBlocks.UMBRELLA_TREE_MEMBRANE.defaultBlockState().setValue(UmbrellaTreeMembraneBlock.COLOR, 0);
BlockState fruit = EndBlocks.UMBRELLA_TREE_CLUSTER.defaultBlockState().setValue(UmbrellaTreeClusterBlock.NATURAL, true);
BlockState membrane = EndBlocks.UMBRELLA_TREE_MEMBRANE.defaultBlockState()
.setValue(UmbrellaTreeMembraneBlock.COLOR, 1);
BlockState center = EndBlocks.UMBRELLA_TREE_MEMBRANE.defaultBlockState()
.setValue(UmbrellaTreeMembraneBlock.COLOR, 0);
BlockState fruit = EndBlocks.UMBRELLA_TREE_CLUSTER.defaultBlockState()
.setValue(UmbrellaTreeClusterBlock.NATURAL, true);
float size = MHelper.randRange(10, 20, random);
int count = (int) (size * 0.15F);
@ -89,7 +92,12 @@ public class UmbrellaTreeFeature extends DefaultFeature {
float pz = MHelper.floor(vec.z()) + 0.5F;
mem = new SDFTranslate().setTranslate(px, py, pz).setSource(mem);
sdf = new SDFSmoothUnion().setRadius(2).setSourceA(sdf).setSourceB(mem);
centers.add(new Center(pos.getX() + (double) (px * scale), pos.getY() + (double) (py * scale), pos.getZ() + (double) (pz * scale), radius * scale));
centers.add(new Center(
pos.getX() + (double) (px * scale),
pos.getY() + (double) (py * scale),
pos.getZ() + (double) (pz * scale),
radius * scale
));
vec = spline.get(0);
}
@ -194,13 +202,26 @@ public class UmbrellaTreeFeature extends DefaultFeature {
}
static {
SPLINE = Lists.newArrayList(new Vector3f(0.00F, 0.00F, 0.00F), new Vector3f(0.10F, 0.35F, 0.00F), new Vector3f(0.20F, 0.50F, 0.00F), new Vector3f(0.30F, 0.55F, 0.00F), new Vector3f(0.42F, 0.70F, 0.00F), new Vector3f(0.50F, 1.00F, 0.00F));
SPLINE = Lists.newArrayList(
new Vector3f(0.00F, 0.00F, 0.00F),
new Vector3f(0.10F, 0.35F, 0.00F),
new Vector3f(0.20F, 0.50F, 0.00F),
new Vector3f(0.30F, 0.55F, 0.00F),
new Vector3f(0.42F, 0.70F, 0.00F),
new Vector3f(0.50F, 1.00F, 0.00F)
);
ROOT = Lists.newArrayList(new Vector3f(0.1F, 0.70F, 0), new Vector3f(0.3F, 0.30F, 0), new Vector3f(0.7F, 0.05F, 0), new Vector3f(0.8F, -0.20F, 0));
ROOT = Lists.newArrayList(
new Vector3f(0.1F, 0.70F, 0),
new Vector3f(0.3F, 0.30F, 0),
new Vector3f(0.7F, 0.05F, 0),
new Vector3f(0.8F, -0.20F, 0)
);
SplineHelper.offset(ROOT, new Vector3f(0, -0.45F, 0));
REPLACE = (state) -> {
if (state.is(TagAPI.END_GROUND) || state.getMaterial().equals(Material.PLANT) || state.is(EndBlocks.UMBRELLA_TREE_MEMBRANE)) {
if (state.is(TagAPI.END_GROUND) || state.getMaterial()
.equals(Material.PLANT) || state.is(EndBlocks.UMBRELLA_TREE_MEMBRANE)) {
return true;
}
return state.getMaterial().isReplaceable();

View file

@ -105,13 +105,20 @@ public class BetterEndBiomeSource extends BiomeSource {
}
}
else {
float height = TheEndBiomeSource.getHeightValue(noise, (biomeX >> 1) + 1, (biomeZ >> 1) + 1) + (float) SMALL_NOISE.eval(biomeX, biomeZ) * 5;
float height = TheEndBiomeSource.getHeightValue(
noise,
(biomeX >> 1) + 1,
(biomeZ >> 1) + 1
) + (float) SMALL_NOISE.eval(biomeX, biomeZ) * 5;
if (height > -20F && height < -5F) {
return barrens;
}
endBiome = height < -10F ? mapVoid.getBiome(biomeX << 2, biomeZ << 2) : mapLand.getBiome(biomeX << 2, biomeZ << 2);
endBiome = height < -10F ? mapVoid.getBiome(biomeX << 2, biomeZ << 2) : mapLand.getBiome(
biomeX << 2,
biomeZ << 2
);
}
return BiomeAPI.getActualBiome(endBiome);

View file

@ -40,17 +40,49 @@ public class GeneratorOptions {
hasDragonFights = Configs.GENERATOR_CONFIG.getBooleanRoot("hasDragonFights", true);
swapOverworldToEnd = Configs.GENERATOR_CONFIG.getBooleanRoot("swapOverworldToEnd", false);
changeChorusPlant = Configs.GENERATOR_CONFIG.getBoolean("chorusPlant", "changeChorusPlant", true);
removeChorusFromVanillaBiomes = Configs.GENERATOR_CONFIG.getBoolean("chorusPlant", "removeChorusFromVanillaBiomes", true);
removeChorusFromVanillaBiomes = Configs.GENERATOR_CONFIG.getBoolean(
"chorusPlant",
"removeChorusFromVanillaBiomes",
true
);
newGenerator = Configs.GENERATOR_CONFIG.getBoolean("customGenerator", "useNewGenerator", true);
noRingVoid = Configs.GENERATOR_CONFIG.getBoolean("customGenerator", "noRingVoid", false);
generateCentralIsland = Configs.GENERATOR_CONFIG.getBoolean("customGenerator", "generateCentralIsland", true);
endCityFailChance = Configs.GENERATOR_CONFIG.getInt("customGenerator", "endCityFailChance", 5);
generateObsidianPlatform = Configs.GENERATOR_CONFIG.getBooleanRoot("generateObsidianPlatform", true);
bigOptions = new LayerOptions("customGenerator.layers.bigIslands", Configs.GENERATOR_CONFIG, 300, 200, 70, 10, false);
mediumOptions = new LayerOptions("customGenerator.layers.mediumIslands", Configs.GENERATOR_CONFIG, 150, 100, 70, 20, true);
smallOptions = new LayerOptions("customGenerator.layers.smallIslands", Configs.GENERATOR_CONFIG, 60, 50, 70, 30, false);
bigOptions = new LayerOptions(
"customGenerator.layers.bigIslands",
Configs.GENERATOR_CONFIG,
300,
200,
70,
10,
false
);
mediumOptions = new LayerOptions(
"customGenerator.layers.mediumIslands",
Configs.GENERATOR_CONFIG,
150,
100,
70,
20,
true
);
smallOptions = new LayerOptions(
"customGenerator.layers.smallIslands",
Configs.GENERATOR_CONFIG,
60,
50,
70,
30,
false
);
changeSpawn = Configs.GENERATOR_CONFIG.getBoolean("spawn", "changeSpawn", false);
spawn = new BlockPos(Configs.GENERATOR_CONFIG.getInt("spawn.point", "x", 20), Configs.GENERATOR_CONFIG.getInt("spawn.point", "y", 65), Configs.GENERATOR_CONFIG.getInt("spawn.point", "z", 0));
spawn = new BlockPos(
Configs.GENERATOR_CONFIG.getInt("spawn.point", "x", 20),
Configs.GENERATOR_CONFIG.getInt("spawn.point", "y", 65),
Configs.GENERATOR_CONFIG.getInt("spawn.point", "z", 0)
);
replacePortal = Configs.GENERATOR_CONFIG.getBoolean("portal", "customEndPortal", true);
replacePillars = Configs.GENERATOR_CONFIG.getBoolean("spikes", "customObsidianSpikes", true);
int circleRadius = Configs.GENERATOR_CONFIG.getInt("customGenerator", "voidRingSize", 1000);

View file

@ -41,7 +41,10 @@ public class IslandLayer {
SDF coneBottom = new SDFSmoothUnion().setRadius(0.02F).setSourceA(cone1).setSourceB(cone2);
SDF coneTop = new SDFSmoothUnion().setRadius(0.02F).setSourceA(cone3).setSourceB(cone4);
noise = (SDFRadialNoiseMap) new SDFRadialNoiseMap().setSeed(seed).setRadius(0.5F).setIntensity(0.2F).setSource(coneTop);
noise = (SDFRadialNoiseMap) new SDFRadialNoiseMap().setSeed(seed)
.setRadius(0.5F)
.setIntensity(0.2F)
.setSource(coneTop);
island = new SDFSmoothUnion().setRadius(0.01F).setSourceA(noise).setSourceB(coneBottom);
}
@ -78,7 +81,8 @@ public class IslandLayer {
}
}
if (GeneratorOptions.hasCentralIsland() && Math.abs(ix) < GeneratorOptions.getIslandDistChunk() && Math.abs(iz) < GeneratorOptions.getIslandDistChunk()) {
if (GeneratorOptions.hasCentralIsland() && Math.abs(ix) < GeneratorOptions.getIslandDistChunk() && Math.abs(iz) < GeneratorOptions
.getIslandDistChunk()) {
int count = positions.size();
for (int n = 0; n < count; n++) {
BlockPos pos = positions.get(n);

View file

@ -46,8 +46,14 @@ public class TerrainGenerator {
mediumIslands.clearCache();
smallIslands.clearCache();
double distortion1 = noise1.eval(x * 0.1, z * 0.1) * 20 + noise2.eval(x * 0.2, z * 0.2) * 10 + noise1.eval(x * 0.4, z * 0.4) * 5;
double distortion2 = noise2.eval(x * 0.1, z * 0.1) * 20 + noise1.eval(x * 0.2, z * 0.2) * 10 + noise2.eval(x * 0.4, z * 0.4) * 5;
double distortion1 = noise1.eval(x * 0.1, z * 0.1) * 20 + noise2.eval(
x * 0.2,
z * 0.2
) * 10 + noise1.eval(x * 0.4, z * 0.4) * 5;
double distortion2 = noise2.eval(x * 0.1, z * 0.1) * 20 + noise1.eval(
x * 0.2,
z * 0.2
) * 10 + noise2.eval(x * 0.4, z * 0.4) * 5;
double px = (double) x * SCALE_XZ + distortion1;
double pz = (double) z * SCALE_XZ + distortion2;
@ -123,8 +129,14 @@ public class TerrainGenerator {
double px = (x >> 1) + 0.5;
double pz = (z >> 1) + 0.5;
double distortion1 = noise1.eval(px * 0.1, pz * 0.1) * 20 + noise2.eval(px * 0.2, pz * 0.2) * 10 + noise1.eval(px * 0.4, pz * 0.4) * 5;
double distortion2 = noise2.eval(px * 0.1, pz * 0.1) * 20 + noise1.eval(px * 0.2, pz * 0.2) * 10 + noise2.eval(px * 0.4, pz * 0.4) * 5;
double distortion1 = noise1.eval(px * 0.1, pz * 0.1) * 20 + noise2.eval(px * 0.2, pz * 0.2) * 10 + noise1.eval(
px * 0.4,
pz * 0.4
) * 5;
double distortion2 = noise2.eval(px * 0.1, pz * 0.1) * 20 + noise1.eval(px * 0.2, pz * 0.2) * 10 + noise2.eval(
px * 0.4,
pz * 0.4
) * 5;
px = px * SCALE_XZ + distortion1;
pz = pz * SCALE_XZ + distortion2;
@ -167,8 +179,14 @@ public class TerrainGenerator {
double px = (double) x / 8.0;
double pz = (double) z / 8.0;
double distortion1 = noise1.eval(px * 0.1, pz * 0.1) * 20 + noise2.eval(px * 0.2, pz * 0.2) * 10 + noise1.eval(px * 0.4, pz * 0.4) * 5;
double distortion2 = noise2.eval(px * 0.1, pz * 0.1) * 20 + noise1.eval(px * 0.2, pz * 0.2) * 10 + noise2.eval(px * 0.4, pz * 0.4) * 5;
double distortion1 = noise1.eval(px * 0.1, pz * 0.1) * 20 + noise2.eval(px * 0.2, pz * 0.2) * 10 + noise1.eval(
px * 0.4,
pz * 0.4
) * 5;
double distortion2 = noise2.eval(px * 0.1, pz * 0.1) * 20 + noise1.eval(px * 0.2, pz * 0.2) * 10 + noise2.eval(
px * 0.4,
pz * 0.4
) * 5;
px = (double) x * SCALE_XZ + distortion1;
pz = (double) z * SCALE_XZ + distortion2;
@ -210,7 +228,7 @@ public class TerrainGenerator {
}
}
}
OFFS = pos.toArray(new Point[]{});
OFFS = pos.toArray(new Point[] {});
COEF = new float[coef.size()];
for (int i = 0; i < COEF.length; i++) {
COEF[i] = coef.get(i) / sum;

View file

@ -16,7 +16,6 @@ import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConf
import net.minecraft.world.level.levelgen.structure.StructureStart;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate;
import ru.bclib.util.MHelper;
import ru.bclib.util.StructureHelper;
import ru.betterend.BetterEnd;
import ru.betterend.world.structures.piece.NBTPiece;
@ -32,10 +31,25 @@ public class EternalPortalStructure extends FeatureBaseStructure {
if (x + z < 1024L) {
return false;
}
if (chunkGenerator.getBaseHeight(pos.getBlockX(8), pos.getBlockX(8), Heightmap.Types.WORLD_SURFACE_WG, levelHeightAccessor) < 5) {
if (chunkGenerator.getBaseHeight(
pos.getBlockX(8),
pos.getBlockX(8),
Heightmap.Types.WORLD_SURFACE_WG,
levelHeightAccessor
) < 5) {
return false;
}
return super.isFeatureChunk(chunkGenerator, biomeSource, worldSeed, chunkRandom, pos, biome, chunkPos, featureConfig, levelHeightAccessor);
return super.isFeatureChunk(
chunkGenerator,
biomeSource,
worldSeed,
chunkRandom,
pos,
biome,
chunkPos,
featureConfig,
levelHeightAccessor
);
}
@Override
@ -53,7 +67,14 @@ public class EternalPortalStructure extends FeatureBaseStructure {
int x = chunkPos.getBlockX(8);
int z = chunkPos.getBlockZ(8);
int y = chunkGenerator.getBaseHeight(x, z, Types.WORLD_SURFACE_WG, levelHeightAccessor);
this.pieces.add(new NBTPiece(STRUCTURE_ID, STRUCTURE, new BlockPos(x, y - 4, z), random.nextInt(5), true, random));
this.pieces.add(new NBTPiece(
STRUCTURE_ID,
STRUCTURE,
new BlockPos(x, y - 4, z),
random.nextInt(5),
true,
random
));
}
}
}

View file

@ -48,7 +48,12 @@ public abstract class FeatureBaseStructure extends StructureFeature<NoneFeatureC
int m = chunkGenerator.getFirstOccupiedHeight(k, l, Heightmap.Types.WORLD_SURFACE_WG, levelHeightAccessor);
int n = chunkGenerator.getFirstOccupiedHeight(k, l + j, Heightmap.Types.WORLD_SURFACE_WG, levelHeightAccessor);
int o = chunkGenerator.getFirstOccupiedHeight(k + i, l, Heightmap.Types.WORLD_SURFACE_WG, levelHeightAccessor);
int p = chunkGenerator.getFirstOccupiedHeight(k + i, l + j, Heightmap.Types.WORLD_SURFACE_WG, levelHeightAccessor);
int p = chunkGenerator.getFirstOccupiedHeight(
k + i,
l + j,
Heightmap.Types.WORLD_SURFACE_WG,
levelHeightAccessor
);
return Math.min(Math.min(m, n), Math.min(o, p));
}
}

View file

@ -37,7 +37,10 @@ public class GiantIceStarStructure extends SDFStructureFeature {
int count = MHelper.randRange(minCount, maxCount, random);
List<Vector3f> points = getFibonacciPoints(count);
SDF sdf = null;
SDF spike = new SDFCappedCone().setRadius1(3 + (size - 5) * 0.2F).setRadius2(0).setHeight(size).setBlock(EndBlocks.DENSE_SNOW);
SDF spike = new SDFCappedCone().setRadius1(3 + (size - 5) * 0.2F)
.setRadius2(0)
.setHeight(size)
.setBlock(EndBlocks.DENSE_SNOW);
spike = new SDFTranslate().setTranslate(0, size - 0.5F, 0).setSource(spike);
for (Vector3f point : points) {
SDF rotated = spike;
@ -69,7 +72,11 @@ public class GiantIceStarStructure extends SDFStructureFeature {
float px = bpos.getX() - center.getX();
float py = bpos.getY() - center.getY();
float pz = bpos.getZ() - center.getZ();
float distance = MHelper.length(px, py, pz) + sdfCopy.getDistance(px, py, pz) * 0.4F + random.nextFloat() * randScale;
float distance = MHelper.length(px, py, pz) + sdfCopy.getDistance(
px,
py,
pz
) * 0.4F + random.nextFloat() * randScale;
if (distance < ancientRadius) {
return ancient;
}

View file

@ -34,7 +34,8 @@ public class GiantMossyGlowshroomStructure extends SDFStructureFeature {
SDFCappedCone cone1 = new SDFCappedCone().setHeight(2.5F).setRadius1(1.5F).setRadius2(2.5F);
SDFCappedCone cone2 = new SDFCappedCone().setHeight(3F).setRadius1(2.5F).setRadius2(13F);
SDF posedCone2 = new SDFTranslate().setTranslate(0, 5, 0).setSource(cone2);
SDF posedCone3 = new SDFTranslate().setTranslate(0, 12F, 0).setSource(new SDFScale().setScale(2).setSource(cone2));
SDF posedCone3 = new SDFTranslate().setTranslate(0, 12F, 0)
.setSource(new SDFScale().setScale(2).setSource(cone2));
SDF upCone = new SDFSubtraction().setSourceA(posedCone2).setSourceB(posedCone3);
SDF wave = new SDFFlatWave().setRaysCount(12).setIntensity(1.3F).setSource(upCone);
SDF cones = new SDFSmoothUnion().setRadius(3).setSourceA(cone1).setSourceB(wave);
@ -53,18 +54,23 @@ public class GiantMossyGlowshroomStructure extends SDFStructureFeature {
OpenSimplexNoise noise = new OpenSimplexNoise(1234);
cones = new SDFCoordModify().setFunction((pos) -> {
float dist = MHelper.length(pos.x(), pos.z());
float y = pos.y() + (float) noise.eval(pos.x() * 0.1 + center.getX(), pos.z() * 0.1 + center.getZ()) * dist * 0.3F - dist * 0.15F;
float y = pos.y() + (float) noise.eval(
pos.x() * 0.1 + center.getX(),
pos.z() * 0.1 + center.getZ()
) * dist * 0.3F - dist * 0.15F;
pos.set(pos.x(), y, pos.z());
}).setSource(cones);
SDFTranslate HEAD_POS = (SDFTranslate) new SDFTranslate().setSource(new SDFTranslate().setTranslate(0, 2.5F, 0).setSource(cones));
SDFTranslate HEAD_POS = (SDFTranslate) new SDFTranslate().setSource(new SDFTranslate().setTranslate(0, 2.5F, 0)
.setSource(cones));
SDF roots = new SDFSphere().setRadius(4F);
SDFPrimitive primRoots = (SDFPrimitive) roots;
roots = new SDFScale3D().setScale(1, 0.7F, 1).setSource(roots);
SDFFlatWave rotRoots = (SDFFlatWave) new SDFFlatWave().setRaysCount(5).setIntensity(1.5F).setSource(roots);
SDFBinary function = new SDFSmoothUnion().setRadius(4).setSourceB(new SDFUnion().setSourceA(HEAD_POS).setSourceB(rotRoots));
SDFBinary function = new SDFSmoothUnion().setRadius(4)
.setSourceB(new SDFUnion().setSourceA(HEAD_POS).setSourceB(rotRoots));
cone1.setBlock(EndBlocks.MOSSY_GLOWSHROOM_CAP);
cone2.setBlock(EndBlocks.MOSSY_GLOWSHROOM_CAP);
@ -85,38 +91,58 @@ public class GiantMossyGlowshroomStructure extends SDFStructureFeature {
rotRoots.setAngle(random.nextFloat() * MHelper.PI2);
function.setSourceA(sdf);
return new SDFRound().setRadius(1.5F).setSource(new SDFScale().setScale(scale).setSource(function)).addPostProcess((info) -> {
if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getState())) {
if (random.nextBoolean() && info.getStateUp().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) {
info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState().setValue(MossyGlowshroomCapBlock.TRANSITION, true));
return info.getState();
}
else if (!EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateUp()) || !EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown())) {
info.setState(EndBlocks.MOSSY_GLOWSHROOM.bark.defaultBlockState());
return info.getState();
}
}
else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) {
if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown().getBlock())) {
info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState().setValue(MossyGlowshroomCapBlock.TRANSITION, true));
return info.getState();
}
return new SDFRound().setRadius(1.5F)
.setSource(new SDFScale().setScale(scale).setSource(function))
.addPostProcess((info) -> {
if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getState())) {
if (random.nextBoolean() && info.getStateUp()
.getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) {
info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState()
.setValue(
MossyGlowshroomCapBlock.TRANSITION,
true
));
return info.getState();
}
else if (!EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateUp()) || !EndBlocks.MOSSY_GLOWSHROOM
.isTreeLog(info.getStateDown())) {
info.setState(EndBlocks.MOSSY_GLOWSHROOM.bark.defaultBlockState());
return info.getState();
}
}
else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) {
if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown().getBlock())) {
info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState()
.setValue(
MossyGlowshroomCapBlock.TRANSITION,
true
));
return info.getState();
}
info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState());
return info.getState();
}
else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) {
for (Direction dir : BlocksHelper.HORIZONTAL) {
if (info.getState(dir) == AIR) {
info.setBlockPos(info.getPos().relative(dir), EndBlocks.MOSSY_GLOWSHROOM_FUR.defaultBlockState().setValue(FurBlock.FACING, dir));
}
}
info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.defaultBlockState());
return info.getState();
}
else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) {
for (Direction dir : BlocksHelper.HORIZONTAL) {
if (info.getState(dir) == AIR) {
info.setBlockPos(
info.getPos().relative(dir),
EndBlocks.MOSSY_GLOWSHROOM_FUR.defaultBlockState()
.setValue(FurBlock.FACING, dir)
);
}
}
if (info.getStateDown().getBlock() != EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) {
info.setBlockPos(info.getPos().below(), EndBlocks.MOSSY_GLOWSHROOM_FUR.defaultBlockState().setValue(FurBlock.FACING, Direction.DOWN));
}
}
return info.getState();
});
if (info.getStateDown().getBlock() != EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) {
info.setBlockPos(
info.getPos().below(),
EndBlocks.MOSSY_GLOWSHROOM_FUR.defaultBlockState()
.setValue(FurBlock.FACING, Direction.DOWN)
);
}
}
return info.getState();
});
}
}

View file

@ -33,7 +33,13 @@ public class MountainStructure extends FeatureBaseStructure {
if (y > 5) {
float radius = MHelper.randRange(50, 100, random);
float height = radius * MHelper.randRange(0.8F, 1.2F, random);
CrystalMountainPiece piece = new CrystalMountainPiece(new BlockPos(x, y, z), radius, height, random, biome);
CrystalMountainPiece piece = new CrystalMountainPiece(
new BlockPos(x, y, z),
radius,
height,
random,
biome
);
this.pieces.add(piece);
}

View file

@ -51,6 +51,10 @@ public class PaintedMountainStructure extends FeatureBaseStructure {
}
static {
VARIANTS = new BlockState[]{Blocks.END_STONE.defaultBlockState(), EndBlocks.FLAVOLITE.stone.defaultBlockState(), EndBlocks.VIOLECITE.stone.defaultBlockState(),};
VARIANTS = new BlockState[] {
Blocks.END_STONE.defaultBlockState(),
EndBlocks.FLAVOLITE.stone.defaultBlockState(),
EndBlocks.VIOLECITE.stone.defaultBlockState(),
};
}
}

View file

@ -68,7 +68,8 @@ public class CrystalMountainPiece extends MountainPiece {
continue;
}
pos.setY(minY);
while (!chunk.getBlockState(pos).is(TagAPI.GEN_TERRAIN) && pos.getY() > 56 && !chunk.getBlockState(pos.below()).is(Blocks.CAVE_AIR)) {
while (!chunk.getBlockState(pos).is(TagAPI.GEN_TERRAIN) && pos.getY() > 56 && !chunk.getBlockState(
pos.below()).is(Blocks.CAVE_AIR)) {
pos.setY(pos.getY() - 1);
}
minY = pos.getY();
@ -81,10 +82,18 @@ public class CrystalMountainPiece extends MountainPiece {
maxY += center.getY();
int maxYI = (int) (maxY);
int cover = maxYI - 1;
boolean needCover = (noise1.eval(px * 0.1, pz * 0.1) + MHelper.randRange(-0.4, 0.4, random) - (center.getY() + 14) * 0.1) > 0;
boolean needCover = (noise1.eval(px * 0.1, pz * 0.1) + MHelper.randRange(
-0.4,
0.4,
random
) - (center.getY() + 14) * 0.1) > 0;
for (int y = minY - 1; y < maxYI; y++) {
pos.setY(y);
chunk.setBlockState(pos, needCover && y == cover ? top : Blocks.END_STONE.defaultBlockState(), false);
chunk.setBlockState(
pos,
needCover && y == cover ? top : Blocks.END_STONE.defaultBlockState(),
false
);
}
}
}

View file

@ -125,13 +125,20 @@ public class LakePiece extends BasePiece {
else if (dist <= r3 && mut.getY() < center.getY()) {
BlockState state = chunk.getBlockState(mut);
BlockPos worldPos = mut.offset(sx, 0, sz);
if (!state.isCollisionShapeFullBlock(world, worldPos) && !state.isRedstoneConductor(world, worldPos)) {
if (!state.isCollisionShapeFullBlock(world, worldPos) && !state.isRedstoneConductor(
world,
worldPos
)) {
state = chunk.getBlockState(mut.above());
if (state.isAir()) {
state = random.nextBoolean() ? ENDSTONE : world.getBiome(worldPos).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
state = random.nextBoolean() ? ENDSTONE : world.getBiome(worldPos)
.getGenerationSettings()
.getSurfaceBuilderConfig()
.getTopMaterial();
}
else {
state = state.getFluidState().isEmpty() ? ENDSTONE : EndBlocks.ENDSTONE_DUST.defaultBlockState();
state = state.getFluidState()
.isEmpty() ? ENDSTONE : EndBlocks.ENDSTONE_DUST.defaultBlockState();
}
chunk.setBlockState(mut, state, false);
}
@ -160,10 +167,14 @@ public class LakePiece extends BasePiece {
BlockState bState = chunk.getBlockState(mut);
if (bState.isAir()) {
bState = random.nextBoolean() ? ENDSTONE : world.getBiome(mut.offset(sx, 0, sz)).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
bState = random.nextBoolean() ? ENDSTONE : world.getBiome(mut.offset(sx, 0, sz))
.getGenerationSettings()
.getSurfaceBuilderConfig()
.getTopMaterial();
}
else {
bState = bState.getFluidState().isEmpty() ? ENDSTONE : EndBlocks.ENDSTONE_DUST.defaultBlockState();
bState = bState.getFluidState()
.isEmpty() ? ENDSTONE : EndBlocks.ENDSTONE_DUST.defaultBlockState();
}
mut.setY(y);
@ -178,10 +189,14 @@ public class LakePiece extends BasePiece {
mut.setY(y + 1);
BlockState bState = chunk.getBlockState(mut);
if (bState.isAir()) {
bState = random.nextBoolean() ? ENDSTONE : world.getBiome(mut.offset(sx, 0, sz)).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
bState = random.nextBoolean() ? ENDSTONE : world.getBiome(mut.offset(sx, 0, sz))
.getGenerationSettings()
.getSurfaceBuilderConfig()
.getTopMaterial();
}
else {
bState = bState.getFluidState().isEmpty() ? ENDSTONE : EndBlocks.ENDSTONE_DUST.defaultBlockState();
bState = bState.getFluidState()
.isEmpty() ? ENDSTONE : EndBlocks.ENDSTONE_DUST.defaultBlockState();
}
mut.setY(y);
makeEndstonePillar(chunk, mut, bState);

View file

@ -93,7 +93,10 @@ public abstract class MountainPiece extends BasePiece {
return h;
}
h = MHelper.floor(noise2.eval(pos.getX() * 0.01, pos.getZ() * 0.01) * noise2.eval(pos.getX() * 0.002, pos.getZ() * 0.002) * 8 + 8);
h = MHelper.floor(noise2.eval(pos.getX() * 0.01, pos.getZ() * 0.01) * noise2.eval(
pos.getX() * 0.002,
pos.getZ() * 0.002
) * 8 + 8);
if (h < 0) {
heightmap.put(p, 0);

View file

@ -70,8 +70,14 @@ public class NBTPiece extends BasePiece {
@Override
public boolean postProcess(WorldGenLevel world, StructureFeatureManager arg, ChunkGenerator chunkGenerator, Random random, BoundingBox blockBox, ChunkPos chunkPos, BlockPos blockPos) {
BoundingBox bounds = BoundingBox.fromCorners(new Vec3i(blockBox.minX(), this.boundingBox.minY(), blockBox.minZ()), new Vec3i(blockBox.maxX(), this.boundingBox.maxX(), blockBox.maxZ()));
StructurePlaceSettings placementData = new StructurePlaceSettings().setRotation(rotation).setMirror(mirror).setBoundingBox(bounds);
BoundingBox bounds = BoundingBox.fromCorners(new Vec3i(
blockBox.minX(),
this.boundingBox.minY(),
blockBox.minZ()
), new Vec3i(blockBox.maxX(), this.boundingBox.maxX(), blockBox.maxZ()));
StructurePlaceSettings placementData = new StructurePlaceSettings().setRotation(rotation)
.setMirror(mirror)
.setBoundingBox(bounds);
structure.placeInWorld(world, pos, pos, placementData, random, 2);
if (erosion > 0) {
int x1 = MHelper.min(bounds.maxX(), boundingBox.maxX());

View file

@ -87,7 +87,10 @@ public class PaintedMountainPiece extends MountainPiece {
maxY *= (float) noise1.eval(px * 0.05, pz * 0.05) * 0.3F + 0.7F;
maxY *= (float) noise1.eval(px * 0.1, pz * 0.1) * 0.1F + 0.9F;
maxY += center.getY();
float offset = (float) (noise1.eval(px * 0.07, pz * 0.07) * 5 + noise1.eval(px * 0.2, pz * 0.2) * 2 + 7);
float offset = (float) (noise1.eval(px * 0.07, pz * 0.07) * 5 + noise1.eval(
px * 0.2,
pz * 0.2
) * 2 + 7);
for (int y = minY - 1; y < maxY; y++) {
pos.setY(y);
int index = MHelper.floor((y + offset) * 0.65F) % slises.length;

View file

@ -1,6 +1,5 @@
package ru.betterend.world.surface;
import net.minecraft.core.Registry;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.chunk.ChunkAccess;
@ -20,18 +19,78 @@ public class SulphuricSurfaceBuilder extends SurfaceBuilder<SurfaceBuilderBaseCo
@Override
public void apply(Random random, ChunkAccess chunk, Biome biome, int x, int z, int height, double noise, BlockState defaultBlock, BlockState defaultFluid, int seaLevel, int seed, long n, SurfaceBuilderBaseConfiguration surfaceBlocks) {
double value = NOISE.eval(x * 0.03, z * 0.03) + NOISE.eval(x * 0.1, z * 0.1) * 0.3 + MHelper.randRange(-0.1, 0.1, MHelper.RANDOM);
double value = NOISE.eval(x * 0.03, z * 0.03) + NOISE.eval(x * 0.1, z * 0.1) * 0.3 + MHelper.randRange(
-0.1,
0.1,
MHelper.RANDOM
);
if (value < -0.6) {
SurfaceBuilder.DEFAULT.apply(random, chunk, biome, x, z, height, noise, defaultBlock, defaultFluid, seaLevel, seed, n, SurfaceBuilders.DEFAULT_END_CONFIG);
SurfaceBuilder.DEFAULT.apply(
random,
chunk,
biome,
x,
z,
height,
noise,
defaultBlock,
defaultFluid,
seaLevel,
seed,
n,
SurfaceBuilders.DEFAULT_END_CONFIG
);
}
else if (value < -0.3) {
SurfaceBuilder.DEFAULT.apply(random, chunk, biome, x, z, height, noise, defaultBlock, defaultFluid, seaLevel, seed, n, SurfaceBuilders.FLAVOLITE_CONFIG);
SurfaceBuilder.DEFAULT.apply(
random,
chunk,
biome,
x,
z,
height,
noise,
defaultBlock,
defaultFluid,
seaLevel,
seed,
n,
SurfaceBuilders.FLAVOLITE_CONFIG
);
}
else if (value < 0.5) {
SurfaceBuilder.DEFAULT.apply(random, chunk, biome, x, z, height, noise, defaultBlock, defaultFluid, seaLevel, seed, n, SurfaceBuilders.SULFURIC_ROCK_CONFIG);
SurfaceBuilder.DEFAULT.apply(
random,
chunk,
biome,
x,
z,
height,
noise,
defaultBlock,
defaultFluid,
seaLevel,
seed,
n,
SurfaceBuilders.SULFURIC_ROCK_CONFIG
);
}
else {
SurfaceBuilder.DEFAULT.apply(random, chunk, biome, x, z, height, noise, defaultBlock, defaultFluid, seaLevel, seed, n, SurfaceBuilders.BRIMSTONE_CONFIG);
SurfaceBuilder.DEFAULT.apply(
random,
chunk,
biome,
x,
z,
height,
noise,
defaultBlock,
defaultFluid,
seaLevel,
seed,
n,
SurfaceBuilders.BRIMSTONE_CONFIG
);
}
}

View file

@ -4,7 +4,6 @@ import net.minecraft.core.Registry;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.surfacebuilders.DefaultSurfaceBuilder;
import net.minecraft.world.level.levelgen.surfacebuilders.SurfaceBuilder;
import net.minecraft.world.level.levelgen.surfacebuilders.SurfaceBuilderBaseConfiguration;
import ru.betterend.registry.EndBlocks;
@ -16,8 +15,14 @@ public class SurfaceBuilders {
public static final SurfaceBuilderBaseConfiguration SULFURIC_ROCK_CONFIG = makeSimpleConfig(EndBlocks.SULPHURIC_ROCK.stone);
public static final SurfaceBuilderBaseConfiguration UMBRA_SURFACE_CONFIG = makeSimpleConfig(EndBlocks.UMBRALITH.stone);
public static final SurfaceBuilder<SurfaceBuilderBaseConfiguration> SULPHURIC_SURFACE = register("sulphuric_surface", new SulphuricSurfaceBuilder());
public static final SurfaceBuilder<SurfaceBuilderBaseConfiguration> UMBRA_SURFACE = register("umbra_surface", new UmbraSurfaceBuilder());
public static final SurfaceBuilder<SurfaceBuilderBaseConfiguration> SULPHURIC_SURFACE = register(
"sulphuric_surface",
new SulphuricSurfaceBuilder()
);
public static final SurfaceBuilder<SurfaceBuilderBaseConfiguration> UMBRA_SURFACE = register(
"umbra_surface",
new UmbraSurfaceBuilder()
);
private static SurfaceBuilder<SurfaceBuilderBaseConfiguration> register(String name, SurfaceBuilder<SurfaceBuilderBaseConfiguration> builder) {
return Registry.register(Registry.SURFACE_BUILDER, name, builder);

View file

@ -19,6 +19,20 @@ public class UmbraSurfaceBuilder extends SurfaceBuilder<SurfaceBuilderBaseConfig
@Override
public void apply(Random random, ChunkAccess chunk, Biome biome, int x, int z, int height, double noise, BlockState defaultBlock, BlockState defaultFluid, int seaLevel, int seed, long n, SurfaceBuilderBaseConfiguration surfaceBlocks) {
int depth = (int) (NOISE.eval(x * 0.1, z * 0.1) * 20 + NOISE.eval(x * 0.5, z * 0.5) * 10 + 60);
SurfaceBuilder.DEFAULT.apply(random, chunk, biome, x, z, height, noise + depth, defaultBlock, defaultFluid, seaLevel, seed, n, SurfaceBuilders.UMBRA_SURFACE_CONFIG);
SurfaceBuilder.DEFAULT.apply(
random,
chunk,
biome,
x,
z,
height,
noise + depth,
defaultBlock,
defaultFluid,
seaLevel,
seed,
n,
SurfaceBuilders.UMBRA_SURFACE_CONFIG
);
}
}