Skip to content

Commit

Permalink
Mesa gen now uses the useStoneTag check
Browse files Browse the repository at this point in the history
Signed-off-by: CorgiTaco <>
  • Loading branch information
CorgiTaco committed Sep 7, 2020
1 parent 7119e99 commit 685e81f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerato

ConfigBlockReader reader = ConfigBlockReader.blocksFromConfig.get((int) ((clampedValue / 2.0 + 0.5) * ConfigBlockReader.blocksFromConfig.size()));


BlockState mutableState = world.getBlockState(mutable);

if (useStoneTag(world, mutable))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import net.minecraft.world.gen.feature.Feature;
import net.oriondevcorgitaco.unearthed.Unearthed;
import net.oriondevcorgitaco.unearthed.util.RegistrationHelper;

import java.util.Random;
Expand All @@ -35,7 +36,7 @@ public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerato

for (int y = 0; y < topY; y++) {
setStrataLayerBlock(y);
if (world.getBlockState(mutable).getBlock().isIn(BlockTags.BASE_STONE_OVERWORLD))
if (useStoneTag(world, mutable))
world.setBlockState(mutable, mesaBlockState, 2);

mutable.move(Direction.UP);
Expand All @@ -45,6 +46,15 @@ public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerato
return true;
}

public static boolean useStoneTag(StructureWorldAccess world, BlockPos mutable) {
boolean stoneTag = Unearthed.UE_CONFIG.generation.stoneTag;
if (stoneTag)
return world.getBlockState(mutable).isIn(BlockTags.BASE_STONE_OVERWORLD);
else
return world.getBlockState(mutable) == Blocks.STONE.getDefaultState();

}

public void setStrataLayerBlock(int yPos) {
if (yPos % 4 == 0)
mesaBlockState = Blocks.TERRACOTTA.getDefaultState();
Expand Down

0 comments on commit 685e81f

Please sign in to comment.