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 // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType(JavaCompile) { tasks.withType(JavaCompile) {
options.encoding = "UTF-8" options.encoding = "UTF-8"
it.options.release = 16 it.options.release = 17
} }
javadoc { javadoc {

View file

@ -378,7 +378,9 @@ public class StructureHelper {
mut.setX(x); mut.setX(x);
for (int z = bounds.minZ(); z <= bounds.maxZ(); z++) { for (int z = bounds.minZ(); z <= bounds.maxZ(); z++) {
mut.setZ(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--) { for (int y = bounds.maxY(); y >= bounds.minY(); y--) {
mut.setY(y); mut.setY(y);
BlockState state = world.getBlockState(mut); BlockState state = world.getBlockState(mut);

View file

@ -10,6 +10,7 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.MinecraftServer; import net.minecraft.server.MinecraftServer;
import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.biome.Biome; 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.Mirror;
import net.minecraft.world.level.block.Rotation; import net.minecraft.world.level.block.Rotation;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
@ -141,11 +142,14 @@ public abstract class NBTStructureFeature extends DefaultFeature {
BlockState stateSt = world.getBlockState(mut); BlockState stateSt = world.getBlockState(mut);
if (!stateSt.is(TagAPI.BLOCK_GEN_TERRAIN)) { if (!stateSt.is(TagAPI.BLOCK_GEN_TERRAIN)) {
if (merge == TerrainMerge.SURFACE) { if (merge == TerrainMerge.SURFACE) {
SurfaceBuilderConfiguration config = world.getBiome(mut) // SurfaceBuilderConfiguration config = world.getBiome(mut)
.getGenerationSettings() // .getGenerationSettings()
.getSurfaceBuilderConfig(); // .getSurfaceBuilderConfig();
boolean isTop = mut.getY() == surfMax && state.getMaterial().isSolidBlocking(); 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); BlocksHelper.setWithoutUpdate(world, mut, top);
} }
else { else {
@ -155,10 +159,13 @@ public abstract class NBTStructureFeature extends DefaultFeature {
else { else {
if (stateSt.is(TagAPI.BLOCK_END_GROUND) && state.getMaterial().isSolidBlocking()) { if (stateSt.is(TagAPI.BLOCK_END_GROUND) && state.getMaterial().isSolidBlocking()) {
if (merge == TerrainMerge.SURFACE) { if (merge == TerrainMerge.SURFACE) {
SurfaceBuilderConfiguration config = world.getBiome(mut) // SurfaceBuilderConfiguration config = world.getBiome(mut)
.getGenerationSettings() // .getGenerationSettings()
.getSurfaceBuilderConfig(); // .getSurfaceBuilderConfig();
BlocksHelper.setWithoutUpdate(world, mut, config.getUnderMaterial()); 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 { else {
BlocksHelper.setWithoutUpdate(world, mut, state); BlocksHelper.setWithoutUpdate(world, mut, state);

View file

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

View file

@ -39,7 +39,7 @@ public class BCLibNetherBiomeSource extends BiomeSource {
BiomeAPI.NETHER_BIOME_PICKER.clearMutables(); BiomeAPI.NETHER_BIOME_PICKER.clearMutables();
this.possibleBiomes.forEach(biome -> { this.possibleBiomes().forEach(biome -> {
ResourceLocation key = biomeRegistry.getKey(biome); ResourceLocation key = biomeRegistry.getKey(biome);
if (!BiomeAPI.hasBiome(key)) { if (!BiomeAPI.hasBiome(key)) {
BCLBiome bclBiome = new BCLBiome(key, biome, 1, 1); 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) { public StructureBlockInfo processBlock(LevelReader worldView, BlockPos pos, BlockPos blockPos, StructureBlockInfo structureBlockInfo, StructureBlockInfo structureBlockInfo2, StructurePlaceSettings structurePlacementData) {
BlockPos bpos = structureBlockInfo2.pos; BlockPos bpos = structureBlockInfo2.pos;
if (structureBlockInfo2.state.is(Blocks.END_STONE) && worldView.isEmptyBlock(bpos.above())) { if (structureBlockInfo2.state.is(Blocks.END_STONE) && worldView.isEmptyBlock(bpos.above())) {
BlockState top = worldView.getBiome(structureBlockInfo2.pos) BlockState top = Blocks.PURPLE_CONCRETE.defaultBlockState();
.getGenerationSettings() //TODO: 1.18 find another way to get the Top Materiel
.getSurfaceBuilderConfig() // worldView.getBiome(structureBlockInfo2.pos)
.getTopMaterial(); // .getGenerationSettings()
// .getSurfaceBuilderConfig()
// .getTopMaterial();
return new StructureBlockInfo(bpos, top, structureBlockInfo2.nbt); return new StructureBlockInfo(bpos, top, structureBlockInfo2.nbt);
} }
return structureBlockInfo2; return structureBlockInfo2;

View file

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