Megalake Grove

This commit is contained in:
paulevsGitch 2020-10-28 00:49:01 +03:00
parent 91b40a3ae6
commit 7c6da348ef
5 changed files with 51 additions and 6 deletions

View file

@ -23,6 +23,7 @@ import ru.betterend.world.biome.BiomeCrystalMountains;
import ru.betterend.world.biome.BiomeDustWastelands; import ru.betterend.world.biome.BiomeDustWastelands;
import ru.betterend.world.biome.BiomeFoggyMushroomland; import ru.betterend.world.biome.BiomeFoggyMushroomland;
import ru.betterend.world.biome.BiomeMegalake; import ru.betterend.world.biome.BiomeMegalake;
import ru.betterend.world.biome.BiomeMegalakeGrove;
import ru.betterend.world.biome.BiomePaintedMountains; import ru.betterend.world.biome.BiomePaintedMountains;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
import ru.betterend.world.generator.BiomePicker; import ru.betterend.world.generator.BiomePicker;
@ -53,6 +54,7 @@ public class EndBiomes {
public static final EndBiome CHORUS_FOREST = registerBiome(new BiomeChorusForest(), BiomeType.LAND); public static final EndBiome CHORUS_FOREST = registerBiome(new BiomeChorusForest(), BiomeType.LAND);
public static final EndBiome DUST_WASTELANDS = registerBiome(new BiomeDustWastelands(), BiomeType.LAND); public static final EndBiome DUST_WASTELANDS = registerBiome(new BiomeDustWastelands(), BiomeType.LAND);
public static final EndBiome MEGALAKE = registerBiome(new BiomeMegalake(), BiomeType.LAND); public static final EndBiome MEGALAKE = registerBiome(new BiomeMegalake(), BiomeType.LAND);
public static final EndBiome MEGALAKE_GROVE = registerSubBiome(new BiomeMegalakeGrove(), MEGALAKE);
public static final EndBiome CRYSTAL_MOUNTAINS = registerBiome(new BiomeCrystalMountains(), BiomeType.LAND); public static final EndBiome CRYSTAL_MOUNTAINS = registerBiome(new BiomeCrystalMountains(), BiomeType.LAND);
public static final EndBiome PAINTED_MOUNTAINS = registerSubBiome(new BiomePaintedMountains(), DUST_WASTELANDS); public static final EndBiome PAINTED_MOUNTAINS = registerSubBiome(new BiomePaintedMountains(), DUST_WASTELANDS);

View file

@ -5,6 +5,7 @@ import net.minecraft.world.gen.feature.ConfiguredStructureFeatures;
import ru.betterend.registry.EndBlocks; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndEntities; import ru.betterend.registry.EndEntities;
import ru.betterend.registry.EndFeatures; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndParticles;
import ru.betterend.registry.EndSounds; import ru.betterend.registry.EndSounds;
import ru.betterend.registry.EndStructures; import ru.betterend.registry.EndStructures;
@ -16,13 +17,12 @@ public class BiomeMegalake extends EndBiome {
.setWaterColor(96, 163, 255) .setWaterColor(96, 163, 255)
.setWaterFogColor(96, 163, 255) .setWaterFogColor(96, 163, 255)
.setFogDensity(1.75F) .setFogDensity(1.75F)
.setParticles(EndParticles.GLOWING_SPHERE, 0.0003F)
.setMusic(EndSounds.MUSIC_MEGALAKE) .setMusic(EndSounds.MUSIC_MEGALAKE)
.setLoop(EndSounds.AMBIENT_MEGALAKE) .setLoop(EndSounds.AMBIENT_MEGALAKE)
//.setSurface(EndBlocks.ENDSTONE_DUST, EndBlocks.END_MOSS) .setSurface(EndBlocks.END_MOSS, EndBlocks.ENDSTONE_DUST)
.setSurface(EndBlocks.END_MOSS)
.addStructureFeature(EndStructures.MEGALAKE) .addStructureFeature(EndStructures.MEGALAKE)
.addStructureFeature(ConfiguredStructureFeatures.END_CITY) .addStructureFeature(ConfiguredStructureFeatures.END_CITY)
.addFeature(EndFeatures.LACUGROVE)
.addFeature(EndFeatures.END_LOTUS) .addFeature(EndFeatures.END_LOTUS)
.addFeature(EndFeatures.END_LOTUS_LEAF) .addFeature(EndFeatures.END_LOTUS_LEAF)
.addFeature(EndFeatures.BUBBLE_CORAL_RARE) .addFeature(EndFeatures.BUBBLE_CORAL_RARE)

View file

@ -0,0 +1,37 @@
package ru.betterend.world.biome;
import net.minecraft.entity.EntityType;
import net.minecraft.world.gen.feature.ConfiguredStructureFeatures;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndEntities;
import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndParticles;
import ru.betterend.registry.EndSounds;
import ru.betterend.registry.EndStructures;
public class BiomeMegalakeGrove extends EndBiome {
public BiomeMegalakeGrove() {
super(new BiomeDefinition("megalake_grove")
.setPlantsColor(73, 210, 209)
.setFogColor(178, 209, 248)
.setWaterColor(96, 163, 255)
.setWaterFogColor(96, 163, 255)
.setFogDensity(1.75F)
.setParticles(EndParticles.GLOWING_SPHERE, 0.0003F)
.setMusic(EndSounds.MUSIC_MEGALAKE)
.setLoop(EndSounds.AMBIENT_MEGALAKE)
.setSurface(EndBlocks.END_MOSS)
.addStructureFeature(EndStructures.MEGALAKE)
.addStructureFeature(ConfiguredStructureFeatures.END_CITY)
.addFeature(EndFeatures.LACUGROVE)
.addFeature(EndFeatures.END_LOTUS)
.addFeature(EndFeatures.END_LOTUS_LEAF)
.addFeature(EndFeatures.BUBBLE_CORAL)
.addFeature(EndFeatures.END_LILY)
.addFeature(EndFeatures.UMBRELLA_MOSS)
.addFeature(EndFeatures.CREEPING_MOSS)
.addMobSpawn(EndEntities.DRAGONFLY, 20, 1, 3)
.addMobSpawn(EndEntities.END_FISH, 20, 3, 8)
.addMobSpawn(EntityType.ENDERMAN, 10, 1, 2));
}
}

View file

@ -32,7 +32,7 @@ public class StructureMegaLake extends StructureFeatureBase {
if (y > 5) { if (y > 5) {
float radius = MHelper.randRange(50, 100, random); float radius = MHelper.randRange(50, 100, random);
float depth = MHelper.randRange(10, 16, random); float depth = MHelper.randRange(10, 16, random);
LakePiece piece = new LakePiece(new BlockPos(x, y, z), radius, depth, random.nextInt()); LakePiece piece = new LakePiece(new BlockPos(x, y, z), radius, depth, random.nextInt(), biome);
this.children.add(piece); this.children.add(piece);
} }
this.setBoundingBoxFromChildren(); this.setBoundingBoxFromChildren();

View file

@ -10,6 +10,7 @@ import net.minecraft.block.Blocks;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtHelper; import net.minecraft.nbt.NbtHelper;
import net.minecraft.structure.StructureManager; import net.minecraft.structure.StructureManager;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockBox; import net.minecraft.util.math.BlockBox;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockPos.Mutable; import net.minecraft.util.math.BlockPos.Mutable;
@ -18,6 +19,7 @@ import net.minecraft.util.math.MathHelper;
import net.minecraft.world.Heightmap; import net.minecraft.world.Heightmap;
import net.minecraft.world.Heightmap.Type; import net.minecraft.world.Heightmap.Type;
import net.minecraft.world.StructureWorldAccess; import net.minecraft.world.StructureWorldAccess;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.gen.StructureAccessor; import net.minecraft.world.gen.StructureAccessor;
import net.minecraft.world.gen.chunk.ChunkGenerator; import net.minecraft.world.gen.chunk.ChunkGenerator;
@ -36,14 +38,16 @@ public class LakePiece extends BasePiece {
private float radius; private float radius;
private float depth; private float depth;
private float r2; private float r2;
private Identifier biomeID;
public LakePiece(BlockPos center, float radius, float depth, int id) { public LakePiece(BlockPos center, float radius, float depth, int id, Biome biome) {
super(EndStructures.LAKE_PIECE, id); super(EndStructures.LAKE_PIECE, id);
this.center = center; this.center = center;
this.radius = radius; this.radius = radius;
this.depth = depth; this.depth = depth;
this.r2 = radius * radius; this.r2 = radius * radius;
this.noise = new OpenSimplexNoise(MHelper.getSeed(534, center.getX(), center.getZ())); this.noise = new OpenSimplexNoise(MHelper.getSeed(534, center.getX(), center.getZ()));
this.biomeID = EndBiomes.getBiomeID(biome);
makeBoundingBox(); makeBoundingBox();
} }
@ -57,6 +61,7 @@ public class LakePiece extends BasePiece {
tag.put("center", NbtHelper.fromBlockPos(center)); tag.put("center", NbtHelper.fromBlockPos(center));
tag.putFloat("radius", radius); tag.putFloat("radius", radius);
tag.putFloat("depth", depth); tag.putFloat("depth", depth);
tag.putString("biome", biomeID.toString());
} }
@Override @Override
@ -66,6 +71,7 @@ public class LakePiece extends BasePiece {
depth = tag.getFloat("depth"); depth = tag.getFloat("depth");
r2 = radius * radius; r2 = radius * radius;
noise = new OpenSimplexNoise(MHelper.getSeed(534, center.getX(), center.getZ())); noise = new OpenSimplexNoise(MHelper.getSeed(534, center.getX(), center.getZ()));
biomeID = new Identifier(tag.getString("biome"));
} }
@Override @Override
@ -157,7 +163,7 @@ public class LakePiece extends BasePiece {
return h; return h;
} }
if (EndBiomes.getFromBiome(world.getBiome(pos)) != EndBiomes.MEGALAKE) { if (!EndBiomes.getBiomeID(world.getBiome(pos)).equals(biomeID)) {
heightmap.put(p, -4); heightmap.put(p, -4);
return -4; return -4;
} }