Continue migration
This commit is contained in:
parent
47ed597358
commit
33dbfbe633
263 changed files with 1450 additions and 1486 deletions
|
@ -5,8 +5,8 @@ import java.util.stream.Collectors;
|
|||
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.util.collection.WeightedList;
|
||||
import net.minecraft.util.registry.BuiltinRegistries;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.data.BuiltinRegistries;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import ru.betterend.integration.Integrations;
|
||||
import ru.betterend.integration.ModIntegration;
|
||||
import ru.betterend.integration.byg.biomes.BYGBiomes;
|
||||
|
|
|
@ -3,8 +3,8 @@ package ru.betterend.integration.byg.biomes;
|
|||
import java.util.List;
|
||||
|
||||
import net.minecraft.world.entity.SpawnGroup;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.biome.BiomeEffects;
|
||||
import net.minecraft.world.biome.SpawnSettings.SpawnEntry;
|
||||
import ru.betterend.BetterEnd;
|
||||
|
|
|
@ -4,8 +4,8 @@ import java.util.List;
|
|||
|
||||
import net.minecraft.world.entity.SpawnGroup;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.biome.BiomeEffects;
|
||||
import net.minecraft.world.biome.SpawnSettings.SpawnEntry;
|
||||
import net.minecraft.world.gen.GenerationStep.Feature;
|
||||
|
|
|
@ -6,16 +6,16 @@ import java.util.function.Supplier;
|
|||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.entity.SpawnGroup;
|
||||
import net.minecraft.core.particles.ParticleTypes;
|
||||
import net.minecraft.sound.SoundEvent;
|
||||
import net.minecraft.sounds.SoundEvent;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.util.registry.BuiltinRegistries;
|
||||
import net.minecraft.data.BuiltinRegistries;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.biome.BiomeEffects;
|
||||
import net.minecraft.world.biome.SpawnSettings.SpawnEntry;
|
||||
import net.minecraft.world.gen.GenerationStep.Feature;
|
||||
import net.minecraft.world.gen.feature.ConfiguredFeature;
|
||||
import net.minecraft.world.gen.feature.ConfiguredFeatures;
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
|
||||
import net.minecraft.world.level.levelgen.feature.ConfiguredFeatures;
|
||||
import ru.betterend.BetterEnd;
|
||||
import ru.betterend.integration.Integrations;
|
||||
import ru.betterend.integration.byg.features.BYGFeatures;
|
||||
|
@ -33,7 +33,7 @@ public class OldBulbisGardens extends EndBiome {
|
|||
BiomeEffects effects = biome.getEffects();
|
||||
|
||||
Block ivis = Integrations.BYG.getBlock("ivis_phylium");
|
||||
Block origin = biome.getGenerationSettings().getSurfaceConfig().getTopMaterial().getBlock();
|
||||
Block origin = biome.getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial().getBlock();
|
||||
BiomeDefinition def = new BiomeDefinition("old_bulbis_gardens").setFogColor(215, 132, 207).setFogDensity(1.8F)
|
||||
.setWaterAndFogColor(40, 0, 56).setFoliageColor(122, 17, 155)
|
||||
.setParticles(ParticleTypes.REVERSE_PORTAL, 0.002F).setSurface(ivis, origin)
|
||||
|
|
|
@ -7,11 +7,11 @@ import com.google.common.base.Function;
|
|||
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import com.mojang.math.Vector3f;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.betterend.integration.Integrations;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.MHelper;
|
||||
|
@ -21,8 +21,8 @@ import ru.betterend.world.features.DefaultFeature;
|
|||
|
||||
public class BigEtherTreeFeature extends DefaultFeature {
|
||||
@Override
|
||||
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
DefaultFeatureConfig config) {
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().isIn(EndTags.END_GROUND))
|
||||
return false;
|
||||
|
||||
|
@ -77,7 +77,7 @@ public class BigEtherTreeFeature extends DefaultFeature {
|
|||
return true;
|
||||
}
|
||||
|
||||
// private void makeLeavesSphere(StructureWorldAccess world, BlockPos pos,
|
||||
// private void makeLeavesSphere(WorldGenLevel world, BlockPos pos,
|
||||
// BlockState leaves, Function<BlockState, Boolean> ignore) {
|
||||
//
|
||||
// }
|
||||
|
|
|
@ -10,13 +10,13 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.LeavesBlock;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import com.mojang.math.Vector3f;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.betterend.integration.Integrations;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
@ -35,8 +35,8 @@ public class GreatNightshadeTreeFeature extends DefaultFeature {
|
|||
private static final List<Vector3f> BRANCH;
|
||||
|
||||
@Override
|
||||
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
DefaultFeatureConfig config) {
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().isIn(EndTags.END_GROUND))
|
||||
return false;
|
||||
|
||||
|
|
|
@ -10,13 +10,13 @@ import net.minecraft.world.level.block.state.BlockState;
|
|||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.LeavesBlock;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import com.mojang.math.Vector3f;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.betterend.integration.Integrations;
|
||||
import ru.betterend.registry.EndTags;
|
||||
import ru.betterend.util.BlocksHelper;
|
||||
|
@ -35,8 +35,8 @@ public class NightshadeRedwoodTreeFeature extends DefaultFeature {
|
|||
private static final List<Vector3f> BRANCH;
|
||||
|
||||
@Override
|
||||
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
DefaultFeatureConfig config) {
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().isIn(EndTags.END_GROUND))
|
||||
return false;
|
||||
|
||||
|
|
|
@ -9,13 +9,13 @@ import com.google.common.collect.Lists;
|
|||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.material.Material;
|
||||
import net.minecraft.client.util.math.Vector3f;
|
||||
import com.mojang.math.Vector3f;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.util.math.Box;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
|
||||
import ru.betterend.integration.Integrations;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
@ -36,8 +36,8 @@ public class OldBulbisTreeFeature extends DefaultFeature {
|
|||
private static final List<Vector3f> SIDE;
|
||||
|
||||
@Override
|
||||
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
DefaultFeatureConfig config) {
|
||||
public boolean place(WorldGenLevel world, ChunkGenerator chunkGenerator, Random random, BlockPos pos,
|
||||
NoneFeatureConfiguration config) {
|
||||
if (!world.getBlockState(pos.below()).getBlock().isIn(EndTags.END_GROUND))
|
||||
return false;
|
||||
if (!world.getBlockState(pos.down(4)).getBlock().isIn(EndTags.GEN_TERRAIN))
|
||||
|
@ -82,11 +82,9 @@ public class OldBulbisTreeFeature extends DefaultFeature {
|
|||
|
||||
Vector3f vec = spline.get(spline.size() - 1);
|
||||
float radius = (size + MHelper.randRange(0, size * 0.5F, random)) * 0.35F;
|
||||
bigSphere(world, pos.offset(vec.getX(), vec.getY(), vec.getZ()), radius, cap, glow, wood, replacement,
|
||||
random);
|
||||
bigSphere(world, pos.offset(vec.x(), vec.y(), vec.z()), radius, cap, glow, wood, replacement, random);
|
||||
vec = SplineHelper.getPos(spline, 0.3F);
|
||||
makeRoots(world, pos.offset(vec.getX(), vec.getY(), vec.getZ()), size * 0.4F + 5, random, wood,
|
||||
replacement);
|
||||
makeRoots(world, pos.offset(vec.x(), vec.y(), vec.z()), size * 0.4F + 5, random, wood, replacement);
|
||||
|
||||
sdf = (sdf == null) ? branch : new SDFUnion().setSourceA(sdf).setSourceB(branch);
|
||||
}
|
||||
|
@ -102,19 +100,19 @@ public class OldBulbisTreeFeature extends DefaultFeature {
|
|||
return true;
|
||||
}
|
||||
|
||||
private void bigSphere(StructureWorldAccess world, BlockPos pos, float radius, BlockState cap, BlockState glow,
|
||||
private void bigSphere(WorldGenLevel world, BlockPos pos, float radius, BlockState cap, BlockState glow,
|
||||
BlockState wood, Function<BlockState, Boolean> replacement, Random random) {
|
||||
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong());
|
||||
SDF sphere = new SDFSphere().setRadius(radius).setBlock(cap);
|
||||
|
||||
SDF sphereInner = new SDFSphere().setRadius(radius * 0.53F).setBlock(Blocks.AIR);
|
||||
sphereInner = new SDFDisplacement().setFunction((vec) -> {
|
||||
return (float) noise.eval(vec.getX() * 0.1, vec.getY() * 0.1, vec.getZ() * 0.1);
|
||||
return (float) noise.eval(vec.x() * 0.1, vec.y() * 0.1, vec.z() * 0.1);
|
||||
}).setSource(sphereInner);
|
||||
|
||||
SDF sphereGlow = new SDFSphere().setRadius(radius * 0.6F).setBlock(glow);
|
||||
sphereGlow = new SDFDisplacement().setFunction((vec) -> {
|
||||
return (float) noise.eval(vec.getX() * 0.1, vec.getY() * 0.1, vec.getZ() * 0.1) * 2F;
|
||||
return (float) noise.eval(vec.x() * 0.1, vec.y() * 0.1, vec.z() * 0.1) * 2F;
|
||||
}).setSource(sphereGlow);
|
||||
sphereGlow = new SDFSubtraction().setSourceA(sphereGlow).setSourceB(sphereInner);
|
||||
|
||||
|
@ -150,7 +148,7 @@ public class OldBulbisTreeFeature extends DefaultFeature {
|
|||
sphere.fillArea(world, pos, new Box(pos.up((int) offsetY)).expand(radius * 1.3F));
|
||||
}
|
||||
|
||||
private void makeRoots(StructureWorldAccess world, BlockPos pos, float radius, Random random, BlockState wood,
|
||||
private void makeRoots(WorldGenLevel world, BlockPos pos, float radius, Random random, BlockState wood,
|
||||
Function<BlockState, Boolean> replacement) {
|
||||
int count = (int) (radius * 1.5F);
|
||||
for (int i = 0; i < count; i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue