Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ jobs:
if-no-files-found: error
retention-days: 30
path: |
build/libs/RealisticDeposits-0.6.0.110021.jar
build/libs/RealisticDeposits-0.6.0.110021-sources.jar
build/libs/RealisticDeposits-0.6.0.110021-javadoc.jar
build/libs/RealisticDeposits-0.7.0.110021.jar
build/libs/RealisticDeposits-0.7.0.110021-sources.jar
build/libs/RealisticDeposits-0.7.0.110021-javadoc.jar
build/release/SHA256SUMS
CHANGELOG.md

Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 0.7.0.110021

- Keep more ordinary coal, iron and lapis between major finds in fresh worlds.
- Route new diamond starter workings around the pipe wall without changing
the pipe or river placer rewards.
- Search nearby natural marble when a lapis site fails to fit.
- Give rich and large emerald sites a bounded search for suitable positions,
without changing their ore budgets or ordinary emerald generation.
- Keep gold, saved ore rules, existing chunks and saved mine layouts unchanged.

## 0.6.0.110021

Beta for Minecraft 1.10.2.
Expand Down
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ It runs on [MMD OreSpawn](https://github.com/MinecraftModDevelopmentMods/OreSpaw
The project starts with Minecraft 1.10.2 and is intended to follow the
maintained OreSpawn branches across Forge and NeoForge.

Version 0.6.0.110021 is a local candidate for Minecraft 1.10.2. It adds rare
emerald pockets and occasional abandoned workings without reducing ordinary
emerald generation. Try a fresh world to see the new rules: existing
Version 0.7.0.110021 adjusts the balance for fresh Minecraft 1.10.2 worlds.
Coal, iron and lapis keep more ordinary ore between mines, diamond starter
workings follow the pipe wall, and some lapis and emerald sites can retry a
poor fit. Ordinary emerald generation is unchanged. Existing
worlds keep their settings, generated chunks and saved mine layouts. Back up
important worlds before updating.

Expand Down Expand Up @@ -97,12 +98,12 @@ folded horizon, a 160–240 block down-dip span, and a 3–8 block thickness. It
`density` controls the disseminated halo around the connected mineralized
routes rather than producing a uniformly random cloud. Two or three faults
introduce short, recoverable breaks and modest vertical or lateral offsets.
The shipped iron definition uses `hybrid` interaction with 15% background iron
The shipped iron definition uses `hybrid` interaction with 25% background iron
so early play remains viable while a discovered district can support a
long-lived mine and rail network.

The separate coal catalogue adds two to four beds across a large coalfield,
keeping 15% ordinary background coal. It favours sedimentary and wetland basins
keeping 25% ordinary background coal. It favours sedimentary and wetland basins
while allowing sedimentary cover in some other geological regions. Coalfields
use plain stone without physical strata, or suitable existing sedimentary
rocks when those strata are active. Old catalogues are never overwritten, and
Expand All @@ -119,7 +120,9 @@ Lapis occurs in smaller, irregular lenses rather than huge ore-filled layers.
With physical Mineralogy strata, lenses fit into natural marble; limestone,
dolomite and decorative marble are not substitutes. Without those strata,
natural vanilla stone variants provide a simpler setting. The separate lapis
catalogue keeps 15% background generation. A discovery can supply a lasting
catalogue keeps 30% background generation. Where a proposed site doesn't fit
natural marble, the new defaults check nearby positions in the same region.
A discovery can supply a lasting
reserve because each vanilla lapis ore block drops several lapis pieces.

Deposits only affect newly generated chunks. Changing these settings does not
Expand Down
2 changes: 1 addition & 1 deletion docs/COALFIELDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ shows every setting.
- 32-chunk regions, with a 50% candidate chance before geological selection.
- 384-768 blocks along strike and 128-256 blocks across.
- Two to four beds, 1-3 blocks thick, separated by 4-12 blocks of rock.
- Hybrid generation with 15% ordinary background coal.
- Hybrid generation with 25% ordinary background coal in fresh defaults.
- Abandoned workings attempted at every new coalfield where safe. Existing
catalogues and saved-world settings keep their choices.

Expand Down
7 changes: 6 additions & 1 deletion docs/DIAMONDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ diamond-bearing river gravel. The 1-in-16 gravel roll stays fixed; pipes make
up most of the supply, with river pockets as an occasional bonus. Ordinary
background generation stays at 15%.

The six-seed ore survey estimates 3.57 diamonds per chunk against 3.70 in
The original 0.3 six-seed ore survey estimated 3.57 diamonds per chunk against 3.70 in
the matched vanilla controls, before Fortune. Calibration and separate holdout
averages both fall within 20% of their controls. The estimated split is about
83% pipes, 2% placers and 15% background diamonds. Fortune increases all three
Expand All @@ -23,6 +23,11 @@ Pipes occur in rare districts, normally beneath OreSpawn's stable cratons. Each
district contains one to three irregular bodies, wider near the top and narrower
at depth. Diamonds occur in patches rather than filling the whole body. A few
can occur close to the surface, but the upper parts are deliberately sparse.
With `shape.rim_workings` enabled in fresh defaults, abandoned galleries follow
the pipe wall and stairs approach from outside. A short inward cut can show
where to dig without opening the rich interior for you. This changes the
workings, not the pipe's ore plan. Older profiles without the setting retain
the original layout.

Pipes cut across existing rocks. Without Mineralogy, their hosts are natural
vanilla stone, granite, diorite and andesite. With physical Mineralogy strata,
Expand Down
10 changes: 7 additions & 3 deletions docs/EMERALDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ the workings are left for prospecting.

The fresh defaults use a 35% selection chance per 64-chunk region before
geology and host checks, at Y12–48 and with at least eight blocks of cover.
Eight percent of candidates that reach the layout stage try the larger
layout. If that does not fit the mountain-belt geology and eligible host,
the generator tries the ordinary layout instead. Large mines have a
Fourteen percent of candidates that reach the layout stage try the richer
layout. The fresh defaults try up to five positions or directions before
falling back to the ordinary layout. Large mines have a
separate 8% roll, only in regions not selected for small or rich finds.
They may try a second position if the first one doesn't fit.
They remain more geographically restricted than iron formations; all
their zones must fit the mountain-belt geology and eligible host rock. These are gameplay
ranges for individual finds, not estimates of a real mine's production.
Expand All @@ -51,6 +52,9 @@ the linked galleries, subject to the ordinary abandoned-mine setting.
The optional `shape.large_mine` sets the large-mine chance, zone count,
strike and ore budget. Large mines always plan their own prospecting clues;
the ordinary abandoned-mine setting still controls their starter workings.
Each upper tier's optional `fit_attempts` controls its bounded placement
search. Omit it for the original single attempt. Retries do not raise the ore
budget or relax the host requirement.
Leave `shape.large_mine` absent to keep the two-tier layout. Older catalogues
without these fields and existing world
profiles keep their previous settings. Generated chunks are never rewritten.
Expand Down
5 changes: 4 additions & 1 deletion docs/LAPIS.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ to eight pieces of lapis lazuli, averaging six before Fortune. Fortune increases
that yield; Silk Touch returns the ore block instead. No new processing
recipes, lapis grades or river placers are added.

The default catalogue retains 15% ordinary background lapis. New lenses are
The fresh default catalogue retains 30% ordinary background lapis. With
physical strata active, `shape.marble_search_radius` lets a failed site try
nearby positions inside the same region. The default radius is 96 blocks;
absent or zero keeps the original single-site search. New lenses are
deliberately concentrated, and their reward is not forced to equal vanilla's
overall supply. Structures, caves and water can interrupt a deposit or prevent
a safe mine entrance. Not every planned lens will be fully recoverable.
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ gradle_java_version=17
mod_id=realisticdeposits
mod_name=Realistic Deposits
mod_license=LGPL-2.1
mod_version=0.6.0.110021
mod_version=0.7.0.110021
mod_group=zone.moddev.mc.realisticdeposits
mod_authors=SkyBlade1978, the MMD Team
mod_description=Rare, massive, and geologically aware ore deposits powered by MMD OreSpawn.
Expand Down
2 changes: 1 addition & 1 deletion gradle/release.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ tasks.register('verifyJavadocOrdering') {
tasks.register('verifyReleaseConfiguration') {
group = 'verification'
doLast {
if (project.mod_version != '0.6.0.110021'
if (project.mod_version != '0.7.0.110021'
|| project.curseforge_project_id != '1689703'
|| project.mod_artifact != 'RealisticDeposits'
|| project.java_version != '8' || project.gradle_java_version != '17'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
public final class RealisticDeposits {
public static final String MOD_ID = "realisticdeposits";
public static final String NAME = "Realistic Deposits";
public static final String VERSION = "0.6.0.110021";
public static final String VERSION = "0.7.0.110021";
private static final OrePatternType STRATIFORM_SEAM = StratiformSeamPattern.type()
.setRegistryName(OreSpawnIntegration.PATTERN_ID);
private static final OrePatternType COAL_MEASURES = CoalMeasuresPattern.type()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,19 +122,21 @@ private static DepositShapeSettings shape(JsonObject shape, String path, List<St
if (shape.has("rich_find")) {
JsonObject spec = object(shape, "rich_find", path);
String richPath = path + " rich_find";
unknownKeys(spec, keys("chance", "pockets", "strike_length", "ore_blocks", "workings"), richPath, warnings);
unknownKeys(spec, keys("chance", "pockets", "strike_length", "ore_blocks", "workings", "fit_attempts"), richPath, warnings);
rich = new EmeraldPocketSettings.RichFind(number(spec, "chance", richPath),
integerRange(spec, "pockets", richPath), integerRange(spec, "strike_length", richPath),
integerRange(spec, "ore_blocks", richPath), bool(spec, "workings", false, richPath));
integerRange(spec, "ore_blocks", richPath), bool(spec, "workings", false, richPath),
spec.has("fit_attempts") ? integer(spec, "fit_attempts", richPath) : 1);
}
EmeraldPocketSettings.LargeMine large = null;
if (shape.has("large_mine")) {
String largePath = path + " large_mine";
JsonObject spec = object(shape, "large_mine", path);
unknownKeys(spec, keys("chance", "zones", "strike_length", "ore_blocks"), largePath, warnings);
unknownKeys(spec, keys("chance", "zones", "strike_length", "ore_blocks", "fit_attempts"), largePath, warnings);
large = new EmeraldPocketSettings.LargeMine(number(spec, "chance", largePath),
integerRange(spec, "zones", largePath), integerRange(spec, "strike_length", largePath),
integerRange(spec, "ore_blocks", largePath));
integerRange(spec, "ore_blocks", largePath),
spec.has("fit_attempts") ? integer(spec, "fit_attempts", largePath) : 1);
}
return new EmeraldPocketSettings(integerRange(shape, "pockets", path),
integerRange(shape, "strike_length", path), integerRange(shape, "ore_blocks", path),
Expand All @@ -143,12 +145,13 @@ private static DepositShapeSettings shape(JsonObject shape, String path, List<St

if ("lapis_lens".equals(type)) {
unknownKeys(shape, keys("type", "lenses", "strike_length", "width", "thickness",
"surface_cover", "legacy_selection_scale"), path + " shape", warnings);
"surface_cover", "legacy_selection_scale", "marble_search_radius"), path + " shape", warnings);

return new LapisLensSettings(integerRange(shape, "lenses", path),
integerRange(shape, "strike_length", path), integerRange(shape, "width", path),
integerRange(shape, "thickness", path), integerRange(shape, "surface_cover", path),
number(shape, "legacy_selection_scale", path));
number(shape, "legacy_selection_scale", path),
shape.has("marble_search_radius") ? integer(shape, "marble_search_radius", path) : 0);
}

if ("gold_lode".equals(type)) {
Expand All @@ -171,11 +174,12 @@ private static DepositShapeSettings shape(JsonObject shape, String path, List<St

if ("diamond_pipe".equals(type)) {
unknownKeys(shape, keys("type", "pipes", "upper_diameter", "root_y", "surface_cover",
"district_radius", "ore_density", "legacy_selection_scale"), path + " shape", warnings);
"district_radius", "ore_density", "legacy_selection_scale", "rim_workings"), path + " shape", warnings);
return new DiamondPipeSettings(integerRange(shape, "pipes", path),
integerRange(shape, "upper_diameter", path), integerRange(shape, "root_y", path),
integerRange(shape, "surface_cover", path), integer(shape, "district_radius", path),
number(shape, "ore_density", path), number(shape, "legacy_selection_scale", path));
number(shape, "ore_density", path), number(shape, "legacy_selection_scale", path),
bool(shape, "rim_workings", false, path));
}

if ("diamond_placer".equals(type)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ private int pipes(OreGenerationContext context, WorldServer world, Chunk chunk,
BlockBounds bounds = pipe.bounds();

if (source.abandonedMine().enabled()) {
MineWorkingsGenerator.offer(context, source, new DiamondPipeWorkingsBody(district, pipeIndex));
MineWorkingsGenerator.offer(context, source,
new DiamondPipeWorkingsBody(district, pipeIndex, source.pipe().rimWorkings()));
}
if (!bounds.intersectsChunk(context.chunkX(), context.chunkZ())) continue;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ public static void newServerSession() {
static LapisDistrict.Site site(DepositDefinition definition, MineTerrainSampler terrain,
Optional<GeologySampler> sampler, Set<IBlockState> hosts, boolean physical) {
return new LapisDistrict.Site() {
@Override public boolean hasPhysicalStrata() { return physical; }

@Override
public int surfaceY(int x, int z) {
return terrain.naturalSurfaceY(x, z);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static Optional<AbandonedMinePlan> plan(MineableDepositBody body,
for (int sign : offset == 0 ? new int[] {1} : new int[] {1, -1}) {
int height = initial + offset * sign;
if (height < landing.y() + 6 || height - landing.y() > MAXIMUM_SHAFT_DEPTH || height > 245) continue;
MinePoint entrance = MineDecline.plan(landing, height, body.identity().seed()).entrance();
MinePoint entrance = body.decline(landing, height).entrance();
if (surface.applyAsInt(entrance.x(), entrance.z()) == height) return plan(body, settings, height);
}
}
Expand Down Expand Up @@ -112,7 +112,7 @@ public static Optional<AbandonedMinePlan> plan(MineableDepositBody body,
if (air.contains(rubble)) blocks.put(rubble, MineBlock.COBBLESTONE);
}
}
MineDecline access = MineDecline.plan(landing, surfaceY, body.identity().seed());
MineDecline access = body.decline(landing, surfaceY);
access.build(blocks);
if (!sealClosedPockets(blocks, access.entrance(), landing)) return Optional.empty();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package zone.moddev.mc.realisticdeposits.geometry;

/** A shaft and short crosscuts through one pipe, without changing its ore plan. */
/** Short starter crosscuts for one pipe, without changing its ore plan. */
public final class DiamondPipeWorkingsBody implements MineableDepositBody {
private final DepositIdentity identity;
private final DiamondDistrict.Pipe pipe;
Expand All @@ -10,23 +10,32 @@ public final class DiamondPipeWorkingsBody implements MineableDepositBody {
private final double radius;
private final double cosine;
private final double sine;
private final boolean rim;
private final double bearing;
private final double height;
private final double phase;

public DiamondPipeWorkingsBody(DiamondDistrict district, int pipeIndex) {
this(district, pipeIndex, false);
}

public DiamondPipeWorkingsBody(DiamondDistrict district, int pipeIndex, boolean rim) {
pipe = district.pipes().get(pipeIndex);
DepositIdentity parent = district.identity();
identity = new DepositIdentity(parent.worldSeed(), parent.dimension(),
parent.definition() + "/pipe_" + pipeIndex, parent.regionX(), parent.regionZ(), parent.salt());

level = Math.max(10, pipe.bottomY() + (int) ((pipe.topY() - pipe.bottomY()) * 0.4D));
double height = (double) (level - pipe.bottomY()) / (pipe.topY() - pipe.bottomY());
double phase = StableHash.unit(pipe.seed()) * Math.PI * 2;
height = (double) (level - pipe.bottomY()) / (pipe.topY() - pipe.bottomY());
phase = StableHash.unit(pipe.seed()) * Math.PI * 2;
centerX = pipe.centerX() + Math.cos(phase) * pipe.upperRadius() * 0.25D * (1 - height);
centerZ = pipe.centerZ() + Math.sin(phase) * pipe.upperRadius() * 0.25D * (1 - height);
radius = (3 + (pipe.upperRadius() - 3) * Math.pow(height, 0.75D)) * 0.65D;

double direction = StableHash.unit(identity.seed()) * Math.PI * 2;
cosine = Math.cos(direction);
sine = Math.sin(direction);
this.rim = rim;
bearing = StableHash.unit(identity.seed()) * Math.PI * 2;
cosine = Math.cos(bearing);
sine = Math.sin(bearing);
}

@Override public DepositIdentity identity() { return identity; }
Expand All @@ -39,8 +48,33 @@ public DiamondPipeWorkingsBody(DiamondDistrict district, int pipeIndex) {
@Override public int maximumCandidateYAt(int x, int z) { return pipe.topY(); }
@Override public boolean isOreAt(int x, int y, int z) { return pipe.isOreAt(x, y, z); }

@Override
public MineDecline decline(MinePoint landing, int surfaceY) {
if (!rim) return MineableDepositBody.super.decline(landing, surfaceY);
// Flights run tangentially. Each switchback steps outward so the
// widening pipe doesn't swallow the stairs as they approach the surface.
double x = landing.x() + 0.5 - centerX;
double z = landing.z() + 0.5 - centerZ;
int xDirection = x >= 0 ? 0 : 2;
int zDirection = z >= 0 ? 1 : 3;
boolean dominantX = Math.abs(x) >= Math.abs(z);
return MineDecline.plan(landing, surfaceY, identity.seed(),
dominantX ? zDirection : xDirection, dominantX ? xDirection : zDirection);
}

@Override
public MinePoint miningRoutePoint(double along, double lateralOffset) {
if (rim) {
// Follow the irregular wall in country rock; the inward branch only
// grazes the pipe. Its grade, envelope and ore coordinates stay intact.
double angle = bearing + along / 36.0D;
double wall = 1 + 0.10 * Math.sin(angle * 3 + phase + height * 2)
+ 0.06 * Math.sin(angle * 7 + phase - height * 4);
double wallRadius = (3 + (pipe.upperRadius() - 3) * Math.pow(height, 0.75D)) * wall;
double distance = wallRadius + 3.0D + lateralOffset * 0.25D;
return new MinePoint((int) Math.floor(centerX + distance * Math.cos(angle)), level,
(int) Math.floor(centerZ + distance * Math.sin(angle)));
}
// Keep the galleries inside the wider part of the pipe. The surface
// ladder reaches this level; miners can then follow the ore downwards.
double forward = along * radius / 36.0D;
Expand Down
Loading
Loading