Continue migration
This commit is contained in:
parent
47ed597358
commit
33dbfbe633
263 changed files with 1450 additions and 1486 deletions
|
@ -10,9 +10,9 @@ import net.minecraft.util.math.BlockBox;
|
|||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.gen.StructureAccessor;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndStructures;
|
||||
import ru.betterend.registry.EndTags;
|
||||
|
@ -38,8 +38,8 @@ public class CavePiece extends BasePiece {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean generate(StructureWorldAccess world, StructureAccessor arg, ChunkGenerator chunkGenerator,
|
||||
Random random, BlockBox blockBox, ChunkPos chunkPos, BlockPos blockPos) {
|
||||
public boolean place(WorldGenLevel world, StructureAccessor arg, ChunkGenerator chunkGenerator, Random random,
|
||||
BlockBox blockBox, ChunkPos chunkPos, BlockPos blockPos) {
|
||||
int x1 = MHelper.max(this.boundingBox.minX, blockBox.minX);
|
||||
int z1 = MHelper.max(this.boundingBox.minZ, blockBox.minZ);
|
||||
int x2 = MHelper.min(this.boundingBox.maxX, blockBox.maxX);
|
||||
|
|
|
@ -13,11 +13,11 @@ import net.minecraft.util.math.ChunkPos;
|
|||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.Heightmap;
|
||||
import net.minecraft.world.Heightmap.Type;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.gen.StructureAccessor;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
import ru.betterend.registry.EndStructures;
|
||||
|
@ -29,7 +29,7 @@ public class CrystalMountainPiece extends MountainPiece {
|
|||
|
||||
public CrystalMountainPiece(BlockPos center, float radius, float height, Random random, Biome biome) {
|
||||
super(EndStructures.MOUNTAIN_PIECE, center, radius, height, random, biome);
|
||||
top = biome.getGenerationSettings().getSurfaceConfig().getTopMaterial();
|
||||
top = biome.getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
|
||||
}
|
||||
|
||||
public CrystalMountainPiece(StructureManager manager, CompoundTag tag) {
|
||||
|
@ -39,12 +39,12 @@ public class CrystalMountainPiece extends MountainPiece {
|
|||
@Override
|
||||
protected void fromNbt(CompoundTag tag) {
|
||||
super.fromNbt(tag);
|
||||
top = EndBiomes.getBiome(biomeID).getBiome().getGenerationSettings().getSurfaceConfig().getTopMaterial();
|
||||
top = EndBiomes.getBiome(biomeID).getBiome().getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean generate(StructureWorldAccess world, StructureAccessor arg, ChunkGenerator chunkGenerator,
|
||||
Random random, BlockBox blockBox, ChunkPos chunkPos, BlockPos blockPos) {
|
||||
public boolean place(WorldGenLevel world, StructureAccessor arg, ChunkGenerator chunkGenerator, Random random,
|
||||
BlockBox blockBox, ChunkPos chunkPos, BlockPos blockPos) {
|
||||
int sx = chunkPos.getStartX();
|
||||
int sz = chunkPos.getStartZ();
|
||||
MutableBlockPos pos = new MutableBlockPos();
|
||||
|
|
|
@ -19,11 +19,11 @@ import net.minecraft.util.math.ChunkPos;
|
|||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.Heightmap.Type;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.gen.StructureAccessor;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
|
@ -83,8 +83,8 @@ public class LakePiece extends BasePiece {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean generate(StructureWorldAccess world, StructureAccessor arg, ChunkGenerator chunkGenerator,
|
||||
Random random, BlockBox blockBox, ChunkPos chunkPos, BlockPos blockPos) {
|
||||
public boolean place(WorldGenLevel world, StructureAccessor arg, ChunkGenerator chunkGenerator, Random random,
|
||||
BlockBox blockBox, ChunkPos chunkPos, BlockPos blockPos) {
|
||||
int minY = this.boundingBox.minY;
|
||||
int maxY = this.boundingBox.maxY;
|
||||
int sx = chunkPos.x << 4;
|
||||
|
@ -130,7 +130,7 @@ public class LakePiece extends BasePiece {
|
|||
state = chunk.getBlockState(mut.up());
|
||||
if (state.isAir()) {
|
||||
state = random.nextBoolean() ? ENDSTONE
|
||||
: world.getBiome(worldPos).getGenerationSettings().getSurfaceConfig()
|
||||
: world.getBiome(worldPos).getGenerationSettings().getSurfaceBuilderConfig()
|
||||
.getTopMaterial();
|
||||
} else {
|
||||
state = state.getFluidState().isEmpty() ? ENDSTONE
|
||||
|
@ -146,7 +146,7 @@ public class LakePiece extends BasePiece {
|
|||
return true;
|
||||
}
|
||||
|
||||
private void fixWater(StructureWorldAccess world, Chunk chunk, MutableBlockPos mut, Random random, int sx, int sz) {
|
||||
private void fixWater(WorldGenLevel world, Chunk chunk, MutableBlockPos mut, Random random, int sx, int sz) {
|
||||
int minY = this.boundingBox.minY;
|
||||
int maxY = this.boundingBox.maxY;
|
||||
for (int x = 0; x < 16; x++) {
|
||||
|
@ -164,8 +164,8 @@ public class LakePiece extends BasePiece {
|
|||
BlockState bState = chunk.getBlockState(mut);
|
||||
if (bState.isAir()) {
|
||||
bState = random.nextBoolean() ? ENDSTONE
|
||||
: world.getBiome(mut.add(sx, 0, sz)).getGenerationSettings().getSurfaceConfig()
|
||||
.getTopMaterial();
|
||||
: world.getBiome(mut.add(sx, 0, sz)).getGenerationSettings()
|
||||
.getSurfaceBuilderConfig().getTopMaterial();
|
||||
} else {
|
||||
bState = bState.getFluidState().isEmpty() ? ENDSTONE
|
||||
: EndBlocks.ENDSTONE_DUST.defaultBlockState();
|
||||
|
@ -184,7 +184,7 @@ public class LakePiece extends BasePiece {
|
|||
if (bState.isAir()) {
|
||||
bState = random.nextBoolean() ? ENDSTONE
|
||||
: world.getBiome(mut.add(sx, 0, sz)).getGenerationSettings()
|
||||
.getSurfaceConfig().getTopMaterial();
|
||||
.getSurfaceBuilderConfig().getTopMaterial();
|
||||
} else {
|
||||
bState = bState.getFluidState().isEmpty() ? ENDSTONE
|
||||
: EndBlocks.ENDSTONE_DUST.defaultBlockState();
|
||||
|
@ -212,7 +212,7 @@ public class LakePiece extends BasePiece {
|
|||
}
|
||||
}
|
||||
|
||||
private int getHeight(StructureWorldAccess world, BlockPos pos) {
|
||||
private int getHeight(WorldGenLevel world, BlockPos pos) {
|
||||
int p = ((pos.getX() & 2047) << 11) | (pos.getZ() & 2047);
|
||||
int h = heightmap.getOrDefault(p, Byte.MIN_VALUE);
|
||||
if (h > Byte.MIN_VALUE) {
|
||||
|
@ -224,7 +224,7 @@ public class LakePiece extends BasePiece {
|
|||
return 0;
|
||||
}
|
||||
|
||||
h = world.getTopY(Type.WORLD_SURFACE_WG, pos.getX(), pos.getZ());
|
||||
h = world.getHeight(Types.WORLD_SURFACE_WG, pos.getX(), pos.getZ());
|
||||
h = Mth.abs(h - center.getY());
|
||||
h = h < 8 ? 1 : 0;
|
||||
|
||||
|
@ -232,7 +232,7 @@ public class LakePiece extends BasePiece {
|
|||
return h;
|
||||
}
|
||||
|
||||
private float getHeightClamp(StructureWorldAccess world, int radius, int posX, int posZ) {
|
||||
private float getHeightClamp(WorldGenLevel world, int radius, int posX, int posZ) {
|
||||
MutableBlockPos mut = new MutableBlockPos();
|
||||
int r2 = radius * radius;
|
||||
float height = 0;
|
||||
|
|
|
@ -15,8 +15,8 @@ import net.minecraft.core.BlockPos;
|
|||
import net.minecraft.core.BlockPos.MutableBlockPos;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.Heightmap.Type;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import ru.betterend.noise.OpenSimplexNoise;
|
||||
import ru.betterend.registry.EndBiomes;
|
||||
import ru.betterend.util.MHelper;
|
||||
|
@ -76,7 +76,7 @@ public abstract class MountainPiece extends BasePiece {
|
|||
noise2 = new OpenSimplexNoise(seed2);
|
||||
}
|
||||
|
||||
private int getHeight(StructureWorldAccess world, BlockPos pos) {
|
||||
private int getHeight(WorldGenLevel world, BlockPos pos) {
|
||||
int p = ((pos.getX() & 2047) << 11) | (pos.getZ() & 2047);
|
||||
int h = heightmap.getOrDefault(p, Integer.MIN_VALUE);
|
||||
if (h > Integer.MIN_VALUE) {
|
||||
|
@ -87,7 +87,7 @@ public abstract class MountainPiece extends BasePiece {
|
|||
heightmap.put(p, -10);
|
||||
return -10;
|
||||
}
|
||||
h = world.getTopY(Type.WORLD_SURFACE_WG, pos.getX(), pos.getZ());
|
||||
h = world.getHeight(Types.WORLD_SURFACE_WG, pos.getX(), pos.getZ());
|
||||
h = Mth.abs(h - center.getY());
|
||||
if (h > 4) {
|
||||
h = 4 - h;
|
||||
|
@ -108,7 +108,7 @@ public abstract class MountainPiece extends BasePiece {
|
|||
return h;
|
||||
}
|
||||
|
||||
protected float getHeightClamp(StructureWorldAccess world, int radius, int posX, int posZ) {
|
||||
protected float getHeightClamp(WorldGenLevel world, int radius, int posX, int posZ) {
|
||||
MutableBlockPos mut = new MutableBlockPos();
|
||||
float height = 0;
|
||||
float max = 0;
|
||||
|
|
|
@ -13,9 +13,9 @@ import net.minecraft.resources.ResourceLocation;
|
|||
import net.minecraft.util.math.BlockBox;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.gen.StructureAccessor;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import ru.betterend.registry.EndStructures;
|
||||
import ru.betterend.util.MHelper;
|
||||
import ru.betterend.util.StructureHelper;
|
||||
|
@ -69,8 +69,8 @@ public class NBTPiece extends BasePiece {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean generate(StructureWorldAccess world, StructureAccessor arg, ChunkGenerator chunkGenerator,
|
||||
Random random, BlockBox blockBox, ChunkPos chunkPos, BlockPos blockPos) {
|
||||
public boolean place(WorldGenLevel world, StructureAccessor arg, ChunkGenerator chunkGenerator, Random random,
|
||||
BlockBox blockBox, ChunkPos chunkPos, BlockPos blockPos) {
|
||||
BlockBox bounds = new BlockBox(blockBox);
|
||||
bounds.maxY = this.boundingBox.maxY;
|
||||
bounds.minY = this.boundingBox.minY;
|
||||
|
|
|
@ -13,11 +13,11 @@ import net.minecraft.core.BlockPos.MutableBlockPos;
|
|||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.world.Heightmap;
|
||||
import net.minecraft.world.Heightmap.Type;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.gen.StructureAccessor;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import ru.betterend.registry.EndStructures;
|
||||
import ru.betterend.util.MHelper;
|
||||
|
||||
|
@ -55,8 +55,8 @@ public class PaintedMountainPiece extends MountainPiece {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean generate(StructureWorldAccess world, StructureAccessor arg, ChunkGenerator chunkGenerator,
|
||||
Random random, BlockBox blockBox, ChunkPos chunkPos, BlockPos blockPos) {
|
||||
public boolean place(WorldGenLevel world, StructureAccessor arg, ChunkGenerator chunkGenerator, Random random,
|
||||
BlockBox blockBox, ChunkPos chunkPos, BlockPos blockPos) {
|
||||
int sx = chunkPos.getStartX();
|
||||
int sz = chunkPos.getStartZ();
|
||||
MutableBlockPos pos = new MutableBlockPos();
|
||||
|
|
|
@ -8,9 +8,9 @@ import net.minecraft.structure.StructureManager;
|
|||
import net.minecraft.util.math.BlockBox;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.world.StructureWorldAccess;
|
||||
import net.minecraft.world.level.WorldGenLevel;
|
||||
import net.minecraft.world.gen.StructureAccessor;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import ru.betterend.registry.EndStructures;
|
||||
import ru.betterend.world.structures.StructureWorld;
|
||||
|
||||
|
@ -40,8 +40,8 @@ public class VoxelPiece extends BasePiece {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean generate(StructureWorldAccess world, StructureAccessor arg, ChunkGenerator chunkGenerator,
|
||||
Random random, BlockBox blockBox, ChunkPos chunkPos, BlockPos blockPos) {
|
||||
public boolean place(WorldGenLevel world, StructureAccessor arg, ChunkGenerator chunkGenerator, Random random,
|
||||
BlockBox blockBox, ChunkPos chunkPos, BlockPos blockPos) {
|
||||
this.world.placeChunk(world, chunkPos);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue