From 182f2b772d83a8e50c43dab86002e86e2a4dea72 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Fri, 1 Aug 2025 14:52:01 +0100 Subject: [PATCH 1/2] fix: don't bypass history with //ores - also add copper and update limits - also restrict ores spawning to region - also fix caves out of region error - fixes #3108 --- .../core/extent/FaweRegionExtent.java | 16 +++++++++------- .../core/extent/PassthroughExtent.java | 5 ----- .../java/com/sk89q/worldedit/EditSession.java | 2 +- .../com/sk89q/worldedit/extent/Extent.java | 18 +++++++++++------- .../com/sk89q/worldedit/regions/Region.java | 2 +- 5 files changed, 22 insertions(+), 21 deletions(-) diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/FaweRegionExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/FaweRegionExtent.java index 4f4cce126c..a9bb74338c 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/FaweRegionExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/FaweRegionExtent.java @@ -27,6 +27,7 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatchProcessor { private final FaweLimit limit; + private final boolean hasLimit; /** * Create a new instance. @@ -36,6 +37,7 @@ public abstract class FaweRegionExtent extends ResettableExtent implements IBatc public FaweRegionExtent(Extent extent, FaweLimit limit) { super(extent); this.limit = limit; + this.hasLimit = limit != null; } @Override @@ -75,7 +77,7 @@ public final boolean contains(BlockVector2 p) { public > boolean setBlock(int x, int y, int z, B block) throws WorldEditException { if (!contains(x, y, z)) { - if (!limit.MAX_FAILS()) { + if (hasLimit && !limit.MAX_FAILS()) { WEManager.weManager().cancelEditSafe(this, FaweCache.OUTSIDE_REGION); } return false; @@ -86,7 +88,7 @@ public > boolean setBlock(int x, int y, int z, B b @Override public boolean setBiome(int x, int y, int z, BiomeType biome) { if (!contains(x, y, z)) { - if (!limit.MAX_FAILS()) { + if (hasLimit && !limit.MAX_FAILS()) { WEManager.weManager().cancelEditSafe(this, FaweCache.OUTSIDE_REGION); } return false; @@ -102,7 +104,7 @@ public BiomeType getBiome(BlockVector3 position) { @Override public BiomeType getBiomeType(int x, int y, int z) { if (!contains(x, y, z)) { - if (!limit.MAX_FAILS()) { + if (hasLimit && !limit.MAX_FAILS()) { WEManager.weManager().cancelEditSafe(this, FaweCache.OUTSIDE_REGION); } return null; @@ -118,7 +120,7 @@ public BaseBlock getFullBlock(BlockVector3 position) { @Override public BaseBlock getFullBlock(int x, int y, int z) { if (!contains(x, y, z)) { - if (!limit.MAX_FAILS()) { + if (hasLimit && !limit.MAX_FAILS()) { WEManager.weManager().cancelEditSafe(this, FaweCache.OUTSIDE_REGION); } return BlockTypes.AIR.getDefaultState().toBaseBlock(); @@ -134,7 +136,7 @@ public BlockState getBlock(BlockVector3 position) { @Override public BlockState getBlock(int x, int y, int z) { if (!contains(x, y, z)) { - if (!limit.MAX_FAILS()) { + if (hasLimit && !limit.MAX_FAILS()) { WEManager.weManager().cancelEditSafe(this, FaweCache.OUTSIDE_REGION); } return BlockTypes.AIR.getDefaultState(); @@ -146,7 +148,7 @@ public BlockState getBlock(int x, int y, int z) { @Override public Entity createEntity(Location location, BaseEntity entity) { if (!contains(location.getBlockX(), location.getBlockY(), location.getBlockZ())) { - if (!limit.MAX_FAILS()) { + if (hasLimit && !limit.MAX_FAILS()) { WEManager.weManager().cancelEditSafe(this, FaweCache.OUTSIDE_REGION); } return null; @@ -158,7 +160,7 @@ public Entity createEntity(Location location, BaseEntity entity) { @Override public Entity createEntity(Location location, BaseEntity entity, UUID uuid) { if (!contains(location.getBlockX(), location.getBlockY(), location.getBlockZ())) { - if (!limit.MAX_FAILS()) { + if (hasLimit && !limit.MAX_FAILS()) { WEManager.weManager().cancelEditSafe(this, FaweCache.OUTSIDE_REGION); } return null; diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/PassthroughExtent.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/PassthroughExtent.java index 7a118d8c1f..36960a5e89 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/PassthroughExtent.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/PassthroughExtent.java @@ -126,11 +126,6 @@ public void addOre(Region region, Mask mask, Pattern material, int size, int fre getExtent().addOre(region, mask, material, size, frequency, rarity, minY, maxY); } - @Override - public void addOres(Region region, Mask mask) throws WorldEditException { - getExtent().addOres(region, mask); - } - @Override public List> getBlockDistribution(Region region) { return getExtent().getBlockDistribution(region); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java index 9059a22edd..dbac72c2ee 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/EditSession.java @@ -4117,7 +4117,7 @@ public void removeEntity(int x, int y, int z, UUID uuid) { @Override public void generate(Region region, GenBase gen) throws WorldEditException { for (BlockVector2 chunkPos : region.getChunks()) { - gen.generate(chunkPos, new SingleRegionExtent(this, getLimit(), region)); + gen.generate(chunkPos, new SingleRegionExtent(this, null, region)); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/Extent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/Extent.java index ebf572c198..a9a9cc4f1a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/Extent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/Extent.java @@ -47,6 +47,8 @@ import com.sk89q.worldedit.function.mask.BlockMask; import com.sk89q.worldedit.function.mask.ExistingBlockMask; import com.sk89q.worldedit.function.mask.Mask; +import com.sk89q.worldedit.function.mask.MaskIntersection; +import com.sk89q.worldedit.function.mask.RegionMask; import com.sk89q.worldedit.function.mask.SolidBlockMask; import com.sk89q.worldedit.function.operation.Operation; import com.sk89q.worldedit.function.operation.Operations; @@ -572,18 +574,20 @@ default void addOre( //TODO: probably update these for 1.18 etc. default void addOres(Region region, Mask mask) throws WorldEditException { + mask = new MaskIntersection(new RegionMask(region), mask); addOre(region, mask, BlockTypes.DIRT.getDefaultState(), 33, 10, 100, getMinY(), getMaxY()); addOre(region, mask, BlockTypes.GRAVEL.getDefaultState(), 33, 8, 100, getMinY(), getMaxY()); addOre(region, mask, BlockTypes.ANDESITE.getDefaultState(), 33, 10, 100, getMinY(), 79); addOre(region, mask, BlockTypes.DIORITE.getDefaultState(), 33, 10, 100, getMinY(), 79); addOre(region, mask, BlockTypes.GRANITE.getDefaultState(), 33, 10, 100, getMinY(), 79); - addOre(region, mask, BlockTypes.COAL_ORE.getDefaultState(), 17, 20, 100, 0, 127); - addOre(region, mask, BlockTypes.IRON_ORE.getDefaultState(), 9, 20, 100, 0, 63); - addOre(region, mask, BlockTypes.GOLD_ORE.getDefaultState(), 9, 2, 100, 0, 31); - addOre(region, mask, BlockTypes.REDSTONE_ORE.getDefaultState(), 8, 8, 100, 0, 15); - addOre(region, mask, BlockTypes.DIAMOND_ORE.getDefaultState(), 8, 1, 100, 0, 15); - addOre(region, mask, BlockTypes.LAPIS_ORE.getDefaultState(), 7, 1, 100, 0, 15); - addOre(region, mask, BlockTypes.EMERALD_ORE.getDefaultState(), 5, 1, 100, 4, 31); + addOre(region, mask, BlockTypes.COAL_ORE.getDefaultState(), 17, 20, 100, 0, 320); + addOre(region, mask, BlockTypes.COPPER_ORE.getDefaultState(), 13, 20, 100, -16, 112); + addOre(region, mask, BlockTypes.IRON_ORE.getDefaultState(), 9, 20, 100, -64, 320); + addOre(region, mask, BlockTypes.GOLD_ORE.getDefaultState(), 9, 2, 100, -32, 256); + addOre(region, mask, BlockTypes.REDSTONE_ORE.getDefaultState(), 8, 8, 100, -64, 16); + addOre(region, mask, BlockTypes.DIAMOND_ORE.getDefaultState(), 8, 1, 100, -64, 16); + addOre(region, mask, BlockTypes.LAPIS_ORE.getDefaultState(), 7, 1, 100, -64, 64); + addOre(region, mask, BlockTypes.EMERALD_ORE.getDefaultState(), 5, 1, 100, -16, 320); } /** diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Region.java b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Region.java index f9e501c3a0..0ba49a2f37 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Region.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/regions/Region.java @@ -502,7 +502,7 @@ default Extent construct(Extent child) { if (isGlobal()) { return child; } - return new SingleRegionExtent(child, FaweLimit.MAX, this); + return new SingleRegionExtent(child, null, this); } @Override From 635f393215f61c19f6f4c41db1c686840f9c1592 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Sun, 3 Aug 2025 17:11:17 +0100 Subject: [PATCH 2/2] Bring ores closer in line with vanilla generation --- .../core/function/generator/OreGen.java | 37 ++- .../worldedit/command/GenerationCommands.java | 6 +- .../com/sk89q/worldedit/extent/Extent.java | 303 +++++++++++++++++- 3 files changed, 327 insertions(+), 19 deletions(-) diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/function/generator/OreGen.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/function/generator/OreGen.java index 9ed44fe0d9..71069e7f0b 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/function/generator/OreGen.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/function/generator/OreGen.java @@ -21,12 +21,38 @@ public class OreGen implements Resource { private final Extent extent; private final Mask mask; private final MutableBlockVector3 mutable = new MutableBlockVector3(); + private final boolean triangular; private final double ONE_2 = 1 / 2F; private final double ONE_8 = 1 / 8F; private final double ONE_16 = 1 / 16F; public OreGen(Extent extent, Mask mask, Pattern pattern, int size, int minY, int maxY) { + this(extent, mask, pattern, size, minY, maxY, false); + } + + /** + * Generate ore-like deposits with the given pattern and settings + * + * @param extent Extent to write to + * @param mask mask of where to place + * @param pattern pattern to place + * @param size maximum size of deposits + * @param minY min Y to consider generation from (important for triangular generation) + * @param maxY max Y to consider generation from (important for triangular generation) + * @param triangular if a triangular distribution of ores should be used (rather than + * @throws WorldEditException on error + * @since TODO + */ + public OreGen( + Extent extent, + Mask mask, + Pattern pattern, + int size, + int minY, + int maxY, + boolean triangular + ) { this.maxSize = size; this.maxSizeO8 = size * ONE_8; this.maxSizeO16 = size * ONE_16; @@ -36,11 +62,20 @@ public OreGen(Extent extent, Mask mask, Pattern pattern, int size, int minY, int this.mask = mask; this.pattern = pattern; this.extent = extent; + this.triangular = triangular; } @Override public boolean spawn(Random rand, int x, int z) throws WorldEditException { - int y = rand.nextInt(maxY - minY) + minY; + int y; + if (this.triangular) { + int range = maxY - minY; + int mid = range / 2; + int upperMid = range - mid; + y = minY + rand.nextInt(mid) + rand.nextInt(upperMid); + } else { + y = rand.nextInt(maxY - minY) + minY; + } if (!mask.test(mutable.setComponents(x, y, z))) { return false; } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java index f2a3c80ed4..ac0a5a773a 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/GenerationCommands.java @@ -622,10 +622,12 @@ public void ores( LocalSession session, EditSession editSession, @Selection Region region, - @Arg(desc = "Mask") Mask mask + @Arg(desc = "Mask") Mask mask, + @Switch(name = 'b', desc = "Make all ores deepslate equivalent for y<0") boolean deepslateBelowZero, + @Switch(name = 'd', desc = "Make all ores deepslate equivalent when placed into deepslate, tuff, etc.") boolean deepslateWhereDeepslate ) throws WorldEditException { new MaskTraverser(mask).setNewExtent(editSession); - editSession.addOres(region, mask); + editSession.addOres(region, mask, deepslateBelowZero, deepslateWhereDeepslate); actor.print(Caption.of("fawe.worldedit.visitor.visitor.block", editSession.getBlockChangeCount())); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/Extent.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/Extent.java index a9a9cc4f1a..b67f1c3903 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/Extent.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/Extent.java @@ -30,6 +30,7 @@ import com.fastasyncworldedit.core.function.generator.OreGen; import com.fastasyncworldedit.core.function.generator.Resource; import com.fastasyncworldedit.core.function.generator.SchemGen; +import com.fastasyncworldedit.core.function.pattern.MaskedPattern; import com.fastasyncworldedit.core.history.changeset.AbstractChangeSet; import com.fastasyncworldedit.core.internal.exception.FaweException; import com.fastasyncworldedit.core.math.MutableBlockVector3; @@ -44,6 +45,7 @@ import com.sk89q.worldedit.extent.clipboard.Clipboard; import com.sk89q.worldedit.function.RegionMaskingFilter; import com.sk89q.worldedit.function.block.BlockReplace; +import com.sk89q.worldedit.function.mask.BlockCategoryMask; import com.sk89q.worldedit.function.mask.BlockMask; import com.sk89q.worldedit.function.mask.ExistingBlockMask; import com.sk89q.worldedit.function.mask.Mask; @@ -67,6 +69,7 @@ import com.sk89q.worldedit.world.World; import com.sk89q.worldedit.world.biome.BiomeType; import com.sk89q.worldedit.world.block.BaseBlock; +import com.sk89q.worldedit.world.block.BlockCategories; import com.sk89q.worldedit.world.block.BlockState; import com.sk89q.worldedit.world.block.BlockStateHolder; import com.sk89q.worldedit.world.block.BlockType; @@ -79,6 +82,7 @@ import java.util.Set; import java.util.UUID; import java.util.concurrent.ThreadLocalRandom; +import java.util.function.BiFunction; import static com.google.common.base.Preconditions.checkNotNull; @@ -151,9 +155,10 @@ default Entity createEntity(Location location, BaseEntity entity) { } //FAWE start + /** * Create an entity at the given location, forcing a UUID onto the entity - * + *

* Only use if you are aware of the consequences of forcing a UUID to an entity. * * @param entity the entity @@ -569,25 +574,291 @@ default void addOre( int minY, int maxY ) throws WorldEditException { - spawnResource(region, new OreGen(this, mask, material, size, minY, maxY), rarity, frequency); + addOre(region, mask, material, size, frequency, rarity, minY, maxY, false); + } + + /** + * Generate ore-like deposits with the given pattern and settings + * + * @param region region to generate in + * @param mask mask of where to place + * @param material pattern to place + * @param size maximum size of deposits + * @param frequency number of times to attempt to place a deposit + * @param rarity percentage chance of generating a deposit per attempt + * @param minY min Y to consider generation from (important for triangular generation) + * @param maxY max Y to consider generation from (important for triangular generation) + * @param triangular if a triangular distribution of ores should be used (rather than + * @throws WorldEditException on error + * @since TODO + */ + default void addOre( + Region region, + Mask mask, + Pattern material, + int size, + int frequency, + int rarity, + int minY, + int maxY, + boolean triangular + ) throws WorldEditException { + spawnResource( + region, + new OreGen(this, mask, material, size, minY, maxY, triangular), + rarity, + frequency + ); } - //TODO: probably update these for 1.18 etc. default void addOres(Region region, Mask mask) throws WorldEditException { + addOres(region, mask, false, false); + } + + /** + * Generator a distribution of ore deposits similar to vanilla generation + * + * @param region region to generate in + * @param mask mask of where to place + * @param deepslateBelowZero if ores should be their deepslate equivalent below zero (overrides deepslateWhereDeepslate) + * @param deepslateWhereDeepslate if ores should be their deepslate equivalent if the existing block is deepslate + * @throws WorldEditException on error + * @since TODO + */ + default void addOres(Region region, Mask mask, boolean deepslateBelowZero, boolean deepslateWhereDeepslate) throws + WorldEditException { mask = new MaskIntersection(new RegionMask(region), mask); - addOre(region, mask, BlockTypes.DIRT.getDefaultState(), 33, 10, 100, getMinY(), getMaxY()); - addOre(region, mask, BlockTypes.GRAVEL.getDefaultState(), 33, 8, 100, getMinY(), getMaxY()); - addOre(region, mask, BlockTypes.ANDESITE.getDefaultState(), 33, 10, 100, getMinY(), 79); - addOre(region, mask, BlockTypes.DIORITE.getDefaultState(), 33, 10, 100, getMinY(), 79); - addOre(region, mask, BlockTypes.GRANITE.getDefaultState(), 33, 10, 100, getMinY(), 79); - addOre(region, mask, BlockTypes.COAL_ORE.getDefaultState(), 17, 20, 100, 0, 320); - addOre(region, mask, BlockTypes.COPPER_ORE.getDefaultState(), 13, 20, 100, -16, 112); - addOre(region, mask, BlockTypes.IRON_ORE.getDefaultState(), 9, 20, 100, -64, 320); - addOre(region, mask, BlockTypes.GOLD_ORE.getDefaultState(), 9, 2, 100, -32, 256); - addOre(region, mask, BlockTypes.REDSTONE_ORE.getDefaultState(), 8, 8, 100, -64, 16); - addOre(region, mask, BlockTypes.DIAMOND_ORE.getDefaultState(), 8, 1, 100, -64, 16); - addOre(region, mask, BlockTypes.LAPIS_ORE.getDefaultState(), 7, 1, 100, -64, 64); - addOre(region, mask, BlockTypes.EMERALD_ORE.getDefaultState(), 5, 1, 100, -16, 320); + + BiFunction patternFunc; + + if (deepslateBelowZero) { + patternFunc = (ore, deepslate_ore) -> new MaskedPattern( + new Mask() { + + @Override + public boolean test(final BlockVector3 vector) { + return vector.y() < 0; + } + + @Override + public Mask copy() { + return this; + } + }, deepslate_ore, ore + ); + } else if (deepslateWhereDeepslate) { + patternFunc = (ore, deepslate_ore) -> new MaskedPattern( + new BlockCategoryMask( + this, + BlockCategories.DEEPSLATE_ORE_REPLACEABLES + ), deepslate_ore, ore + ); + } else { + patternFunc = (ore, deepslate_ore) -> ore; + } + + addOre(region, mask, BlockTypes.GRAVEL, 33, 14, 100, getMinY(), getMaxY(), false); + + addOre(region, mask, BlockTypes.ANDESITE, 33, 2, 100, 0, 60, false); // Lower + addOre(region, mask, BlockTypes.ANDESITE, 33, 1, 17, 64, 128, false); // Upper + + addOre(region, mask, BlockTypes.DIORITE, 33, 2, 100, 0, 60, false); // Lower + addOre(region, mask, BlockTypes.DIORITE, 33, 1, 17, 64, 128, false); // Upper + + addOre(region, mask, BlockTypes.GRANITE, 33, 2, 100, 0, 60, false); // Lower + addOre(region, mask, BlockTypes.GRANITE, 33, 1, 17, 64, 128, false); // Upper + + addOre(region, mask, BlockTypes.TUFF, 33, 2, 100, getMinY(), 0, false); + + addOre(region, mask, BlockTypes.DIRT, 33, 7, 100, 0, 160, false); + + addOre( // Lower + region, + mask, + patternFunc.apply(BlockTypes.COAL_ORE, BlockTypes.DEEPSLATE_COAL_ORE), + 17, + 20, + 100, + 0, + 192, + true + ); + addOre( // Upper + region, + mask, + patternFunc.apply(BlockTypes.COAL_ORE, BlockTypes.DEEPSLATE_COAL_ORE), + 17, + 30, + 100, + 136, + getMaxY(), + false + ); + + addOre( + region, + mask, + patternFunc.apply(BlockTypes.COPPER_ORE, BlockTypes.DEEPSLATE_COPPER_ORE), + 13, + 16, + 100, + -16, + 112, + true + ); + + addOre( // Small + region, + mask, + patternFunc.apply(BlockTypes.IRON_ORE, BlockTypes.DEEPSLATE_IRON_ORE), + 9, + 10, + 100, + getMinY(), + 72, + false + ); // Middle + addOre( + region, + mask, + patternFunc.apply(BlockTypes.IRON_ORE, BlockTypes.DEEPSLATE_IRON_ORE), + 9, + 10, + 100, + -24, + 56, + true + ); + addOre( // Upper + region, + mask, + patternFunc.apply(BlockTypes.IRON_ORE, BlockTypes.DEEPSLATE_IRON_ORE), + 9, + 90, + 100, + 80, + 384, + true + ); + + addOre( // Lower + region, + mask, + patternFunc.apply(BlockTypes.GOLD_ORE, BlockTypes.DEEPSLATE_GOLD_ORE), + 9, + 1, + 50, + -64 + , + -48, + false + ); + addOre( + region, + mask, + patternFunc.apply(BlockTypes.GOLD_ORE, BlockTypes.DEEPSLATE_GOLD_ORE), + 9, + 4, + 100, + -64, + 32, + true + ); + + addOre( + region, + mask, + patternFunc.apply(BlockTypes.REDSTONE_ORE, BlockTypes.DEEPSLATE_REDSTONE_ORE), + 8, + 8, + 100, + -32, + 32, + true + ); + addOre( + region, + mask, + patternFunc.apply(BlockTypes.REDSTONE_ORE, BlockTypes.DEEPSLATE_REDSTONE_ORE), + 8, + 4, + 100, + getMinY(), + 15, + false + ); + + int diaMin = getMinY() - 80; + int diaMax = getMinY() + 80; + addOre( + region, + mask, + patternFunc.apply(BlockTypes.DIAMOND_ORE, BlockTypes.DEEPSLATE_DIAMOND_ORE), + 5, + 7, + 100, + diaMin, + diaMax, + true + ); + addOre( // Medium + region, + mask, + patternFunc.apply(BlockTypes.DIAMOND_ORE, BlockTypes.DEEPSLATE_DIAMOND_ORE), + 8, + 2, + 100, + -64, + -4, + false + ); + addOre( // Large + region, + mask, + patternFunc.apply(BlockTypes.DIAMOND_ORE, BlockTypes.DEEPSLATE_DIAMOND_ORE), + 23, + 1, + 11, + diaMin, + diaMax, + true + ); + addOre( // Buried + region, + mask, + patternFunc.apply(BlockTypes.DIAMOND_ORE, BlockTypes.DEEPSLATE_DIAMOND_ORE), + 10, + 4, + 100, + diaMin, + diaMax, + true + ); + + addOre(region, mask, patternFunc.apply(BlockTypes.LAPIS_ORE, BlockTypes.DEEPSLATE_LAPIS_ORE), 7, 2, 100, -32, 32, true); + addOre( // Buried + region, + mask, + patternFunc.apply(BlockTypes.LAPIS_ORE, BlockTypes.DEEPSLATE_LAPIS_ORE), + 7, + 4, + 100, + getMinY(), + 64, + false + ); + + addOre( + region, + mask, + patternFunc.apply(BlockTypes.EMERALD_ORE, BlockTypes.DEEPSLATE_EMERALD_ORE), + 5, + 100, + 100, + -16, + 480, + true + ); } /**