Compare commits

..
2 Commits
Author SHA1 Message Date
dnorberg 84a1f32732 Organize creative pages and stabilize GameTests
Build / build (push) Canceled after 0s
2026-10-02 14:49:41 -04:00
dnorberg a7b2c24915 Apply authored Age environment symbols (#34)
Build / build (push) Canceled after 0s
2026-10-01 17:28:20 -04:00
42 changed files with 549 additions and 129 deletions

No files matched your search

+3
View File
@@ -79,6 +79,9 @@ With JEI installed, Rivencraft displays the Ink Mixer operation in its own
category and the hand-use, copying, binding, and Linking Book crafting flows in a Writing category. category and the hand-use, copying, binding, and Linking Book crafting flows in a Writing category.
The Link Panel and individual symbol Pages, including registered vanilla biome The Link Panel and individual symbol Pages, including registered vanilla biome
pages, appear as separately searchable JEI ingredients. pages, appear as separately searchable JEI ingredients.
Creative inventory separates Link Pages and each symbol category into their own
tabs, including distinct Biome and Biome Generation tabs. Blank Pages are hidden
from creative inventory and JEI.
JEI is optional; vanilla crafting JEI is optional; vanilla crafting
recipes and all writing interactions work without it. For a development client recipes and all writing interactions work without it. For a development client
with JEI, run `./gradlew runClient -PwithJei=true`. with JEI, run `./gradlew runClient -PwithJei=true`.
+1 -1
View File
@@ -17,7 +17,7 @@ tasks.named('wrapper', Wrapper).configure {
version = mod_version version = mod_version
group = mod_group_id group = mod_group_id
List<String> archivedGameTestSuites = ['linking', 'writing', 'grammar', 'desk', 'binder', 'mixer', 'recipe'] List<String> archivedGameTestSuites = ['linking', 'environment', 'writing', 'grammar', 'desk', 'binder', 'mixer', 'recipe']
List<String> selectedArchivedGameTestSuites = providers.gradleProperty('withArchivedGameTests') List<String> selectedArchivedGameTestSuites = providers.gradleProperty('withArchivedGameTests')
.map { it.toBoolean() }.orElse(false).get() ? archivedGameTestSuites .map { it.toBoolean() }.orElse(false).get() ? archivedGameTestSuites
: providers.gradleProperty('archivedGameTestSuites').orElse('').get() : providers.gradleProperty('archivedGameTestSuites').orElse('').get()
+28 -4
View File
@@ -47,14 +47,16 @@ in the Binder. Bundled controls are Native, Single, Tiled, Grid, and Tiny throug
Huge regions. Single needs one distinct biome; Tiled/Grid and Tiny–Huge need Huge regions. Single needs one distinct biome; Tiled/Grid and Tiny–Huge need
two. An authored book receives seeded filler only when it falls below that two. An authored book receives seeded filler only when it falls below that
minimum, while extra authored pages are retained as weighted entries. A book minimum, while extra authored pages are retained as weighted entries. A book
with no biome pages selects a seeded count from 2–4 for Tiled/Grid or 2–6 for with no biome pages selects a seeded count from two up to the number of
Tiny–Huge, capped by the number of eligible terrain biomes. Single uses one; eligible biomes for Tiled/Grid and Tiny–Huge. The eligible pool comes from the
Native uses its preset biome pool. These random-age maximums do not truncate terrain's biome preset, or `#rivencraft:cave_biomes` for Cave terrain, so future
biome integrations can expand it without changing the count rule. Single uses
one; Native uses its preset biome pool. This random-age maximum does not truncate
authored pages: the Binder's 27 symbol-page positions bound an authored book. authored pages: the Binder's 27 symbol-page positions bound an authored book.
Native cannot be paired with explicit biome pages. Legacy filled Tiny–Huge to Native cannot be paired with explicit biome pages. Legacy filled Tiny–Huge to
three; Rivencraft deliberately uses two so a pair of written biome pages stays three; Rivencraft deliberately uses two so a pair of written biome pages stays
exactly as written. exactly as written.
The Pages creative tab offers pages for every registered vanilla biome. The Biome Pages creative tab offers pages for every registered vanilla biome.
Hand-authored symbol definitions take precedence; the remaining vanilla pages Hand-authored symbol definitions take precedence; the remaining vanilla pages
are generated from the biome registry, so they do not each need a JSON file. are generated from the biome registry, so they do not each need a JSON file.
Custom/modded biomes still require a data-pack symbol definition. Custom/modded biomes still require a data-pack symbol definition.
@@ -79,6 +81,28 @@ eligible fallback for that load; restoring the biome recovers the original
selection. Generation-version-15 Ages keep their prior registry-wide biome selection. Generation-version-15 Ages keep their prior registry-wide biome
selection algorithm instead of being silently regenerated. selection algorithm instead of being silently regenerated.
## Written environment
Lighting pages select Normal, Dark, or Bright lighting for the new Age. A Sky
page selects Minecraft's Overworld, Nether, or End sky effects; the chosen
effects also determine the destination preview backdrop. Overworld sky tint
continues to come from the destination biome. A written sky changes only that
Age's dimension type, not the source world or other Ages.
Normal, Fast, Slow, Off, Always, and Storm weather pages use the existing Age
weather controller. Zero, Half, Full, and Double Length pages set the day-cycle
period, and Nadir, Rising, Zenith, and Setting pages set its initial phase.
Repeated numeric modifiers combine in written order. A Zero Length Age keeps
the nonzero minimum clock rate that avoids client skybox bounce. Pages for
Cloudy, forced Rain, and Snow are not offered: vanilla precipitation rendering
cannot reproduce those Legacy distinctions yet, and Snow remains planned for
the optional season integrations. A data pack that supplies these unsupported
weather choices receives a binding error rather than a false success.
The category creative tabs and optional JEI page ingredients use the same generated
index of bundled environment symbols. Existing Age definitions and page-free
random Ages retain their saved or seeded environment unchanged.
## Persistence and reload behavior ## Persistence and reload behavior
An Age permanently stores its selected profile ID, generation version, seed, An Age permanently stores its selected profile ID, generation version, seed,
+24 -3
View File
@@ -8,7 +8,7 @@ data migration, workstation transactions, and forged/replayed menu actions.
./gradlew runGameTestServer ./gradlew runGameTestServer
``` ```
The remaining 56 Rivencraft tests are archived, not deleted. They cover The remaining 58 Rivencraft tests are archived, not deleted. They cover
completed milestone details such as every Age terrain profile, Notebook and completed milestone details such as every Age terrain profile, Notebook and
Desk surface interactions, refill edge cases, book assembly controls, and Desk surface interactions, refill edge cases, book assembly controls, and
workstation break/drop behavior. Run only the relevant archive alongside the workstation break/drop behavior. Run only the relevant archive alongside the
@@ -19,8 +19,8 @@ core tests when investigating an issue:
./gradlew runGameTestServer -ParchivedGameTestSuites=grammar,binder ./gradlew runGameTestServer -ParchivedGameTestSuites=grammar,binder
``` ```
Available suite names are `linking`, `writing`, `grammar`, `desk`, `binder`, `mixer`, and Available suite names are `linking`, `environment`, `writing`, `grammar`, `desk`,
`recipe`. Run all 79 Rivencraft tests before a `binder`, `mixer`, and `recipe`. Run all 81 Rivencraft tests before a
release or after broad cross-system changes: release or after broad cross-system changes:
```shell ```shell
@@ -41,3 +41,24 @@ Logs and configuration remain available. Cleanup never targets a custom
`-PgameTestRunDir` or a player world; callers using a custom directory manage `-PgameTestRunDir` or a player world; callers using a custom directory manage
it themselves. The full suite should still be run it themselves. The full suite should still be run
before shipping changes in the archived systems. before shipping changes in the archived systems.
## Manual Age unload/reload check
The automated suite does not unload a freshly generated Age. Minecraft can
queue point-of-interest block updates after generation; closing that Age's
region storage while a queued update is still pending can leave the dedicated
GameTest server waiting forever in `SectionStorage.readColumn`. Plan save/load,
terrain generation, and safe spawn remain automated; runtime unload/reload is
checked in a normal game session:
1. Back up the test world. Bind one Link-Panel-only Descriptive Book and one
Descriptive Book with a terrain page (for example, Island), using distinct
names. Bring a working way back to the Overworld.
2. Travel through each book, confirm the named Age and expected terrain, then
return to the Overworld. Close book screens and wait a few seconds.
3. With cheats enabled, run `/rivencraft age list` and record each Age's
`rivencraft:age/...` dimension ID. Run `/rivencraft age unload <dimension>`
for one Age at a time, then list again to confirm it is unloaded.
4. Reopen the same Descriptive Books and travel back. Confirm each book reaches
its original Age, the terrain and safe arrival remain intact, and no extra
Age entry was created. Save, restart the world, and repeat the book check.
+6 -8
View File
@@ -34,10 +34,9 @@ Invalid definitions are logged and excluded by the server. Menus and future
page synchronization must obtain resolved display metadata from the server; page synchronization must obtain resolved display metadata from the server;
clients never make a symbol valid by naming it. clients never make a symbol valid by naming it.
Rivencraft ships a small catalog covering terrain, biomes, lighting, weather, Rivencraft ships a catalog covering terrain, biomes, lighting, weather,
celestial behavior, and features. Its v2 semantics prepare for the full sky, celestial behavior, and features. The parser and compiler apply supported
Legacy-inspired grammar; writing still uses random Age fallback until the schema-v2 pages to newly created Ages; omitted branches retain seeded defaults.
parser and compiler are implemented.
## Persistent writing ## Persistent writing
@@ -54,9 +53,7 @@ book copies its writing and Age reference; merely copying it never creates a
new Age. The Book Binder creates the Age when its finished output is taken. new Age. The Book Binder creates the Age when its finished output is taken.
The Descriptive Book screen can inspect the ordered pages by turning them from The Descriptive Book screen can inspect the ordered pages by turning them from
the bottom corners and identifies unresolved IDs using server-provided symbol the bottom corners and identifies unresolved IDs using server-provided symbol
metadata. Until Milestone 5, the metadata. Page-free books continue to use random Age generation.
saved symbols are informational only: Age creation uses the existing random
fallback and does not apply them to generation.
Removing a data pack never removes its IDs from saved writing. A missing ID is Removing a data pack never removes its IDs from saved writing. A missing ID is
resolved as client-safe **Unresolved Symbol** display metadata while retaining resolved as client-safe **Unresolved Symbol** display metadata while retaining
@@ -108,7 +105,8 @@ imported at a chosen strip position; the empty Notebook remains recoverable.
The preview result is virtual. Taking the completed Descriptive Book commits the The preview result is virtual. Taking the completed Descriptive Book commits the
inputs once, creates its Age identity, and saves schema-versioned inputs once, creates its Age identity, and saves schema-versioned
`OrderedWriting` plus the Age reference on the book. Link-Panel-only books `OrderedWriting` plus the Age reference on the book. Link-Panel-only books
create random Ages. A written symbol does **not** yet change that generation. create random Ages. Supported written pages change the corresponding Age
generation branch; missing branches use seeded defaults.
Inputs, title, and pending Age identity survive Binder save/load; breaking the Inputs, title, and pending Age identity survive Binder save/load; breaking the
Binder returns stored inputs. The completed book retains both its writing and Binder returns stored inputs. The completed book retains both its writing and
Age identity through item save/load and copying. Age identity through item save/load and copying.
+3 -3
View File
@@ -4,10 +4,10 @@
New Binder writing has at most one Link Panel plus 27 symbol pages. The Link Panel must be first. A Link-Panel-only book, or an older book with no writing component, keeps the existing random Age path. Any authored supported symbol makes the book a partial or complete grammar. From 0.4.3.0, the server compiles it into a persistent Age plan before consuming Binder inputs or generating chunks. New Binder writing has at most one Link Panel plus 27 symbol pages. The Link Panel must be first. A Link-Panel-only book, or an older book with no writing component, keeps the existing random Age path. Any authored supported symbol makes the book a partial or complete grammar. From 0.4.3.0, the server compiles it into a persistent Age plan before consuming Binder inputs or generating chunks.
The supported order follows the representable subset of the [Legacy grammar audit](LEGACY_AGE_GRAMMAR_AUDIT.md): terrain; zero or more biome pages; biome controller; weather; lighting; zero or more period, angle, or phase modifiers; one celestial page; then zero or more distinct features. Biome pages precede the controller that consumes them, and celestial modifiers precede the celestial page. Terrain, controller, weather, lighting, and celestial are single-choice categories; identical repeats are duplicates and differing values conflict. Repeated modifiers are intentional. Biome pages may repeat, preserving author order and any future weighting; feature IDs may not repeat. The supported order follows the representable subset of the [Legacy grammar audit](LEGACY_AGE_GRAMMAR_AUDIT.md): terrain; zero or more biome pages; biome controller; weather; lighting; sky effects; zero or more period or phase modifiers; one celestial page; then zero or more distinct features. Biome pages precede the controller that consumes them, and celestial modifiers precede the celestial page. Terrain, controller, weather, lighting, sky, and celestial are single-choice categories; identical repeats are duplicates and differing values conflict. Repeated modifiers are intentional. Biome pages may repeat, preserving author order and any future weighting; feature IDs may not repeat. Angle modifiers remain recognized in the schema but are rejected at binding until a sky renderer can apply sun tilt.
Missing terrain, controller, weather, lighting, celestial, or the controller's minimum biome count is an **incomplete** warning, not an error: the compiler retains the seed-selected profile and traits for missing branches. The minimum is zero for Native, one for Single, and two for Tiled/Grid and Tiny–Huge. Native cannot consume authored biome pages; Single accepts only one. Unknown IDs, schema-v1 display-only symbols, wrong ordering, misplaced modifiers, duplicates, conflicts, missing/extra Link Panels, and oversized writing are errors. The Binder disables output and exposes the first error on the result-slot tooltip. When that error belongs to a page, its thumbnail is tinted and outlined red, the strip scrolls to it, and hovering it shows the diagnostic. This maps the parser's compact entry position back through any empty page positions. Rejected inputs remain removable. Binding an unwritten Descriptive Book rechecks its server-owned writing and reports the first error without creating an Age. A terrain symbol whose profile is unavailable is also rejected before Binder inputs are consumed. Missing terrain, controller, weather, lighting, celestial, or the controller's minimum biome count is an **incomplete** warning, not an error: the compiler retains the seed-selected profile and traits for missing branches. The minimum is zero for Native, one for Single, and two for Tiled/Grid and Tiny–Huge. Native cannot consume authored biome pages; Single accepts only one. Unknown IDs, schema-v1 display-only symbols, wrong ordering, misplaced modifiers, duplicates, conflicts, missing/extra Link Panels, and oversized writing are errors. The Binder disables output and exposes the first error on the result-slot tooltip. When that error belongs to a page, its thumbnail is tinted and outlined red, the strip scrolls to it, and hovering it shows the diagnostic. This maps the parser's compact entry position back through any empty page positions. Rejected inputs remain removable. Binding an unwritten Descriptive Book rechecks its server-owned writing and reports the first error without creating an Age. A terrain symbol whose profile is unavailable is also rejected before Binder inputs are consumed.
The plan stores the original writing order, the authoritative semantic value of each resolved symbol, the Age seed, and a copy of the selected runtime profile. An explicit terrain page replaces the random terrain selection; an omitted terrain uses the seed-selected profile. The built-in Standard, Amplified, Cave, Island, Flat, and Void terrain pages now select their matching generation resources. Age loading uses the frozen runtime profile and does not need the original symbol definition or runtime-profile JSON, though its referenced noise, biome-preset, and dimension-type registry entries must remain available. Existing bound books without plans are not reinterpreted. Page-free and Link-Panel-only books keep the pre-existing random path. Biome, lighting, weather, celestial, and feature effects are retained in the plan but will be applied in issues #33–#35; instability remains Milestone 6 work. The plan stores the original writing order, the authoritative semantic value of each resolved symbol, the Age seed, and a copy of the selected runtime profile. An explicit terrain page replaces the random terrain selection; an omitted terrain uses the seed-selected profile. The built-in Standard, Amplified, Cave, Island, Flat, and Void terrain pages select their matching generation resources. Age loading uses the frozen runtime profile and does not need the original symbol definition or runtime-profile JSON, though its referenced noise, biome-preset, and dimension-type registry entries must remain available. Existing bound books without plans are not reinterpreted. Page-free and Link-Panel-only books keep the pre-existing random path. Biome and environment pages now affect new Ages; feature effects remain issue #35 work, and instability remains Milestone 6 work.
The Rivencraft Pages creative tab reads a generated index of bundled symbol definitions. Adding another valid JSON symbol under `src/main/resources/data/rivencraft/rivencraft/symbols/` includes its page automatically in the next build; no Java starter-page list needs updating. The server catalog still decides whether that page is valid for writing. External server data-pack symbols are not included in this bundled index. The Rivencraft symbol-page creative tabs read a generated index of bundled symbol definitions and group Pages by each definition's category, except biome-controller roles, which appear in a separate Biome Generation tab rather than the Biome tab. Adding another valid JSON symbol under `src/main/resources/data/rivencraft/rivencraft/symbols/` includes its page in the matching category tab on the next build; a new bundled category receives its own tab. Link Pages have a separate tab. Blank Pages appear in neither the creative tabs nor JEI's ingredient list. The server catalog still decides whether a page is valid for writing. External server data-pack symbols are not included in this bundled index.
+1 -1
View File
@@ -36,7 +36,7 @@ mod_name=Rivencraft
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=LGPL-3.0-or-later mod_license=LGPL-3.0-or-later
# The mod version. Rivencraft uses the x.y.z.b policy documented in README.md. # The mod version. Rivencraft uses the x.y.z.b policy documented in README.md.
mod_version=0.4.5.3 mod_version=0.4.6.2
immersive_portals_version=6.0.7 immersive_portals_version=6.0.7
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources. # This should match the base package used for the mod sources.
@@ -64,24 +64,27 @@ public record AgeBiomeSelection(AgeTraits.BiomeDistribution distribution, List<R
+ " is not a cave or Nether biome; use #rivencraft:cave_biomes or #minecraft:is_nether"); + " is not a cave or Nether biome; use #rivencraft:cave_biomes or #minecraft:is_nether");
} }
} }
List<ResourceLocation> eligible = eligible(registries, profile); List<ResourceLocation> availableBiomes = eligible(registries, profile);
if (eligible.isEmpty()) throw new IllegalArgumentException("No eligible biomes for terrain " + profile.noiseSettings()); if (availableBiomes.isEmpty()) throw new IllegalArgumentException("No eligible biomes for terrain " + profile.noiseSettings());
if (distribution == AgeTraits.BiomeDistribution.NATIVE) { if (distribution == AgeTraits.BiomeDistribution.NATIVE) {
if (!authored.isEmpty()) throw new IllegalArgumentException("Native biome distribution cannot use biome pages"); if (!authored.isEmpty()) throw new IllegalArgumentException("Native biome distribution cannot use biome pages");
return new AgeBiomeSelection(distribution, profile.terrain() == AgeRuntimeProfile.Terrain.FLAT return new AgeBiomeSelection(distribution, profile.terrain() == AgeRuntimeProfile.Terrain.FLAT
? List.of(ResourceLocation.withDefaultNamespace("plains")) : eligible); ? List.of(ResourceLocation.withDefaultNamespace("plains")) : availableBiomes);
} }
List<ResourceLocation> selected = new ArrayList<>(authored); List<ResourceLocation> selected = new ArrayList<>(authored);
Set<ResourceLocation> distinct = new LinkedHashSet<>(selected); Set<ResourceLocation> distinct = new LinkedHashSet<>(selected);
int minimum = minimum(distribution); int minimum = minimum(distribution);
int target = minimum; int target = minimum;
if (authored.isEmpty()) { if (authored.isEmpty()) {
int maximum = Math.min(maximum(distribution), new LinkedHashSet<>(eligible).size()); // The terrain's available pool is the upper bound. For Cave terrain,
// eligible() returns the cave tag; other terrains use their preset.
int availableBiomeCount = new LinkedHashSet<>(availableBiomes).size();
int maximum = distribution == AgeTraits.BiomeDistribution.SINGLE ? 1 : availableBiomeCount;
if (maximum >= minimum) { if (maximum >= minimum) {
target += new Random(seed ^ 0x42494F4D45434F55L).nextInt(maximum - minimum + 1); target += new Random(seed ^ 0x42494F4D45434F55L).nextInt(maximum - minimum + 1);
} }
} }
List<ResourceLocation> filler = new ArrayList<>(eligible); List<ResourceLocation> filler = new ArrayList<>(availableBiomes);
java.util.Collections.shuffle(filler, new Random(seed ^ 0x42494F4D45504F4FL)); java.util.Collections.shuffle(filler, new Random(seed ^ 0x42494F4D45504F4FL));
for (ResourceLocation id : filler) { for (ResourceLocation id : filler) {
if (distinct.size() >= target) break; if (distinct.size() >= target) break;
@@ -128,12 +131,4 @@ public record AgeBiomeSelection(AgeTraits.BiomeDistribution distribution, List<R
}; };
} }
/** Random-age limits; authored biome pages are never truncated to this maximum. */
public static int maximum(AgeTraits.BiomeDistribution distribution) {
return switch (distribution) {
case NATIVE, SINGLE -> 1;
case TILED, GRID -> 4;
case TINY, SMALL, MEDIUM, LARGE, HUGE -> 6;
};
}
} }
@@ -180,6 +180,10 @@ public final class AgeDimensionService {
private static void applyInitialCelestialPhase(ServerLevel level, AgeDefinition age) { private static void applyInitialCelestialPhase(ServerLevel level, AgeDefinition age) {
long phaseTime = (long)(age.traits().celestialPhase() * Level.TICKS_PER_DAY); long phaseTime = (long)(age.traits().celestialPhase() * Level.TICKS_PER_DAY);
if (AgeEnvironmentCompiler.hasWrittenPhase(age.plan())) {
// Legacy's Nadir is midnight, while vanilla day time zero is sunrise.
phaseTime = (phaseTime + 18_000L) % Level.TICKS_PER_DAY;
}
level.setDayTime(phaseTime); level.setDayTime(phaseTime);
} }
@@ -482,7 +486,7 @@ public final class AgeDimensionService {
base.height(), base.height(),
base.logicalHeight(), base.logicalHeight(),
base.infiniburn(), base.infiniburn(),
base.effectsLocation(), AgeEnvironmentCompiler.skyEffects(age.plan(), base.effectsLocation()),
ambientLight, ambientLight,
base.monsterSettings() base.monsterSettings()
); );
@@ -0,0 +1,90 @@
package net.dnorberg.rivencraft.book;
import net.dnorberg.rivencraft.writing.SymbolSemantics;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.dimension.BuiltinDimensionTypes;
/** Resolves written environment pages without changing the seeded page-free Age path. */
public final class AgeEnvironmentCompiler {
private AgeEnvironmentCompiler() {}
public static AgeTraits apply(AgeGenerationPlan plan, AgeTraits seeded) {
if (plan == null) return seeded;
AgeTraits.Lighting lighting = seeded.lighting();
AgeTraits.Weather weather = seeded.weather();
double period = seeded.celestialPeriod();
float phase = seeded.celestialPhase();
boolean normalTime = plan.symbols().stream()
.anyMatch(symbol -> symbol.semantics().role() == SymbolSemantics.Role.CELESTIAL);
if (normalTime) period = 1.0D;
boolean writtenPeriod = false;
boolean writtenPhase = false;
float phaseDegrees = 0.0F;
for (AgeGenerationPlan.ResolvedSymbol symbol : plan.symbols()) {
SymbolSemantics semantics = symbol.semantics();
switch (semantics.role()) {
case LIGHTING -> lighting = AgeTraits.Lighting.valueOf(
((SymbolSemantics.ChoiceValue) semantics.value()).id().toUpperCase(java.util.Locale.ROOT));
case WEATHER -> {
String choice = ((SymbolSemantics.ChoiceValue) semantics.value()).id();
if (choice.equals("snow")) {
throw new IllegalArgumentException("Always Snow requires optional season integration");
}
if (choice.equals("cloudy") || choice.equals("rain")) {
throw new IllegalArgumentException(choice + " weather needs precipitation rendering support");
}
weather = AgeTraits.Weather.valueOf(choice.toUpperCase(java.util.Locale.ROOT));
}
case PERIOD_MODIFIER -> {
double next = ((SymbolSemantics.NumberValue) semantics.value()).amount();
period = writtenPeriod ? (period + next) / 2.0D : next;
writtenPeriod = true;
}
case PHASE_MODIFIER -> {
float next = (float) ((SymbolSemantics.NumberValue) semantics.value()).amount();
phaseDegrees = writtenPhase ? circularMidpoint(phaseDegrees, next) : next;
writtenPhase = true;
}
case ANGLE_MODIFIER -> throw new IllegalArgumentException(
"Sun angle pages require a custom sky renderer and are not supported yet");
default -> { }
}
}
if (writtenPhase) phase = phaseDegrees / 360.0F;
return new AgeTraits(plan.biomeSelection() == null ? seeded.biomeDistribution()
: plan.biomeSelection().distribution(), lighting, weather, period,
seeded.celestialAngle(), phase);
}
/** Vanilla effects are the sky styles the current renderer can honor exactly. */
public static ResourceLocation skyEffects(AgeGenerationPlan plan, ResourceLocation fallback) {
if (plan == null) return fallback;
return plan.symbols().stream()
.filter(symbol -> symbol.semantics().role() == SymbolSemantics.Role.SKY)
.map(symbol -> ((SymbolSemantics.ChoiceValue) symbol.semantics().value()).id())
.map(choice -> switch (choice) {
case "overworld" -> BuiltinDimensionTypes.OVERWORLD_EFFECTS;
case "nether" -> BuiltinDimensionTypes.NETHER_EFFECTS;
case "end" -> BuiltinDimensionTypes.END_EFFECTS;
default -> throw new IllegalArgumentException("Unsupported sky effect " + choice);
}).findFirst().orElse(fallback);
}
public static boolean hasWrittenPhase(AgeGenerationPlan plan) {
return plan != null && plan.symbols().stream()
.anyMatch(symbol -> symbol.semantics().role() == SymbolSemantics.Role.PHASE_MODIFIER);
}
public static int previewSkyColor(ResourceLocation effects, int biomeSkyColor) {
if (effects.equals(BuiltinDimensionTypes.NETHER_EFFECTS)) return 0xFF6B2725;
if (effects.equals(BuiltinDimensionTypes.END_EFFECTS)) return 0xFF211835;
return biomeSkyColor;
}
private static float circularMidpoint(float current, float next) {
float difference = (next - current + 540.0F) % 360.0F - 180.0F;
return (current + difference / 2.0F + 360.0F) % 360.0F;
}
}
@@ -65,10 +65,12 @@ public record AgeGenerationPlan(int version, long ageSeed, OrderedWriting writin
AgeRuntimeProfile profile = AgeRuntimeProfiles.profiles().get(selected); AgeRuntimeProfile profile = AgeRuntimeProfiles.profiles().get(selected);
if (profile == null) throw new IllegalArgumentException("Unsupported Age terrain profile " + selected); if (profile == null) throw new IllegalArgumentException("Unsupported Age terrain profile " + selected);
AgeBiomeSelection biomes = AgeBiomeSelection.compile(parsed, traits, profile, ageSeed, registries); AgeBiomeSelection biomes = AgeBiomeSelection.compile(parsed, traits, profile, ageSeed, registries);
return new AgeGenerationPlan(CURRENT_VERSION, ageSeed, writing, AgeGenerationPlan plan = new AgeGenerationPlan(CURRENT_VERSION, ageSeed, writing,
parsed.symbols().stream().map(symbol -> new ResolvedSymbol( parsed.symbols().stream().map(symbol -> new ResolvedSymbol(
symbol.index(), symbol.reference(), symbol.semantics())).toList(), symbol.index(), symbol.reference(), symbol.semantics())).toList(),
profile, biomes); profile, biomes);
AgeEnvironmentCompiler.apply(plan, traits);
return plan;
} }
public ResourceLocation authoredTerrain() { public ResourceLocation authoredTerrain() {
@@ -124,7 +124,7 @@ public final class AgeRegistrySavedData extends SavedData {
createdGameTime, createdGameTime,
dimensionId, dimensionId,
null, null,
traits, AgeEnvironmentCompiler.apply(plan, traits),
plan plan
); );
ages.put(created.id(), created); ages.put(created.id(), created);
@@ -0,0 +1,154 @@
package net.dnorberg.rivencraft.book;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import java.util.stream.Collectors;
import net.dnorberg.rivencraft.item.PageItem;
import net.dnorberg.rivencraft.registry.ModCreativeTabs;
import net.dnorberg.rivencraft.writing.OrderedWriting;
import net.dnorberg.rivencraft.writing.PageContent;
import net.dnorberg.rivencraft.writing.SymbolCatalog;
import net.dnorberg.rivencraft.writing.SymbolReference;
import net.dnorberg.rivencraft.writing.WritingEntry;
import net.minecraft.gametest.framework.GameTest;
import net.minecraft.gametest.framework.GameTestHelper;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.dimension.BuiltinDimensionTypes;
import net.neoforged.neoforge.gametest.GameTestHolder;
import net.neoforged.neoforge.gametest.PrefixGameTestTemplate;
/** Issue #34: written environment effects and the shared creative/JEI page feed. */
@GameTestHolder("rivencraft_archive_environment")
@PrefixGameTestTemplate(false)
public final class EnvironmentWritingGameTests {
private EnvironmentWritingGameTests() {}
@GameTest(template = "empty")
public static void symbolCategoriesPartitionCreativePages(GameTestHelper helper) {
var registries = helper.getLevel().registryAccess();
var allPages = PageItem.creativeSymbolPages(registries);
Set<ResourceLocation> collected = new HashSet<>();
helper.assertTrue(ModCreativeTabs.SYMBOL_PAGES.keySet().containsAll(PageItem.bundledCreativeCategories()),
"Every bundled page category must receive a creative tab");
for (ResourceLocation category : PageItem.bundledCreativeCategories()) {
var categoryPages = PageItem.creativeSymbolPages(registries, category);
helper.assertFalse(categoryPages.isEmpty(), "Every category tab must contain pages: " + category);
for (var page : categoryPages) {
helper.assertValueEqual(PageItem.creativeCategory(page), category,
"Category tabs must not mix symbol pages");
helper.assertTrue(collected.add(PageItem.content(page).symbol().orElseThrow().id()),
"A symbol page must appear in exactly one category tab");
}
}
helper.assertValueEqual(collected.size(), allPages.size(),
"Category tabs must contain every bundled and generated biome page");
var biomePages = PageItem.creativeSymbolPages(registries,
ResourceLocation.fromNamespaceAndPath("rivencraft", "biome"));
var generationPages = PageItem.creativeSymbolPages(registries,
ResourceLocation.fromNamespaceAndPath("rivencraft", "biome_generation"));
helper.assertTrue(biomePages.stream().anyMatch(page -> PageItem.content(page).symbol().orElseThrow()
.id().getPath().equals("biome/desert")), "Biome pages must remain in the Biome tab");
helper.assertFalse(biomePages.stream().anyMatch(page -> PageItem.content(page).symbol().orElseThrow()
.id().getPath().equals("biome/tiny")), "Biome generation types must leave the Biome tab");
helper.assertTrue(generationPages.stream().anyMatch(page -> PageItem.content(page).symbol().orElseThrow()
.id().getPath().equals("biome/tiny")), "Biome generation types need their own tab");
helper.assertTrue(allPages.stream().noneMatch(page -> PageItem.content(page).kind() == PageContent.Kind.BLANK),
"Blank pages must not enter the creative or JEI symbol-page feed");
helper.assertValueEqual(PageItem.content(PageItem.createLinkPanelPage()).kind(), PageContent.Kind.LINK_PANEL,
"Link pages must stay separate from symbol categories");
helper.succeed();
}
@GameTest(template = "empty")
public static void environmentPagesEnterCreativeAndJeiFeed(GameTestHelper helper) {
Set<String> expected = Set.of(
"lighting/normal", "lighting/dark", "lighting/bright",
"sky/overworld", "sky/nether", "sky/end",
"weather/normal", "weather/fast", "weather/slow", "weather/off",
"weather/always", "weather/storm", "celestial/normal_time",
"period/zero", "period/half", "period/full", "period/double",
"phase/nadir", "phase/rising", "phase/zenith", "phase/setting");
Set<String> creative = PageItem.creativeSymbolPages(helper.getLevel().registryAccess()).stream()
.map(PageItem::content)
.filter(content -> content.symbol().isPresent())
.map(content -> content.symbol().orElseThrow().id().getPath())
.collect(Collectors.toSet());
helper.assertTrue(PageItem.bundledCreativeSymbols().containsAll(expected)
&& creative.containsAll(expected),
"Every supported environment page must enter the creative index JEI also consumes");
for (String path : expected) {
var id = ResourceLocation.fromNamespaceAndPath("rivencraft", path);
helper.assertTrue(SymbolCatalog.isKnown(new SymbolReference(id))
&& PageItem.isUsableWriting(PageItem.createBundledCreativePage(path)),
"Environment page must resolve as valid writing: " + path);
}
helper.assertFalse(creative.contains("weather/snow") || creative.contains("weather/cloudy")
|| creative.contains("weather/rain"),
"Unsupported precipitation variants must not appear as working pages");
helper.succeed();
}
@GameTest(template = "empty")
public static void writtenEnvironmentPersistsAndPageFreeAgesStaySeeded(GameTestHelper helper) {
OrderedWriting writing = new OrderedWriting(List.of(
WritingEntry.linkPanel(),
page("terrain/standard"), page("weather/off"), page("lighting/dark"),
page("sky/end"), page("period/zero"), page("phase/rising"),
page("celestial/normal_time")));
AgeTraits seeded = AgeTraits.select(42L);
var plan = AgeGenerationPlan.compile(writing, 42L, AgeGenerationProfiles.STANDARD,
seeded, helper.getLevel().registryAccess());
var effective = AgeEnvironmentCompiler.apply(plan, seeded);
helper.assertValueEqual(effective.lighting(), AgeTraits.Lighting.DARK,
"Written Dark Lighting must override the seeded lighting");
helper.assertValueEqual(effective.weather(), AgeTraits.Weather.OFF,
"Written No Weather must override the seeded weather");
helper.assertTrue(effective.hasStoppedCelestialCycle(),
"A written Zero Length page must stop the celestial cycle");
helper.assertValueEqual(effective.celestialPhase(), 0.25F,
"Written Rising phase must be stored as a quarter turn");
helper.assertValueEqual(AgeEnvironmentCompiler.skyEffects(plan, BuiltinDimensionTypes.OVERWORLD_EFFECTS),
BuiltinDimensionTypes.END_EFFECTS, "Written End Sky must select the End sky effects");
helper.assertValueEqual(AgeEnvironmentCompiler.previewSkyColor(BuiltinDimensionTypes.END_EFFECTS, 0xFF77AAFF),
0xFF211835, "End sky preview must not retain an Overworld biome's blue tint");
helper.assertValueEqual(AgeEnvironmentCompiler.previewSkyColor(BuiltinDimensionTypes.NETHER_EFFECTS, 0xFF77AAFF),
0xFF6B2725, "Nether sky preview must use its red tint");
helper.assertValueEqual(AgeEnvironmentCompiler.previewSkyColor(BuiltinDimensionTypes.OVERWORLD_EFFECTS, 0xFF77AAFF),
0xFF77AAFF, "Overworld sky preview must retain the destination biome tint");
helper.assertValueEqual(AgeEnvironmentCompiler.apply(AgeGenerationPlan.load(plan.save()), seeded), effective,
"Written environment values must survive a plan save/load round trip");
helper.assertValueEqual(AgeEnvironmentCompiler.apply(null, seeded), seeded,
"Page-free Ages must retain their seeded environment without recompilation");
var player = helper.makeMockServerPlayerInLevel();
var reference = new AgeReference(UUID.randomUUID(), "Written Environment");
var target = AgeDimensionService.resolve(player, reference, writing).orElseThrow();
var definition = AgeRegistrySavedData.get(helper.getLevel()).find(reference.id()).orElseThrow();
helper.assertValueEqual(definition.traits(), AgeEnvironmentCompiler.apply(
definition.plan(), AgeTraits.select(definition.seed())),
"The effective authored environment must persist with the Age definition");
helper.runAfterDelay(1, () -> {
var level = helper.getLevel().getServer().getLevel(target.location().dimension());
helper.assertTrue(level != null, "Written environment Age must load");
helper.assertFalse(level.dimensionType().hasSkyLight(), "Dark Lighting must remove skylight");
helper.assertValueEqual(level.dimensionType().effectsLocation(), BuiltinDimensionTypes.END_EFFECTS,
"The runtime Age must render the written End sky");
helper.assertValueEqual(level.getDayTimePerTick(), Float.MIN_VALUE,
"Zero Length must use the non-bouncing stopped clock");
helper.assertTrue(Math.floorMod(level.getDayTime(), 24_000L) < 5L,
"Legacy Rising phase must begin at vanilla sunrise");
level.setWeatherParameters(0, 6_000, true, true);
helper.runAfterDelay(2, () -> {
helper.assertFalse(level.isRaining() || level.isThundering(),
"Written No Weather must clear rain and thunder in this Age");
helper.succeed();
});
});
}
private static WritingEntry page(String path) {
return WritingEntry.symbol(new SymbolReference(ResourceLocation.fromNamespaceAndPath("rivencraft", path)));
}
}
@@ -147,16 +147,42 @@ public final class TerrainWritingGameTests {
var randomWriting = net.dnorberg.rivencraft.writing.WritingGrammar.parse(OrderedWriting.EMPTY); var randomWriting = net.dnorberg.rivencraft.writing.WritingGrammar.parse(OrderedWriting.EMPTY);
var traits = new AgeTraits(AgeTraits.BiomeDistribution.TINY, AgeTraits.Lighting.NORMAL, var traits = new AgeTraits(AgeTraits.BiomeDistribution.TINY, AgeTraits.Lighting.NORMAL,
AgeTraits.Weather.NORMAL, 1.0D, 0.0F, 0.0F); AgeTraits.Weather.NORMAL, 1.0D, 0.0F, 0.0F);
int availableBiomeCount = new java.util.LinkedHashSet<>(AgeBiomeSelection.eligible(registries, profile)).size();
java.util.Set<Integer> counts = new java.util.HashSet<>(); java.util.Set<Integer> counts = new java.util.HashSet<>();
for (long seed = 0; seed < 64; seed++) { for (long seed = 0; seed < 64; seed++) {
var random = AgeBiomeSelection.compile(randomWriting, traits, profile, seed, registries); var random = AgeBiomeSelection.compile(randomWriting, traits, profile, seed, registries);
helper.assertTrue(random.biomes().size() >= 2 && random.biomes().size() <= 6, helper.assertTrue(random.biomes().size() >= 2 && random.biomes().size() <= availableBiomeCount,
"Random Tiny ages must select between two and six distinct biomes"); "Random Tiny ages must not exceed their available biome pool");
helper.assertValueEqual(random, AgeBiomeSelection.compile(randomWriting, traits, profile, seed, registries), helper.assertValueEqual(random, AgeBiomeSelection.compile(randomWriting, traits, profile, seed, registries),
"The random count and chosen biomes must be deterministic for an Age seed"); "The random count and chosen biomes must be deterministic for an Age seed");
counts.add(random.biomes().size()); counts.add(random.biomes().size());
} }
helper.assertTrue(counts.size() > 1, "Random Ages must vary their biome count across seeds"); helper.assertTrue(counts.size() > 1, "Random Ages must vary their biome count across seeds");
if (availableBiomeCount > 6) {
helper.assertTrue(counts.stream().anyMatch(count -> count > 6),
"The available biome pool, not the old fixed cap, must bound random Ages");
}
var tiledTraits = new AgeTraits(AgeTraits.BiomeDistribution.TILED, AgeTraits.Lighting.NORMAL,
AgeTraits.Weather.NORMAL, 1.0D, 0.0F, 0.0F);
if (availableBiomeCount > 4) {
boolean exceededOldCap = false;
for (long seed = 0; seed < 64; seed++) {
var random = AgeBiomeSelection.compile(randomWriting, tiledTraits, profile, seed, registries);
helper.assertTrue(random.biomes().size() >= 2 && random.biomes().size() <= availableBiomeCount,
"Random Tiled ages must not exceed their available biome pool");
exceededOldCap |= random.biomes().size() > 4;
}
helper.assertTrue(exceededOldCap, "Tiled Ages must also be able to exceed the old fixed cap");
}
var caveProfile = AgeRuntimeProfiles.resolve(AgeGenerationProfiles.CAVE);
int caveBiomeCount = new java.util.LinkedHashSet<>(AgeBiomeSelection.eligible(registries, caveProfile)).size();
for (long seed = 0; seed < 64; seed++) {
var random = AgeBiomeSelection.compile(randomWriting, traits, caveProfile, seed, registries);
helper.assertTrue(random.biomes().size() >= 2 && random.biomes().size() <= caveBiomeCount,
"Random Cave ages must use the cave biome pool as their upper bound");
}
helper.succeed(); helper.succeed();
} }
@@ -180,18 +206,14 @@ public final class TerrainWritingGameTests {
helper.assertTrue(level.getChunkSource().getGenerator().getBiomeSource().possibleBiomes().stream() helper.assertTrue(level.getChunkSource().getGenerator().getBiomeSource().possibleBiomes().stream()
.allMatch(biome -> biome.is(Biomes.THE_END)), .allMatch(biome -> biome.is(Biomes.THE_END)),
"The runtime sky-island generator must use the End biome page"); "The runtime sky-island generator must use the End biome page");
helper.assertValueEqual(AgeDimensionService.unload(server, age), AgeDimensionService.UnloadResult.UNLOADED, helper.assertValueEqual(AgeGenerationPlan.load(age.plan().save()).biomeSelection(),
"The island Age must unload"); age.plan().biomeSelection(), "The authored End biome must survive a plan save/load round trip");
var reloaded = AgeDimensionService.ensureLoaded(server, age);
helper.assertTrue(reloaded != null && reloaded.getChunkSource().getGenerator().getBiomeSource()
.possibleBiomes().stream().allMatch(biome -> biome.is(Biomes.THE_END)),
"The authored End biome must survive runtime dimension reload");
helper.succeed(); helper.succeed();
}); });
} }
@GameTest(template = "empty", timeoutTicks = 600) @GameTest(template = "empty", timeoutTicks = 600)
public static void writtenTerrainFamiliesGenerateSafelyAndReload(GameTestHelper helper) { public static void writtenTerrainFamiliesGenerateSafely(GameTestHelper helper) {
var player = helper.makeMockServerPlayerInLevel(); var player = helper.makeMockServerPlayerInLevel();
checkWrittenTerrain(helper, player, AgeGenerationProfiles.all(), 0); checkWrittenTerrain(helper, player, AgeGenerationProfiles.all(), 0);
} }
@@ -233,14 +255,8 @@ public final class TerrainWritingGameTests {
&& level.getBlockState(spawn.above()).isAir(), && level.getBlockState(spawn.above()).isAir(),
"Every written terrain family must retain a safe arrival platform"); "Every written terrain family must retain a safe arrival platform");
helper.assertValueEqual(AgeDimensionService.unload(server, age), helper.assertValueEqual(AgeGenerationPlan.load(age.plan().save()).runtimeProfile(),
AgeDimensionService.UnloadResult.UNLOADED, age.plan().runtimeProfile(), "The written terrain profile must survive plan persistence");
"A written Age must unload without losing its plan");
var reloaded = AgeDimensionService.ensureLoaded(server, age);
helper.assertTrue(reloaded != null, "The written Age must reload from its frozen plan");
assertGenerator(helper, reloaded, age.plan().runtimeProfile());
helper.assertValueEqual(reloaded.dimensionType().effectsLocation(),
level.dimensionType().effectsLocation(), "Reload must retain dimension effects");
helper.runAfterDelay(1, () -> checkWrittenTerrain(helper, player, profiles, index + 1)); helper.runAfterDelay(1, () -> checkWrittenTerrain(helper, player, profiles, index + 1));
}); });
} }
@@ -247,8 +247,6 @@ public final class DescriptiveBookScreen extends Screen implements ExplorableBoo
x, top + 39, 126, color); x, top + 39, 126, color);
drawWrappedWithoutShadow(graphics, Component.literal(display.id().toString()), drawWrappedWithoutShadow(graphics, Component.literal(display.id().toString()),
x, top + 64, 126, color); x, top + 64, 126, color);
drawWrappedWithoutShadow(graphics, Component.translatable("screen.rivencraft.age.pages_not_applied"),
x, top + 137, 126);
} }
private void turnPage(int direction) { private void turnPage(int direction) {
@@ -19,6 +19,7 @@ import mezz.jei.api.registration.IRecipeRegistration;
import mezz.jei.api.registration.ISubtypeRegistration; import mezz.jei.api.registration.ISubtypeRegistration;
import mezz.jei.api.registration.IExtraIngredientRegistration; import mezz.jei.api.registration.IExtraIngredientRegistration;
import mezz.jei.api.ingredients.subtypes.IIngredientSubtypeInterpreter; import mezz.jei.api.ingredients.subtypes.IIngredientSubtypeInterpreter;
import mezz.jei.api.ingredients.subtypes.UidContext;
import mezz.jei.api.runtime.IJeiRuntime; import mezz.jei.api.runtime.IJeiRuntime;
import net.dnorberg.rivencraft.Rivencraft; import net.dnorberg.rivencraft.Rivencraft;
import net.dnorberg.rivencraft.item.PageItem; import net.dnorberg.rivencraft.item.PageItem;
@@ -74,6 +75,9 @@ public final class RivencraftJeiPlugin implements IModPlugin {
@Override @Override
public void onRuntimeAvailable(IJeiRuntime runtime) { public void onRuntimeAvailable(IJeiRuntime runtime) {
// JEI discovers the base Page item as a blank stack; only authored pages belong in its list.
runtime.getIngredientVisibility().hideIngredients(VanillaTypes.ITEM_STACK,
List.of(new ItemStack(ModItems.PAGE.get())), List.of(UidContext.Ingredient));
var connection = Minecraft.getInstance().getConnection(); var connection = Minecraft.getInstance().getConnection();
if (connection == null) return; if (connection == null) return;
Set<ResourceLocation> known = runtime.getIngredientManager().getAllItemStacks().stream() Set<ResourceLocation> known = runtime.getIngredientManager().getAllItemStacks().stream()
@@ -313,42 +313,6 @@ public final class LinkingGameTests {
throw new IllegalStateException("Could not select profile " + profile); throw new IllegalStateException("Could not select profile " + profile);
} }
@GameTest(template = "empty", timeoutTicks = 100)
public static void unloadedAgeReloadsWithTheSameDefinition(GameTestHelper helper) {
UUID id = UUID.randomUUID();
AgeDefinition definition = AgeRegistrySavedData.resolveOrCreate(
helper.getLevel(),
new AgeReference(id, "Lifecycle Test Age " + id)
);
var server = helper.getLevel().getServer();
var first = AgeDimensionService.ensureLoaded(server, definition);
helper.assertTrue(first != null, "The lifecycle test Age must load");
helper.runAfterDelay(1, () -> {
helper.assertValueEqual(
AgeDimensionService.unload(server, definition),
AgeDimensionService.UnloadResult.UNLOADED,
"A loaded Age must unload without deleting its definition"
);
helper.runAfterDelay(1, () -> {
helper.assertTrue(server.getLevel(AgeDimensionService.dimensionKey(definition)) == null,
"An unloaded Age must leave the active server level map");
var reloaded = AgeDimensionService.ensureLoaded(server, definition);
helper.assertTrue(reloaded != null, "A book must be able to reload an archived Age");
helper.runAfterDelay(1, () -> {
var registered = server.getLevel(AgeDimensionService.dimensionKey(definition));
helper.assertTrue(registered != null, "The reloaded Age must rejoin the active server level map");
helper.assertValueEqual(registered.getSeed(), definition.seed(),
"Reloading an Age must preserve its immutable seed");
helper.assertValueEqual(registered.dimension().location(), definition.dimensionId(),
"Reloading an Age must preserve its dimension identifier");
helper.succeed();
});
});
});
}
@GameTest(template = "empty", timeoutTicks = 200) @GameTest(template = "empty", timeoutTicks = 200)
public static void legacyBaseTerrainProfilesLoadRuntimeDimensions(GameTestHelper helper) { public static void legacyBaseTerrainProfilesLoadRuntimeDimensions(GameTestHelper helper) {
for (var profile : AgeGenerationProfiles.all()) { for (var profile : AgeGenerationProfiles.all()) {
@@ -421,9 +385,11 @@ public final class LinkingGameTests {
} }
if (profile.equals(AgeGenerationProfiles.AMPLIFIED)) { if (profile.equals(AgeGenerationProfiles.AMPLIFIED)) {
var biomeSource = level.getChunkSource().getGenerator().getBiomeSource(); var biomeSource = level.getChunkSource().getGenerator().getBiomeSource();
int availableBiomes = AgeBiomeSelection.eligible(helper.getLevel().registryAccess(),
AgeRuntimeProfiles.resolve(profile)).size();
helper.assertTrue(biomeSource.possibleBiomes().size() >= 2 helper.assertTrue(biomeSource.possibleBiomes().size() >= 2
&& biomeSource.possibleBiomes().size() <= 4, && biomeSource.possibleBiomes().size() <= availableBiomes,
"Random Tiled distribution must use two to four seeded biomes"); "Random Tiled distribution must stay within the available biome pool");
var origin = biomeSource.getNoiseBiome(0, 0, 0, null); var origin = biomeSource.getNoiseBiome(0, 0, 0, null);
var eastTile = biomeSource.getNoiseBiome(64, 0, 0, null); var eastTile = biomeSource.getNoiseBiome(64, 0, 0, null);
helper.assertFalse(origin.equals(eastTile), helper.assertFalse(origin.equals(eastTile),
@@ -431,9 +397,11 @@ public final class LinkingGameTests {
} }
if (profile.equals(AgeGenerationProfiles.ISLAND)) { if (profile.equals(AgeGenerationProfiles.ISLAND)) {
var biomeSource = level.getChunkSource().getGenerator().getBiomeSource(); var biomeSource = level.getChunkSource().getGenerator().getBiomeSource();
int availableBiomes = AgeBiomeSelection.eligible(helper.getLevel().registryAccess(),
AgeRuntimeProfiles.resolve(profile)).size();
helper.assertTrue(biomeSource.possibleBiomes().size() >= 2 helper.assertTrue(biomeSource.possibleBiomes().size() >= 2
&& biomeSource.possibleBiomes().size() <= 4, && biomeSource.possibleBiomes().size() <= availableBiomes,
"Random Grid distribution must use two to four seeded biomes"); "Random Grid distribution must stay within the available biome pool");
var origin = biomeSource.getNoiseBiome(0, 0, 0, null); var origin = biomeSource.getNoiseBiome(0, 0, 0, null);
var insideOriginChunk = biomeSource.getNoiseBiome(3, 0, 3, null); var insideOriginChunk = biomeSource.getNoiseBiome(3, 0, 3, null);
var eastChunk = biomeSource.getNoiseBiome(4, 0, 0, null); var eastChunk = biomeSource.getNoiseBiome(4, 0, 0, null);
@@ -444,11 +412,13 @@ public final class LinkingGameTests {
} }
if (profile.equals(AgeGenerationProfiles.CAVE)) { if (profile.equals(AgeGenerationProfiles.CAVE)) {
var biomeSource = level.getChunkSource().getGenerator().getBiomeSource(); var biomeSource = level.getChunkSource().getGenerator().getBiomeSource();
int caveBiomeCount = AgeBiomeSelection.eligible(helper.getLevel().registryAccess(),
AgeRuntimeProfiles.resolve(profile)).size();
helper.assertTrue(biomeSource instanceof net.dnorberg.rivencraft.world.ScaledBiomeSource, helper.assertTrue(biomeSource instanceof net.dnorberg.rivencraft.world.ScaledBiomeSource,
"Tiny Biome Distribution must use the serializable scaled biome source"); "Tiny Biome Distribution must use the serializable scaled biome source");
helper.assertTrue(biomeSource.possibleBiomes().size() >= 2 helper.assertTrue(biomeSource.possibleBiomes().size() >= 2
&& biomeSource.possibleBiomes().size() <= 3, && biomeSource.possibleBiomes().size() <= caveBiomeCount,
"Random cave Tiny distribution must use two to three eligible biomes"); "Random cave Tiny distribution must use only eligible cave biomes");
java.util.Set<net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome>> sampled = java.util.Set<net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome>> sampled =
new java.util.HashSet<>(); new java.util.HashSet<>();
for (int x = -32; x <= 32; x += 4) { for (int x = -32; x <= 32; x += 4) {
@@ -520,11 +490,13 @@ public final class LinkingGameTests {
continue; continue;
} }
var biomeSource = level.getChunkSource().getGenerator().getBiomeSource(); var biomeSource = level.getChunkSource().getGenerator().getBiomeSource();
int availableBiomes = AgeBiomeSelection.eligible(helper.getLevel().registryAccess(),
AgeRuntimeProfiles.resolve(AgeGenerationProfiles.STANDARD)).size();
helper.assertTrue(biomeSource instanceof net.dnorberg.rivencraft.world.ScaledBiomeSource, helper.assertTrue(biomeSource instanceof net.dnorberg.rivencraft.world.ScaledBiomeSource,
distribution + " Biome Distribution must use the serializable scaled biome source"); distribution + " Biome Distribution must use the serializable scaled biome source");
helper.assertTrue(biomeSource.possibleBiomes().size() >= 2 helper.assertTrue(biomeSource.possibleBiomes().size() >= 2
&& biomeSource.possibleBiomes().size() <= 6, && biomeSource.possibleBiomes().size() <= availableBiomes,
distribution + " random distribution must use two to six seeded biomes"); distribution + " random distribution must stay within the available biome pool");
helper.assertValueEqual( helper.assertValueEqual(
((net.dnorberg.rivencraft.world.ScaledBiomeSource)biomeSource).scale(), ((net.dnorberg.rivencraft.world.ScaledBiomeSource)biomeSource).scale(),
scale, scale,
@@ -111,7 +111,7 @@ public final class WritingDataGameTests {
for (String terrain : List.of("standard", "amplified", "cave", "island", "flat", "void")) { for (String terrain : List.of("standard", "amplified", "cave", "island", "flat", "void")) {
String path = "terrain/" + terrain; String path = "terrain/" + terrain;
helper.assertTrue(PageItem.bundledCreativeSymbols().contains(path), helper.assertTrue(PageItem.bundledCreativeSymbols().contains(path),
"The Pages creative tab must include " + path); "The matching symbol-page creative tab must include " + path);
ItemStack page = PageItem.createBundledCreativePage(path); ItemStack page = PageItem.createBundledCreativePage(path);
helper.assertValueEqual(PageItem.content(page).symbol().orElseThrow().id(), helper.assertValueEqual(PageItem.content(page).symbol().orElseThrow().id(),
ResourceLocation.fromNamespaceAndPath("rivencraft", path), ResourceLocation.fromNamespaceAndPath("rivencraft", path),
@@ -8,6 +8,7 @@ import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedHashSet;
import java.util.Set; import java.util.Set;
import net.dnorberg.rivencraft.Rivencraft; import net.dnorberg.rivencraft.Rivencraft;
import net.dnorberg.rivencraft.registry.ModDataComponents; import net.dnorberg.rivencraft.registry.ModDataComponents;
@@ -18,18 +19,24 @@ import net.dnorberg.rivencraft.writing.SymbolDefinition;
import net.dnorberg.rivencraft.writing.BiomeSymbolPages; import net.dnorberg.rivencraft.writing.BiomeSymbolPages;
import net.dnorberg.rivencraft.writing.SymbolDisplayMetadata; import net.dnorberg.rivencraft.writing.SymbolDisplayMetadata;
import net.dnorberg.rivencraft.writing.SymbolReference; import net.dnorberg.rivencraft.writing.SymbolReference;
import net.dnorberg.rivencraft.writing.SymbolSemantics;
import net.minecraft.ChatFormatting; import net.minecraft.ChatFormatting;
import net.minecraft.core.component.DataComponents; import net.minecraft.core.component.DataComponents;
import net.minecraft.core.HolderLookup; import net.minecraft.core.HolderLookup;
import net.minecraft.core.registries.Registries; import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.item.TooltipFlag;
/** One stackable Page item whose server-owned component identifies its writing state. */ /** One stackable Page item whose server-owned component identifies its writing state. */
public final class PageItem extends Item { public final class PageItem extends Item {
private static final Map<String, SymbolDisplayMetadata> CREATIVE_SYMBOLS = loadCreativeSymbols(); private static final ResourceLocation BIOME_GENERATION_CATEGORY =
ResourceLocation.fromNamespaceAndPath(Rivencraft.MOD_ID, "biome_generation");
private static final Map<String, CreativeSymbol> CREATIVE_SYMBOLS = loadCreativeSymbols();
private record CreativeSymbol(SymbolDisplayMetadata display, ResourceLocation creativeCategory) {}
public PageItem(Properties properties) { public PageItem(Properties properties) {
super(properties); super(properties);
@@ -46,6 +53,21 @@ public final class PageItem extends Item {
return List.copyOf(CREATIVE_SYMBOLS.keySet()); return List.copyOf(CREATIVE_SYMBOLS.keySet());
} }
/** Bundled categories become separate creative tabs without a Java page list. */
public static List<ResourceLocation> bundledCreativeCategories() {
return List.copyOf(CREATIVE_SYMBOLS.values().stream()
.map(CreativeSymbol::creativeCategory)
.collect(java.util.stream.Collectors.toCollection(LinkedHashSet::new)));
}
public static ItemStack bundledCreativeCategoryIcon(ResourceLocation category) {
return CREATIVE_SYMBOLS.entrySet().stream()
.filter(entry -> entry.getValue().creativeCategory().equals(category))
.findFirst()
.map(entry -> createBundledCreativePage(entry.getKey()))
.orElseThrow(() -> new IllegalArgumentException("No bundled pages for category " + category));
}
/** Exact symbol-page variants offered in the creative tab and to optional ingredient viewers. */ /** Exact symbol-page variants offered in the creative tab and to optional ingredient viewers. */
public static List<ItemStack> creativeSymbolPages(HolderLookup.Provider registries) { public static List<ItemStack> creativeSymbolPages(HolderLookup.Provider registries) {
List<ItemStack> pages = new ArrayList<>(); List<ItemStack> pages = new ArrayList<>();
@@ -60,12 +82,30 @@ public final class PageItem extends Item {
return List.copyOf(pages); return List.copyOf(pages);
} }
public static List<ItemStack> creativeSymbolPages(HolderLookup.Provider registries,
ResourceLocation category) {
return creativeSymbolPages(registries).stream()
.filter(page -> category.equals(creativeCategory(page)))
.toList();
}
public static ResourceLocation creativeCategory(ItemStack page) {
SymbolDisplayMetadata metadata = page.get(ModDataComponents.PAGE_SYMBOL_DISPLAY.get());
if (metadata == null) throw new IllegalArgumentException("Page has no symbol display metadata");
if (metadata.id().getNamespace().equals(Rivencraft.MOD_ID)) {
CreativeSymbol bundled = CREATIVE_SYMBOLS.get(metadata.id().getPath());
if (bundled != null) return bundled.creativeCategory();
}
return metadata.category();
}
/** Bundled symbols for the creative tab; the server still validates catalog membership on use. */ /** Bundled symbols for the creative tab; the server still validates catalog membership on use. */
public static ItemStack createBundledCreativePage(String path) { public static ItemStack createBundledCreativePage(String path) {
SymbolDisplayMetadata metadata = CREATIVE_SYMBOLS.get(path); CreativeSymbol symbol = CREATIVE_SYMBOLS.get(path);
if (metadata == null) { if (symbol == null) {
throw new IllegalArgumentException("Not a bundled symbol: " + path); throw new IllegalArgumentException("Not a bundled symbol: " + path);
} }
SymbolDisplayMetadata metadata = symbol.display();
SymbolReference reference = new SymbolReference(metadata.id()); SymbolReference reference = new SymbolReference(metadata.id());
ItemStack page = create(PageContent.symbol(reference)); ItemStack page = create(PageContent.symbol(reference));
page.set(ModDataComponents.PAGE_SYMBOL_DISPLAY.get(), metadata); page.set(ModDataComponents.PAGE_SYMBOL_DISPLAY.get(), metadata);
@@ -79,7 +119,7 @@ public final class PageItem extends Item {
return page; return page;
} }
private static Map<String, SymbolDisplayMetadata> loadCreativeSymbols() { private static Map<String, CreativeSymbol> loadCreativeSymbols() {
String resource = "/assets/rivencraft/creative_symbol_pages.json"; String resource = "/assets/rivencraft/creative_symbol_pages.json";
try (var stream = PageItem.class.getResourceAsStream(resource)) { try (var stream = PageItem.class.getResourceAsStream(resource)) {
if (stream == null) { if (stream == null) {
@@ -87,13 +127,18 @@ public final class PageItem extends Item {
} }
var json = JsonParser.parseReader(new InputStreamReader(stream, StandardCharsets.UTF_8)) var json = JsonParser.parseReader(new InputStreamReader(stream, StandardCharsets.UTF_8))
.getAsJsonObject(); .getAsJsonObject();
Map<String, SymbolDisplayMetadata> symbols = new LinkedHashMap<>(); Map<String, CreativeSymbol> symbols = new LinkedHashMap<>();
json.entrySet().forEach(entry -> { json.entrySet().forEach(entry -> {
var id = net.minecraft.resources.ResourceLocation.parse(entry.getKey()); var id = net.minecraft.resources.ResourceLocation.parse(entry.getKey());
if (!id.getNamespace().equals(Rivencraft.MOD_ID)) { if (!id.getNamespace().equals(Rivencraft.MOD_ID)) {
throw new IllegalStateException("Creative symbol is not a Rivencraft page: " + id); throw new IllegalStateException("Creative symbol is not a Rivencraft page: " + id);
} }
symbols.put(id.getPath(), SymbolDefinition.parse(entry.getValue()).display(id)); SymbolDefinition definition = SymbolDefinition.parse(entry.getValue());
ResourceLocation creativeCategory = definition.semantics()
.filter(semantics -> semantics.role() == SymbolSemantics.Role.BIOME_CONTROLLER)
.map(ignored -> BIOME_GENERATION_CATEGORY)
.orElse(definition.category());
symbols.put(id.getPath(), new CreativeSymbol(definition.display(id), creativeCategory));
}); });
return Collections.unmodifiableMap(symbols); return Collections.unmodifiableMap(symbols);
} catch (java.io.IOException exception) { } catch (java.io.IOException exception) {
@@ -7,6 +7,7 @@ import net.dnorberg.rivencraft.book.AgeRegistrySavedData;
import net.dnorberg.rivencraft.book.AgeDimensionService; import net.dnorberg.rivencraft.book.AgeDimensionService;
import net.dnorberg.rivencraft.book.AgeGenerationPlan; import net.dnorberg.rivencraft.book.AgeGenerationPlan;
import net.dnorberg.rivencraft.book.AgeGenerationProfiles; import net.dnorberg.rivencraft.book.AgeGenerationProfiles;
import net.dnorberg.rivencraft.book.AgeEnvironmentCompiler;
import net.dnorberg.rivencraft.block.entity.BookStandBlockEntity; import net.dnorberg.rivencraft.block.entity.BookStandBlockEntity;
import net.dnorberg.rivencraft.client.ClientLinkPreviewHandler; import net.dnorberg.rivencraft.client.ClientLinkPreviewHandler;
import net.dnorberg.rivencraft.client.ClientBookInteractionHandler; import net.dnorberg.rivencraft.client.ClientBookInteractionHandler;
@@ -313,15 +314,10 @@ public final class ModNetworking {
} }
} }
/** Vanilla Nether and End renderers do not use their biomes' blue Overworld sky tint. */ /** Sky effects, not dimension IDs, decide the backdrop for custom Ages. */
private static int previewSkyColor(ServerLevel level, BlockPos origin) { private static int previewSkyColor(ServerLevel level, BlockPos origin) {
if (level.dimension().equals(Level.NETHER)) { return AgeEnvironmentCompiler.previewSkyColor(level.dimensionType().effectsLocation(),
return 0xFF6B2725; level.getBiome(origin).value().getSkyColor());
}
if (level.dimension().equals(Level.END)) {
return 0xFF211835;
}
return level.getBiome(origin).value().getSkyColor();
} }
private static InteractionHand hand(boolean offhand) { private static InteractionHand hand(boolean offhand) {
@@ -1,9 +1,15 @@
package net.dnorberg.rivencraft.registry; package net.dnorberg.rivencraft.registry;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import net.dnorberg.rivencraft.Rivencraft; import net.dnorberg.rivencraft.Rivencraft;
import net.dnorberg.rivencraft.item.PageItem; import net.dnorberg.rivencraft.item.PageItem;
import net.minecraft.core.registries.Registries; import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.CreativeModeTab;
import net.neoforged.bus.api.IEventBus; import net.neoforged.bus.api.IEventBus;
import net.neoforged.neoforge.registries.DeferredHolder; import net.neoforged.neoforge.registries.DeferredHolder;
@@ -28,17 +34,39 @@ public final class ModCreativeTabs {
}) })
.build()); .build());
public static final DeferredHolder<CreativeModeTab, CreativeModeTab> PAGES = public static final DeferredHolder<CreativeModeTab, CreativeModeTab> LINK_PAGES =
CREATIVE_TABS.register("rivencraft_pages", () -> CreativeModeTab.builder() CREATIVE_TABS.register("rivencraft_link_pages", () -> CreativeModeTab.builder()
.title(Component.translatable("itemGroup.rivencraft.pages")) .title(Component.translatable("itemGroup.rivencraft.pages.link"))
.icon(PageItem::createLinkPanelPage) .icon(PageItem::createLinkPanelPage)
.displayItems((parameters, output) -> { .displayItems((parameters, output) -> output.accept(PageItem.createLinkPanelPage()))
output.accept(ModItems.PAGE.get());
output.accept(PageItem.createLinkPanelPage());
PageItem.creativeSymbolPages(parameters.holders()).forEach(output::accept);
})
.build()); .build());
private static final List<String> CATEGORY_ORDER = List.of(
"terrain", "biome", "biome_generation", "weather", "lighting", "sky", "celestial", "feature");
public static final Map<ResourceLocation, DeferredHolder<CreativeModeTab, CreativeModeTab>> SYMBOL_PAGES =
registerSymbolPageTabs();
private static Map<ResourceLocation, DeferredHolder<CreativeModeTab, CreativeModeTab>> registerSymbolPageTabs() {
List<ResourceLocation> categories = new ArrayList<>(PageItem.bundledCreativeCategories());
categories.sort(Comparator.comparingInt((ResourceLocation id) -> {
int index = CATEGORY_ORDER.indexOf(id.getPath());
return index < 0 ? CATEGORY_ORDER.size() : index;
}).thenComparing(ResourceLocation::toString));
Map<ResourceLocation, DeferredHolder<CreativeModeTab, CreativeModeTab>> tabs = new LinkedHashMap<>();
for (ResourceLocation category : categories) {
String key = "rivencraft_pages_" + category.getNamespace() + "_" + category.getPath().replace('/', '_');
tabs.put(category, CREATIVE_TABS.register(key, () -> CreativeModeTab.builder()
.title(Component.translatableWithFallback("itemGroup.rivencraft.pages." + category.getPath(),
"Rivencraft " + category.getPath() + " Pages"))
.icon(() -> PageItem.bundledCreativeCategoryIcon(category))
.displayItems((parameters, output) -> PageItem.creativeSymbolPages(parameters.holders(), category)
.forEach(output::accept))
.build()));
}
return Map.copyOf(tabs);
}
private ModCreativeTabs() { private ModCreativeTabs() {
} }
@@ -77,6 +77,7 @@ public record SymbolSemantics(Role role, Value value) {
"native", "single", "tiled", "grid", "tiny", "small", "medium", "large", "huge"), "native", "single", "tiled", "grid", "tiny", "small", "medium", "large", "huge"),
BIOME("biome", Kind.RESOURCE), BIOME("biome", Kind.RESOURCE),
LIGHTING("lighting", Kind.CHOICE, "normal", "dark", "bright"), LIGHTING("lighting", Kind.CHOICE, "normal", "dark", "bright"),
SKY("sky", Kind.CHOICE, "overworld", "nether", "end"),
WEATHER("weather", Kind.CHOICE, WEATHER("weather", Kind.CHOICE,
"normal", "fast", "slow", "off", "always", "cloudy", "rain", "snow", "storm"), "normal", "fast", "slow", "off", "always", "cloudy", "rain", "snow", "storm"),
CELESTIAL("celestial", Kind.CHOICE, "normal_time"), CELESTIAL("celestial", Kind.CHOICE, "normal_time"),
@@ -69,6 +69,12 @@ public final class WritingGrammar {
Role role = semantics.orElseThrow().role(); Role role = semantics.orElseThrow().role();
ParsedSymbol parsed = new ParsedSymbol(index, reference, semantics.orElseThrow()); ParsedSymbol parsed = new ParsedSymbol(index, reference, semantics.orElseThrow());
symbols.add(parsed); symbols.add(parsed);
if (role == Role.ANGLE_MODIFIER || role == Role.WEATHER
&& parsed.semantics().value() instanceof ChoiceValue choice
&& Set.of("snow", "cloudy", "rain").contains(choice.id())) {
diagnostics.add(new Diagnostic(Code.UNSUPPORTED_ENVIRONMENT, index,
"This environment effect needs renderer or precipitation support"));
}
if (singular(role)) { if (singular(role)) {
ParsedSymbol previous = singular.putIfAbsent(role, parsed); ParsedSymbol previous = singular.putIfAbsent(role, parsed);
if (previous != null) { if (previous != null) {
@@ -127,7 +133,7 @@ public final class WritingGrammar {
private static boolean singular(Role role) { private static boolean singular(Role role) {
return switch (role) { return switch (role) {
case TERRAIN, BIOME_CONTROLLER, WEATHER, LIGHTING, CELESTIAL -> true; case TERRAIN, BIOME_CONTROLLER, WEATHER, LIGHTING, SKY, CELESTIAL -> true;
default -> false; default -> false;
}; };
} }
@@ -143,16 +149,17 @@ public final class WritingGrammar {
case BIOME_CONTROLLER -> 2; case BIOME_CONTROLLER -> 2;
case WEATHER -> 3; case WEATHER -> 3;
case LIGHTING -> 4; case LIGHTING -> 4;
case PERIOD_MODIFIER, ANGLE_MODIFIER, PHASE_MODIFIER -> 5; case SKY -> 5;
case CELESTIAL -> 6; case PERIOD_MODIFIER, ANGLE_MODIFIER, PHASE_MODIFIER -> 6;
case FEATURE -> 7; case CELESTIAL -> 7;
case FEATURE -> 8;
}; };
} }
public enum Code { public enum Code {
TOO_MANY, MISSING_PANEL, PANEL_ORDER, DUPLICATE_PANEL, UNRESOLVED, UNSUPPORTED, TOO_MANY, MISSING_PANEL, PANEL_ORDER, DUPLICATE_PANEL, UNRESOLVED, UNSUPPORTED,
DUPLICATE, CONFLICT, OUT_OF_ORDER, MISPLACED_MODIFIER, INCOMPLETE, UNSUPPORTED_PROFILE, DUPLICATE, CONFLICT, OUT_OF_ORDER, MISPLACED_MODIFIER, INCOMPLETE, UNSUPPORTED_PROFILE,
UNKNOWN_BIOME, UNSUPPORTED_BIOME UNKNOWN_BIOME, UNSUPPORTED_BIOME, UNSUPPORTED_ENVIRONMENT
} }
public record Diagnostic(Code code, int index, String message) { public record Diagnostic(Code code, int index, String message) {
@@ -41,6 +41,7 @@
"screen.rivencraft.book_binder.grammar.unresolved": "Page %s: missing symbol definition; restore its data pack or remove it", "screen.rivencraft.book_binder.grammar.unresolved": "Page %s: missing symbol definition; restore its data pack or remove it",
"screen.rivencraft.book_binder.grammar.unsupported": "Page %s: this symbol needs semantic schema v2; update its data pack or remove it", "screen.rivencraft.book_binder.grammar.unsupported": "Page %s: this symbol needs semantic schema v2; update its data pack or remove it",
"screen.rivencraft.book_binder.grammar.unsupported_profile": "Page %s: its Age profile is unavailable; restore the data pack or remove this page", "screen.rivencraft.book_binder.grammar.unsupported_profile": "Page %s: its Age profile is unavailable; restore the data pack or remove this page",
"screen.rivencraft.book_binder.grammar.unsupported_environment": "Page %s: this weather or sky effect is not supported yet",
"screen.rivencraft.book_binder.grammar.duplicate": "Page %s: remove the duplicate symbol", "screen.rivencraft.book_binder.grammar.duplicate": "Page %s: remove the duplicate symbol",
"screen.rivencraft.book_binder.grammar.conflict": "Page %s: replace the conflicting symbol", "screen.rivencraft.book_binder.grammar.conflict": "Page %s: replace the conflicting symbol",
"screen.rivencraft.book_binder.grammar.out_of_order": "Page %s: move this symbol before later categories", "screen.rivencraft.book_binder.grammar.out_of_order": "Page %s: move this symbol before later categories",
@@ -87,7 +88,6 @@
"screen.rivencraft.age.pages": "Pages", "screen.rivencraft.age.pages": "Pages",
"screen.rivencraft.age.details": "Details", "screen.rivencraft.age.details": "Details",
"screen.rivencraft.age.pages_count": "Writing %s/%s", "screen.rivencraft.age.pages_count": "Writing %s/%s",
"screen.rivencraft.age.pages_not_applied": "Symbols not applied yet",
"screen.rivencraft.age.trait.biomes": "Biomes: %s", "screen.rivencraft.age.trait.biomes": "Biomes: %s",
"screen.rivencraft.age.trait.lighting": "Lighting: %s", "screen.rivencraft.age.trait.lighting": "Lighting: %s",
"screen.rivencraft.age.trait.weather": "Weather: %s", "screen.rivencraft.age.trait.weather": "Weather: %s",
@@ -167,10 +167,46 @@
"symbol.rivencraft.biome.huge.description": "Distribute selected biomes in huge regions.", "symbol.rivencraft.biome.huge.description": "Distribute selected biomes in huge regions.",
"symbol.rivencraft.lighting.normal": "Normal Lighting", "symbol.rivencraft.lighting.normal": "Normal Lighting",
"symbol.rivencraft.lighting.normal.description": "Use normal skylight and ambient brightness.", "symbol.rivencraft.lighting.normal.description": "Use normal skylight and ambient brightness.",
"symbol.rivencraft.lighting.dark": "Dark Lighting",
"symbol.rivencraft.lighting.dark.description": "Remove skylight from this Age.",
"symbol.rivencraft.lighting.bright": "Bright Lighting",
"symbol.rivencraft.lighting.bright.description": "Increase this Age's ambient brightness.",
"symbol.rivencraft.sky.overworld": "Overworld Sky",
"symbol.rivencraft.sky.overworld.description": "Use the Overworld sky and biome sky tint.",
"symbol.rivencraft.sky.nether": "Nether Sky",
"symbol.rivencraft.sky.nether.description": "Use the Nether sky and red preview background.",
"symbol.rivencraft.sky.end": "End Sky",
"symbol.rivencraft.sky.end.description": "Use the End sky and dark preview background.",
"symbol.rivencraft.weather.normal": "Normal Weather", "symbol.rivencraft.weather.normal": "Normal Weather",
"symbol.rivencraft.weather.normal.description": "Use the normal weather cycle.", "symbol.rivencraft.weather.normal.description": "Use the normal weather cycle.",
"symbol.rivencraft.weather.fast": "Fast Weather",
"symbol.rivencraft.weather.fast.description": "Change weather more quickly.",
"symbol.rivencraft.weather.slow": "Slow Weather",
"symbol.rivencraft.weather.slow.description": "Change weather more slowly.",
"symbol.rivencraft.weather.off": "No Weather",
"symbol.rivencraft.weather.off.description": "Keep the Age clear.",
"symbol.rivencraft.weather.always": "Always Weather",
"symbol.rivencraft.weather.always.description": "Keep the Age rainy.",
"symbol.rivencraft.weather.storm": "Storm Weather",
"symbol.rivencraft.weather.storm.description": "Keep the Age rainy and thundering.",
"symbol.rivencraft.celestial.normal_time": "Normal Time", "symbol.rivencraft.celestial.normal_time": "Normal Time",
"symbol.rivencraft.celestial.normal_time.description": "Use a normal-length celestial cycle.", "symbol.rivencraft.celestial.normal_time.description": "Use a normal-length celestial cycle.",
"symbol.rivencraft.period.zero": "Zero Length",
"symbol.rivencraft.period.zero.description": "Stop the celestial cycle at its written phase.",
"symbol.rivencraft.period.half": "Half Length",
"symbol.rivencraft.period.half.description": "Use a half-length celestial cycle.",
"symbol.rivencraft.period.full": "Full Length",
"symbol.rivencraft.period.full.description": "Use a normal-length celestial cycle.",
"symbol.rivencraft.period.double": "Double Length",
"symbol.rivencraft.period.double.description": "Use a double-length celestial cycle.",
"symbol.rivencraft.phase.nadir": "Nadir Phase",
"symbol.rivencraft.phase.nadir.description": "Set the celestial phase to nadir.",
"symbol.rivencraft.phase.rising": "Rising Phase",
"symbol.rivencraft.phase.rising.description": "Set the celestial phase to rising.",
"symbol.rivencraft.phase.zenith": "Zenith Phase",
"symbol.rivencraft.phase.zenith.description": "Set the celestial phase to zenith.",
"symbol.rivencraft.phase.setting": "Setting Phase",
"symbol.rivencraft.phase.setting.description": "Set the celestial phase to setting.",
"symbol.rivencraft.feature.caves": "Caves", "symbol.rivencraft.feature.caves": "Caves",
"symbol.rivencraft.feature.caves.description": "Describe underground cave features.", "symbol.rivencraft.feature.caves.description": "Describe underground cave features.",
"generator.rivencraft.standard": "Standard", "generator.rivencraft.standard": "Standard",
@@ -194,5 +230,13 @@
"jei.rivencraft.writing.bind": "At a Book Binder, name the Age and add a cover plus Link Panel. Optional symbol Pages follow the panel.", "jei.rivencraft.writing.bind": "At a Book Binder, name the Age and add a cover plus Link Panel. Optional symbol Pages follow the panel.",
"jei.rivencraft.writing.linking_book": "Craft one Link Panel Page with leather to make an unwritten Linking Book. Open it to name and bind it.", "jei.rivencraft.writing.linking_book": "Craft one Link Panel Page with leather to make an unwritten Linking Book. Open it to name and bind it.",
"itemGroup.rivencraft": "Rivencraft", "itemGroup.rivencraft": "Rivencraft",
"itemGroup.rivencraft.pages": "Rivencraft Pages" "itemGroup.rivencraft.pages.link": "Rivencraft Link Pages",
"itemGroup.rivencraft.pages.terrain": "Rivencraft Terrain Pages",
"itemGroup.rivencraft.pages.biome": "Rivencraft Biome Pages",
"itemGroup.rivencraft.pages.biome_generation": "Rivencraft Biome Generation Pages",
"itemGroup.rivencraft.pages.weather": "Rivencraft Weather Pages",
"itemGroup.rivencraft.pages.lighting": "Rivencraft Lighting Pages",
"itemGroup.rivencraft.pages.sky": "Rivencraft Sky Pages",
"itemGroup.rivencraft.pages.celestial": "Rivencraft Celestial Pages",
"itemGroup.rivencraft.pages.feature": "Rivencraft Feature Pages"
} }
@@ -0,0 +1 @@
{"schema_version":2,"name":"symbol.rivencraft.lighting.bright","description":"symbol.rivencraft.lighting.bright.description","category":"rivencraft:lighting","semantics":{"role":"lighting","value":"bright"},"poem":"Ethereal Sustain Cycle Balance"}
@@ -0,0 +1 @@
{"schema_version":2,"name":"symbol.rivencraft.lighting.dark","description":"symbol.rivencraft.lighting.dark.description","category":"rivencraft:lighting","semantics":{"role":"lighting","value":"dark"},"poem":"Ethereal Void Cycle Balance"}
@@ -0,0 +1 @@
{"schema_version":2,"name":"symbol.rivencraft.period.double","description":"symbol.rivencraft.period.double.description","category":"rivencraft:celestial","semantics":{"role":"period_modifier","value":2.0},"poem":"Transform Time Cycle Dynamic"}
@@ -0,0 +1 @@
{"schema_version":2,"name":"symbol.rivencraft.period.full","description":"symbol.rivencraft.period.full.description","category":"rivencraft:celestial","semantics":{"role":"period_modifier","value":1.0},"poem":"Transform Time Cycle Balance"}
@@ -0,0 +1 @@
{"schema_version":2,"name":"symbol.rivencraft.period.half","description":"symbol.rivencraft.period.half.description","category":"rivencraft:celestial","semantics":{"role":"period_modifier","value":0.5},"poem":"Transform Time Cycle Constraint"}
@@ -0,0 +1 @@
{"schema_version":2,"name":"symbol.rivencraft.period.zero","description":"symbol.rivencraft.period.zero.description","category":"rivencraft:celestial","semantics":{"role":"period_modifier","value":0.0},"poem":"Transform Time Void Balance"}
@@ -0,0 +1 @@
{"schema_version":2,"name":"symbol.rivencraft.phase.nadir","description":"symbol.rivencraft.phase.nadir.description","category":"rivencraft:celestial","semantics":{"role":"phase_modifier","value":0.0},"poem":"Transform Time Void Tradition"}
@@ -0,0 +1 @@
{"schema_version":2,"name":"symbol.rivencraft.phase.rising","description":"symbol.rivencraft.phase.rising.description","category":"rivencraft:celestial","semantics":{"role":"phase_modifier","value":90.0},"poem":"Transform Time Flow Tradition"}
@@ -0,0 +1 @@
{"schema_version":2,"name":"symbol.rivencraft.phase.setting","description":"symbol.rivencraft.phase.setting.description","category":"rivencraft:celestial","semantics":{"role":"phase_modifier","value":270.0},"poem":"Transform Time Nature Tradition"}
@@ -0,0 +1 @@
{"schema_version":2,"name":"symbol.rivencraft.phase.zenith","description":"symbol.rivencraft.phase.zenith.description","category":"rivencraft:celestial","semantics":{"role":"phase_modifier","value":180.0},"poem":"Transform Time Ethereal Tradition"}
@@ -0,0 +1 @@
{"schema_version":2,"name":"symbol.rivencraft.sky.end","description":"symbol.rivencraft.sky.end.description","category":"rivencraft:sky","semantics":{"role":"sky","value":"end"},"poem":"Ethereal Void Sky Balance"}
@@ -0,0 +1 @@
{"schema_version":2,"name":"symbol.rivencraft.sky.nether","description":"symbol.rivencraft.sky.nether.description","category":"rivencraft:sky","semantics":{"role":"sky","value":"nether"},"poem":"Ethereal Void Sky Transform"}
@@ -0,0 +1 @@
{"schema_version":2,"name":"symbol.rivencraft.sky.overworld","description":"symbol.rivencraft.sky.overworld.description","category":"rivencraft:sky","semantics":{"role":"sky","value":"overworld"},"poem":"Ethereal Nature Sky Balance"}
@@ -0,0 +1 @@
{"schema_version":2,"name":"symbol.rivencraft.weather.always","description":"symbol.rivencraft.weather.always.description","category":"rivencraft:weather","semantics":{"role":"weather","value":"always"},"poem":"Sustain Flow Cycle Tradition"}
@@ -0,0 +1 @@
{"schema_version":2,"name":"symbol.rivencraft.weather.fast","description":"symbol.rivencraft.weather.fast.description","category":"rivencraft:weather","semantics":{"role":"weather","value":"fast"},"poem":"Sustain Dynamic Flow Transform"}
@@ -0,0 +1 @@
{"schema_version":2,"name":"symbol.rivencraft.weather.off","description":"symbol.rivencraft.weather.off.description","category":"rivencraft:weather","semantics":{"role":"weather","value":"off"},"poem":"Sustain Void Flow Balance"}
@@ -0,0 +1 @@
{"schema_version":2,"name":"symbol.rivencraft.weather.slow","description":"symbol.rivencraft.weather.slow.description","category":"rivencraft:weather","semantics":{"role":"weather","value":"slow"},"poem":"Sustain Dynamic Flow Balance"}
@@ -0,0 +1 @@
{"schema_version":2,"name":"symbol.rivencraft.weather.storm","description":"symbol.rivencraft.weather.storm.description","category":"rivencraft:weather","semantics":{"role":"weather","value":"storm"},"poem":"Sustain Nature Flow Dynamic"}