First running version of BCLib

This commit is contained in:
Frank 2021-12-01 01:33:24 +01:00
parent 4c1e8273f6
commit 54f13847b5
7 changed files with 27 additions and 17 deletions

View file

@ -89,7 +89,7 @@ processResources {
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
it.options.release = 16
it.options.release = 17
}
javadoc {

View file

@ -378,7 +378,9 @@ public class StructureHelper {
mut.setX(x);
for (int z = bounds.minZ(); z <= bounds.maxZ(); z++) {
mut.setZ(z);
BlockState top = world.getBiome(mut).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
BlockState top = Blocks.PURPLE_CONCRETE.defaultBlockState();
//TODO: 1.18 find another way to get the Top Materiel
//world.getBiome(mut).getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial();
for (int y = bounds.maxY(); y >= bounds.minY(); y--) {
mut.setY(y);
BlockState state = world.getBlockState(mut);

View file

@ -10,6 +10,7 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.Mirror;
import net.minecraft.world.level.block.Rotation;
import net.minecraft.world.level.block.state.BlockState;
@ -141,11 +142,14 @@ public abstract class NBTStructureFeature extends DefaultFeature {
BlockState stateSt = world.getBlockState(mut);
if (!stateSt.is(TagAPI.BLOCK_GEN_TERRAIN)) {
if (merge == TerrainMerge.SURFACE) {
SurfaceBuilderConfiguration config = world.getBiome(mut)
.getGenerationSettings()
.getSurfaceBuilderConfig();
// SurfaceBuilderConfiguration config = world.getBiome(mut)
// .getGenerationSettings()
// .getSurfaceBuilderConfig();
boolean isTop = mut.getY() == surfMax && state.getMaterial().isSolidBlocking();
BlockState top = isTop ? config.getTopMaterial() : config.getUnderMaterial();
BlockState top =
Blocks.PURPLE_CONCRETE.defaultBlockState();
//TODO: 1.18 find another way to get the Top/Bottom Materiel
//isTop ? config.getTopMaterial() : config.getUnderMaterial();
BlocksHelper.setWithoutUpdate(world, mut, top);
}
else {
@ -155,10 +159,13 @@ public abstract class NBTStructureFeature extends DefaultFeature {
else {
if (stateSt.is(TagAPI.BLOCK_END_GROUND) && state.getMaterial().isSolidBlocking()) {
if (merge == TerrainMerge.SURFACE) {
SurfaceBuilderConfiguration config = world.getBiome(mut)
.getGenerationSettings()
.getSurfaceBuilderConfig();
BlocksHelper.setWithoutUpdate(world, mut, config.getUnderMaterial());
// SurfaceBuilderConfiguration config = world.getBiome(mut)
// .getGenerationSettings()
// .getSurfaceBuilderConfig();
BlockState bottom = Blocks.PURPLE_CONCRETE.defaultBlockState();
//TODO: 1.18 find another way to get the Top Material
//config.getUnderMaterial()
BlocksHelper.setWithoutUpdate(world, mut, bottom);
}
else {
BlocksHelper.setWithoutUpdate(world, mut, state);

View file

@ -50,7 +50,7 @@ public class BCLibEndBiomeSource extends BiomeSource {
BiomeAPI.END_LAND_BIOME_PICKER.clearMutables();
BiomeAPI.END_VOID_BIOME_PICKER.clearMutables();
this.possibleBiomes.forEach(biome -> {
this.possibleBiomes().forEach(biome -> {
ResourceLocation key = biomeRegistry.getKey(biome);
if (!BiomeAPI.hasBiome(key)) {
BCLBiome bclBiome = new BCLBiome(key, biome, 1, 1);

View file

@ -39,7 +39,7 @@ public class BCLibNetherBiomeSource extends BiomeSource {
BiomeAPI.NETHER_BIOME_PICKER.clearMutables();
this.possibleBiomes.forEach(biome -> {
this.possibleBiomes().forEach(biome -> {
ResourceLocation key = biomeRegistry.getKey(biome);
if (!BiomeAPI.hasBiome(key)) {
BCLBiome bclBiome = new BCLBiome(key, biome, 1, 1);

View file

@ -14,10 +14,12 @@ public class TerrainStructureProcessor extends StructureProcessor {
public StructureBlockInfo processBlock(LevelReader worldView, BlockPos pos, BlockPos blockPos, StructureBlockInfo structureBlockInfo, StructureBlockInfo structureBlockInfo2, StructurePlaceSettings structurePlacementData) {
BlockPos bpos = structureBlockInfo2.pos;
if (structureBlockInfo2.state.is(Blocks.END_STONE) && worldView.isEmptyBlock(bpos.above())) {
BlockState top = worldView.getBiome(structureBlockInfo2.pos)
.getGenerationSettings()
.getSurfaceBuilderConfig()
.getTopMaterial();
BlockState top = Blocks.PURPLE_CONCRETE.defaultBlockState();
//TODO: 1.18 find another way to get the Top Materiel
// worldView.getBiome(structureBlockInfo2.pos)
// .getGenerationSettings()
// .getSurfaceBuilderConfig()
// .getTopMaterial();
return new StructureBlockInfo(bpos, top, structureBlockInfo2.nbt);
}
return structureBlockInfo2;

View file

@ -11,7 +11,6 @@
"GameMixin",
"MinecraftMixin",
"GameMixin",
"StructureFeaturesMixin"
"ModelBakeryMixin",
"ModelManagerMixin",
"SimpleReloadableResourceManagerMixin",