Public Access
Complete Milestone 7 acceptance and binder diagnostics (#84)
Build / build (push) Canceled after 0s
Build / build (push) Canceled after 0s
This commit is contained in:
1 parent
e7e2cf7e5a
commit
98595c83ea
19 files changed
+290
-31
No files matched your search
@@ -87,14 +87,18 @@ season enrollment, and instability controls. The client setting
|
||||
An operator can inspect Ages and instability with `/rivencraft age` and find
|
||||
libraries with `/rivencraft library nearest`. The creative-only Link Modifier
|
||||
can edit link properties and retire an Age; use it carefully and keep backups.
|
||||
Binder status messages are off by default. An OP can run
|
||||
`/rivencraft binder messages enable` or `/rivencraft binder messages disable`
|
||||
to control them; only OPs see the diagnostics even when enabled.
|
||||
|
||||
## Project and development
|
||||
|
||||
This repository is the development source. See the [current implementation](docs/CURRENT_IMPLEMENTATION.md),
|
||||
[milestone summaries](docs/MILESTONES.md), [technical document index](docs/README.md),
|
||||
and [issues](https://truenas-scale.tail180fb1.ts.net:8443/dnorberg/rivencraft/issues).
|
||||
Milestone 7 is in progress; its [regression matrix](docs/MILESTONE_7_REGRESSION.md)
|
||||
distinguishes automated checks from manual checks and known limitations.
|
||||
Milestone 7 is complete in 1.0.0.2. Its [acceptance record](docs/MILESTONE_7_ACCEPTANCE.md)
|
||||
and [regression matrix](docs/MILESTONE_7_REGRESSION.md) distinguish automated
|
||||
checks from manual evidence and known limitations.
|
||||
|
||||
```sh
|
||||
./gradlew build
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Current implementation (Milestone 7 development)
|
||||
|
||||
This is the maintained technical overview of Rivencraft as of the 0.6.11.0
|
||||
This is the maintained technical overview of Rivencraft as of the 1.0.0.2
|
||||
slice. It describes implemented behavior, not every behavior in Mystcraft
|
||||
Legacy. [The README](../README.md) is the player introduction;
|
||||
[milestone summaries](MILESTONES.md) explain how the implementation arrived
|
||||
@@ -41,9 +41,11 @@ and [Age administration](AGES.md).
|
||||
terrain starts from exposed surfaces. If no safe arrival site exists, the
|
||||
Age-creation path can construct a non-dropping Crystal Platform at Y=63.
|
||||
- The server catalog accepts typed data-pack symbols. The Binder preserves
|
||||
written order and diagnoses conflicts. Symbol Pages are composed at runtime
|
||||
from Legacy glyph assets; number pages 0–24 set color strength and, when
|
||||
immediately before a Length, Angle, or Phase modifier, their numeric value.
|
||||
written order and diagnoses conflicts. Its status readout is off by default;
|
||||
`/rivencraft binder messages enable` makes it visible only to OPs. Symbol
|
||||
Pages are composed at runtime from Legacy glyph assets. Number pages 0–24
|
||||
set color strength or, immediately before a Length, Angle, Phase, or Size
|
||||
modifier, its numeric value.
|
||||
Celestial pages can create multiple suns/moons with independent color, size,
|
||||
angle, period, phase, and direction; authored eclipses affect light.
|
||||
- The Writing Desk stores tabs and copies known Symbol Pages with paper and
|
||||
@@ -92,5 +94,5 @@ This is not an exact port of every Legacy generator, page, hazard, or client
|
||||
renderer. Modern safety budgets and NeoForge's dimension/biome APIs require
|
||||
adaptations. The [Milestone 7 regression matrix](MILESTONE_7_REGRESSION.md)
|
||||
separates tested behavior from unverified multiplayer/restart/optional-mod
|
||||
combinations. Issue [#84](https://truenas-scale.tail180fb1.ts.net:8443/dnorberg/rivencraft/issues/84)
|
||||
is the final Milestone 7 acceptance and release gate.
|
||||
combinations. The [Milestone 7 acceptance record](MILESTONE_7_ACCEPTANCE.md)
|
||||
records release evidence and remaining validation limits.
|
||||
+6
-5
@@ -54,12 +54,13 @@ adaptations. See [M6 acceptance](MILESTONE_6_ACCEPTANCE.md),
|
||||
[Legacy instability audit](LEGACY_INSTABILITY_AUDIT.md), and
|
||||
[runtime policy](INSTABILITY_RUNTIME.md).
|
||||
|
||||
## 7 — Structures and polish (in progress)
|
||||
## 7 — Structures and polish (complete in 1.0.0.2)
|
||||
|
||||
Added Legacy-layout Age libraries, page-bearing stands, crystal portals and
|
||||
receptacles, the handheld dropped-book entity, data-driven recipes,
|
||||
advancements, asset/audio polish, optional Ruins, compatibility updates, and
|
||||
expanded sky/glyph pages. Issue #83 covers regression, migration, and document
|
||||
consolidation; issue #84 is the final milestone acceptance gate. See the
|
||||
[M7 Legacy audit](LEGACY_M7_AUDIT.md), [M7 regression matrix](MILESTONE_7_REGRESSION.md),
|
||||
and [M7 compatibility review](MILESTONE_7_COMPATIBILITY_REVIEW.md).
|
||||
expanded sky/glyph pages. Issue #83 covered regression, migration, and document
|
||||
consolidation; issue #84 records the final milestone acceptance. See the
|
||||
[M7 acceptance](MILESTONE_7_ACCEPTANCE.md), [M7 Legacy audit](LEGACY_M7_AUDIT.md),
|
||||
[M7 regression matrix](MILESTONE_7_REGRESSION.md), and
|
||||
[M7 compatibility review](MILESTONE_7_COMPATIBILITY_REVIEW.md).
|
||||
@@ -0,0 +1,72 @@
|
||||
# Milestone 7 acceptance — 1.0.0.2
|
||||
|
||||
Milestone 7 is complete for the supported NeoForge 1.21.1 feature set. This is
|
||||
not a claim of total Mystcraft Legacy parity or exhaustive optional-mod
|
||||
certification. The [current implementation](CURRENT_IMPLEMENTATION.md) is the
|
||||
up-to-date behavior summary; the [regression matrix](MILESTONE_7_REGRESSION.md)
|
||||
separates automated evidence from manual scenarios.
|
||||
|
||||
## Scope and issue gate
|
||||
|
||||
The Gitea audit for issue #84 found no other open issues. Required existing
|
||||
#14 (cave terrain), #43 (glyph numbers), #44 (sky), and #60 (old-save policy)
|
||||
were closed. M7 implementation and review issues #75–#83, #85–#90, and
|
||||
later additions #91–#94 were closed before this acceptance. No required
|
||||
issue was silently deferred.
|
||||
|
||||
| Legacy concept | Rivencraft implementation or deliberate difference |
|
||||
| --- | --- |
|
||||
| Cave terrain and writing | Cave terrain uses its cave/Nether biome set and a modern Y=64-start spawn search. Existing non-cave terrain still supports caves as features. See [Age profiles](AGE_PROFILES.md) and [grammar](WRITING_GRAMMAR.md). |
|
||||
| Libraries | The recognizable Legacy small-library layout and sparse candidate spacing are ported as a structure template with a chest and up to five page-bearing Book Stands. It generates only in Ages and only on suitable surfaces; player-selectable Legacy or Age-only loot is supported. See [Legacy M7 audit](LEGACY_M7_AUDIT.md). |
|
||||
| Crystal portal and Receptacle | Connected Crystal Blocks support vertical and horizontal portals. The held book stays in the Receptacle; removing it removes the surface. Rivencraft validates loaded bounds and block protection, saves owner pointers, and uses book-travel rules. Optional Immersive Portals supplies a live destination view, with an animated fallback while unavailable. |
|
||||
| Handheld Linking/Descriptive Books | The used book remains behind as a rendered book entity at the origin. The exact Legacy entity pickup rule is not copied: modern contact pickup is used. Return Links default to disabled but remain configurable. |
|
||||
| Recipes and discovery | JSON crafting recipes and recipe-book unlocks cover the supported writing/crystal progression. Optional JEI covers the Binder, Writing Desk, and Ink Mixer; a Lectern conversion has no JEI guide. Blank Pages are not craftable. Optional Create/Ponder teaches portal construction. See [JEI review](MILESTONE_7_JEI_REVIEW.md). |
|
||||
| Models, sounds, and advancements | Legacy-sourced assets are credited in [asset provenance](ASSET_PROVENANCE.md); 1.21.1-compatible models and renderer adaptations are documented in the [visual audit](MILESTONE_7_VISUAL_AUDIT.md). Server-owned advancements cover book, writing, Age, and portal progress; the unimplemented Quinn equivalent is explicitly omitted in [advancement notes](MILESTONE_7_ADVANCEMENTS.md). |
|
||||
| Numbers, sky, and extra items | Base-25 number glyphs, celestial modifiers and eclipses, Symbol Portfolios, the OP-only Link Modifier, and optional Ruins pages were follow-up additions. Legacy page semantics are adapted to the modern authoring plan rather than a binary copy of 1.12.2 worldgen. |
|
||||
|
||||
## Compatibility and migration
|
||||
|
||||
NeoForge **21.1.264** is the minimum 21.1 build. A player passed the
|
||||
singleplayer client with the optional stack, then a local dedicated server
|
||||
including Immersive Portals, before the minimum was raised. See the
|
||||
[compatibility decision](MILESTONE_7_COMPATIBILITY_REVIEW.md). JEI
|
||||
19.69.0.457 and Serene Seasons 10.1.0.9 received their own player checks;
|
||||
Create/Ponder, Immersive Portals, TerraBlender/biome add-ons, Serene Seasons,
|
||||
JEI, and Ruins remain optional. Ecliptic Seasons is deliberately not
|
||||
integrated: its 1.21.1 public API does not support the required live Age
|
||||
registration and per-Age calendar control. Missing optional mods must not
|
||||
prevent the core mod from loading.
|
||||
|
||||
Known older writing/book, Age-plan, and workstation formats have explicit
|
||||
migration or stable-default handling. An Age registry and its dimension
|
||||
folders must be backed up together. Removed mods, missing custom registry
|
||||
objects, and arbitrary prerelease saves are **not** guaranteed to load.
|
||||
Retiring an Age through the creative Link Modifier archives its data and
|
||||
invalidates its UUID; that intentional destructive operation is not a
|
||||
migration. See the [old-save boundary](MILESTONE_7_REGRESSION.md#old-save-boundary-60).
|
||||
|
||||
## Release validation and limits
|
||||
|
||||
The 0.6.11.0 regression candidate passed `./gradlew --offline build` and
|
||||
fresh-world GameTest runs: core **91/91**, generation **129/129**, and
|
||||
environment **103/103**. The player reported an in-game pass for that
|
||||
candidate. The 1.0.0.1 release candidate additionally allows Number Pages to
|
||||
set Celestial Size. The 1.0.0.2 release makes Binder status diagnostics an
|
||||
OP-only, default-off world setting. Its offline build and core GameTests
|
||||
passed (93/93), and the player reported an in-game pass. The
|
||||
preceding 1.0.0.0 candidate passed core and generation GameTests. Its
|
||||
environment archive stalled in the first 50-test batch, repeatedly printing
|
||||
its field without completing; it was stopped and is **not** counted as a
|
||||
1.0.0.0–1.0.0.2 pass. The previous 0.6.11.0 run of that same suite passed 103/103.
|
||||
The focused sky, season, and number-page in-game checks in the regression
|
||||
matrix remain useful regression checks, not claimed full-matrix passes. The
|
||||
Gitea release changelog records the tested JAR and verified SHA-256.
|
||||
|
||||
These results do not prove every two-player race, full restart, migration
|
||||
from every development world, or optional-mod combination. The specific
|
||||
manual matrix remains in [M7 regression](MILESTONE_7_REGRESSION.md); those
|
||||
broader combinations are known validation limits, not claimed passes. Modern
|
||||
chunk and tick budgets, safer portal validation, 1.21.1 world-height and
|
||||
biome APIs, and the dynamic-dimension backend are deliberate deviations from
|
||||
Legacy. A complete Legacy worldgen or link-property port is outside this
|
||||
milestone.
|
||||
@@ -1,7 +1,7 @@
|
||||
# Milestone 7 regression and migration matrix (issue #83)
|
||||
|
||||
This is a **working** acceptance record for the 0.6.11.0 candidate, not the
|
||||
Milestone 7 completion sign-off. Issue #84 owns the final gate. A passing
|
||||
This is the dated regression record for the 0.6.11.0 candidate. The
|
||||
[Milestone 7 acceptance](MILESTONE_7_ACCEPTANCE.md) owns the final sign-off. A passing
|
||||
GameTest is server-side evidence; it is not proof of client rendering,
|
||||
multiplayer timing, or every optional-mod combination.
|
||||
|
||||
@@ -11,7 +11,7 @@ multiplayer timing, or every optional-mod combination.
|
||||
| --- | --- | --- |
|
||||
| Dedicated server, core linking, book/Age identity, old writing and workstation formats | `./gradlew --offline runGameTestServer`; includes `CoreGameTests`, `AgePersistenceGameTests`, `CrystalPortalGameTests`, M7 crafting/advancement checks | 91/91 required GameTests passed on NeoForge 21.1.264; clean shutdown and fresh-world removal. |
|
||||
| Deterministic structures and terrain | `./gradlew --offline runGameTestServer -ParchivedGameTestSuites=generation`; includes library template/spacing/loot/stand checks, cave profiles, vanilla structures, crystal formations, fissures | 129/129 passed after correcting one village test to assert its own contribution rather than a seed-dependent total; fresh-world removal. |
|
||||
| Sky, glyph numbers, seasons, creative/JEI page feed | `./gradlew --offline runGameTestServer -ParchivedGameTestSuites=environment` | 103/103 passed on the current candidate, including issue #94's number-page check; fresh-world removal. |
|
||||
| Sky, glyph numbers, seasons, creative/JEI page feed | `./gradlew --offline runGameTestServer -ParchivedGameTestSuites=environment` | 103/103 passed on the 0.6.11.0 candidate, including issue #94's number-page check; fresh-world removal. |
|
||||
| Packaged models and data | `Milestone7ResourceGameTests.coreModelsResolveBundledTextures` in the core suite; parses critical block models, checks their Rivencraft texture references and the library NBT resource | Passed in the 91-test core run. This checks resource presence, not visual orientation or transparency. |
|
||||
| Recipe behavior | `Milestone7CraftingGameTests` and `LinkingBookRecipeGameTests` through the loaded Recipe Manager | Passed in the core run; confirms crystal and receptacle quantities, ink bucket return, no Blank Page crafting, and Linking Book ingredients. |
|
||||
| Portal state/save-load | `CrystalPortalGameTests` plus `AgePersistenceGameTests` in the core suite | Passed; covers activation/release, fallback orientation, horizontal/underside placement, uninterrupted surface, cooldown, retired Age and seed/plan identity. Full server restart remains manual. |
|
||||
@@ -29,7 +29,14 @@ and deletes it after pass or fail. See [GameTest guidance](GAMETESTS.md).
|
||||
Do not retry a storage-stalled GameTest: stop it, remove that automated
|
||||
scenario, and give its exact steps to the player. No run in this issue has
|
||||
stalled so far. The older full-archive storage stall is historical and is not
|
||||
counted as a current pass.
|
||||
counted as a current pass. On the subsequent **1.0.0.0 release candidate**,
|
||||
the environment archive stalled during its first 50-test batch and was
|
||||
stopped. The 103/103 result above applies to 0.6.11.0 only, not to 1.0.0.0
|
||||
or the later 1.0.0.1–1.0.0.2 candidates. For the 1.0.0.2 manual handoff, create an Age
|
||||
with Number Pages immediately before Celestial Angle, Phase, and Size pages;
|
||||
confirm each affects the intended body rather than becoming a stray page. Also verify a
|
||||
fixed-season Age remains fixed across a restart while the Overworld remains
|
||||
independent. Do not rerun the stalled suite merely to obtain a green count.
|
||||
|
||||
## Old-save boundary (#60)
|
||||
|
||||
@@ -60,6 +67,7 @@ this candidate.
|
||||
| Optional renderers | With neither Create nor Immersive Portals, confirm Legacy fallback. With Create alone, confirm Ponder snapshots and portal guide. With Immersive Portals, confirm live view, Explore exit, sky/sound isolation, portal travel, and fallback while chunks load. With both, `AUTO` should choose Immersive Portals. |
|
||||
| Optional world/recipe mods | Test JEI guides/search, TerraBlender with a biome-producing addon (for example Biomes O' Plenty), Serene's six season modes plus Overworld independence/restart, and Ruins template selection/spawn weighting. Repeat startup without optional mods. |
|
||||
| Migration | Copy a backed-up older development world. Verify books and Notebooks retain their Age/page IDs, a desk and stand keep contents, old Ages load or provide a clear error, and removing a custom symbol retains its unresolved ID. Do not test by modifying the only copy. |
|
||||
| Binder diagnostics | As a non-OP, verify the Binder still creates books but shows no instability/seeded/status messages. As an OP, run `/rivencraft binder messages enable`, reopen the Binder, and verify those messages appear only for the OP. Disable them and restart the world; the setting should remain disabled. |
|
||||
|
||||
Historical evidence: the player approved NeoForge 21.1.264 on singleplayer
|
||||
and a dedicated server with Immersive Portals; JEI 19.69.0.457 guides, Serene
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ former behavior or loader version.
|
||||
| M4 | [Writing data](WRITING_DATA.md), [book presentation](DESCRIPTIVE_BOOK_PRESENTATION.md), [Ink Mixer audit](INK_MIXER_MODIFIER_AUDIT.md) |
|
||||
| M5 | [Acceptance](MILESTONE_5_ACCEPTANCE.md), [Legacy grammar audit](LEGACY_AGE_GRAMMAR_AUDIT.md), [writing grammar](WRITING_GRAMMAR.md), [symbol semantics](SYMBOL_SEMANTICS.md), [TerraBlender](TERRABLENDER_COMPATIBILITY.md), [Serene Seasons](SERENE_SEASONS_COMPATIBILITY.md) |
|
||||
| M6 | [Acceptance](MILESTONE_6_ACCEPTANCE.md), [regression](MILESTONE_6_REGRESSION.md), [Legacy audit](LEGACY_INSTABILITY_AUDIT.md), [score](INSTABILITY_SCORE.md), [live blocks](LIVE_BLOCK_INSTABILITY.md), [runtime](INSTABILITY_RUNTIME.md), [diagnostics](INSTABILITY_DIAGNOSTICS.md), [status effects](INSTABILITY_STATUS_EFFECTS.md), [decay](INSTABILITY_DECAY.md), [environmental hazards](INSTABILITY_ENVIRONMENTAL.md), [cloud platform](AGE_CLOUD_PLATFORM.md) |
|
||||
| M7 | [Regression and manual matrix](MILESTONE_7_REGRESSION.md), [Legacy audit](LEGACY_M7_AUDIT.md), [visual/audio](MILESTONE_7_VISUAL_AUDIT.md), [advancements](MILESTONE_7_ADVANCEMENTS.md), [JEI](MILESTONE_7_JEI_REVIEW.md), [Serene review](MILESTONE_7_SERENE_REVIEW.md), [compatibility](MILESTONE_7_COMPATIBILITY_REVIEW.md), [Ruins](RUINS_COMPATIBILITY.md) |
|
||||
| M7 | [Acceptance](MILESTONE_7_ACCEPTANCE.md), [regression and manual matrix](MILESTONE_7_REGRESSION.md), [Legacy audit](LEGACY_M7_AUDIT.md), [visual/audio](MILESTONE_7_VISUAL_AUDIT.md), [advancements](MILESTONE_7_ADVANCEMENTS.md), [JEI](MILESTONE_7_JEI_REVIEW.md), [Serene review](MILESTONE_7_SERENE_REVIEW.md), [compatibility](MILESTONE_7_COMPATIBILITY_REVIEW.md), [Ruins](RUINS_COMPATIBILITY.md) |
|
||||
|
||||
[Asset provenance](ASSET_PROVENANCE.md) applies across milestones. Detailed
|
||||
audits are intentionally retained for source attribution and migration
|
||||
|
||||
@@ -35,6 +35,7 @@ The Writing Desk retains 88 collection tabs, numbered from zero as in Legacy. Le
|
||||
| `period_modifier` | JSON number in `[0, 2]`; zero is stopped time. An immediately preceding D'ni number page overrides it with digit × 0.08. |
|
||||
| `angle_modifier` | JSON number in `[0, 360)` degrees. An immediately preceding D'ni number page overrides it with digit × 15°, wrapping 360° to 0°. |
|
||||
| `phase_modifier` | JSON number in `[0, 360)` degrees; the compiler converts it to turns. An immediately preceding D'ni number page overrides it with digit × 15°, wrapping 360° to 0°. |
|
||||
| `size_modifier` | JSON scale in `[0.25, 3]`. An immediately preceding D'ni number page overrides it with a linear 0.25×–3× scale: digit 0 is 0.25× and digit 24 is 3×. Without a number, Small/Normal/Large remain 0.5×/1×/2×. |
|
||||
| `block` | Canonical namespaced material ID for a compatible following feature; registered full-collision blocks and source fluids receive generated Pages. |
|
||||
| `feature` | Canonical namespaced feature-effect ID; the compiler must recognize and validate it. This includes supported decorations and structures. |
|
||||
|
||||
|
||||
+1
-1
@@ -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.
|
||||
mod_license=LGPL-3.0-or-later
|
||||
# The mod version. Rivencraft uses the x.y.z.b policy documented in README.md.
|
||||
mod_version=0.6.11.0
|
||||
mod_version=1.0.0.2
|
||||
immersive_portals_version=6.0.7
|
||||
terrablender_version=4.1.0.8
|
||||
serene_seasons_version_id=pHEgQQUE
|
||||
|
||||
@@ -86,7 +86,7 @@ public record AgeSkyProfile(Style style, int color, List<Body> bodies) {
|
||||
case PERIOD_MODIFIER -> period = CelestialPageValues.value(semantics, number);
|
||||
case ANGLE_MODIFIER -> angle = (float) CelestialPageValues.value(semantics, number);
|
||||
case PHASE_MODIFIER -> phase = (float) (CelestialPageValues.value(semantics, number) / 360.0D);
|
||||
case SIZE_MODIFIER -> size = (float) ((SymbolSemantics.NumberValue) semantics.value()).amount();
|
||||
case SIZE_MODIFIER -> size = (float) CelestialPageValues.value(semantics, number);
|
||||
case CELESTIAL_COLOR -> bodyColors.add(color(
|
||||
((SymbolSemantics.ChoiceValue) semantics.value()).id()));
|
||||
case DIRECTION_MODIFIER -> clockwise = ((SymbolSemantics.ChoiceValue) semantics.value())
|
||||
|
||||
@@ -11,6 +11,7 @@ final class CelestialPageValues {
|
||||
return switch (semantics.role()) {
|
||||
case PERIOD_MODIFIER -> number * 0.08D;
|
||||
case ANGLE_MODIFIER, PHASE_MODIFIER -> (number * 15.0D) % 360.0D;
|
||||
case SIZE_MODIFIER -> 0.25D + number * (2.75D / 24.0D);
|
||||
default -> throw new IllegalArgumentException("Not a celestial numeric modifier");
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
package net.dnorberg.rivencraft.book;
|
||||
|
||||
import java.util.List;
|
||||
import net.dnorberg.rivencraft.Rivencraft;
|
||||
import net.dnorberg.rivencraft.writing.OrderedWriting;
|
||||
import net.dnorberg.rivencraft.writing.SymbolReference;
|
||||
import net.dnorberg.rivencraft.writing.WritingEntry;
|
||||
import net.dnorberg.rivencraft.writing.WritingGrammar;
|
||||
import net.minecraft.gametest.framework.GameTest;
|
||||
import net.minecraft.gametest.framework.GameTestHelper;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.neoforged.neoforge.gametest.GameTestHolder;
|
||||
import net.neoforged.neoforge.gametest.PrefixGameTestTemplate;
|
||||
|
||||
/** Focused core coverage without launching the storage-heavy environment archive. */
|
||||
@GameTestHolder(Rivencraft.MOD_ID)
|
||||
@PrefixGameTestTemplate(false)
|
||||
public final class CelestialSizeGameTests {
|
||||
private CelestialSizeGameTests() {}
|
||||
|
||||
@GameTest(template = "empty")
|
||||
public static void adjacentNumberSetsNextCelestialSize(GameTestHelper helper) {
|
||||
OrderedWriting writing = new OrderedWriting(List.of(WritingEntry.linkPanel(),
|
||||
page("number/0"), page("size/small"), page("celestial/sun"),
|
||||
page("number/24"), page("size/large"), page("celestial/moon"),
|
||||
page("number/12"), page("size/normal"), page("celestial/sun")));
|
||||
helper.assertValueEqual(WritingGrammar.parse(writing).writingInstability(), 0,
|
||||
"Adjacent number and size pages must be valid writing");
|
||||
AgeTraits seeded = AgeTraits.select(94L);
|
||||
AgeGenerationPlan plan = AgeGenerationPlan.compile(writing, 94L,
|
||||
AgeGenerationProfiles.STANDARD, seeded, helper.getLevel().registryAccess());
|
||||
AgeSkyProfile sky = AgeSkyProfile.compile(plan, AgeEnvironmentCompiler.apply(plan, seeded));
|
||||
helper.assertValueEqual(sky.bodies().size(), 3, "Three authored bodies must remain distinct");
|
||||
helper.assertValueEqual(sky.bodies().get(0).size(), 0.25F, "Digit zero selects minimum size");
|
||||
helper.assertValueEqual(sky.bodies().get(1).size(), 3.0F, "Digit 24 selects maximum size");
|
||||
helper.assertValueEqual(sky.bodies().get(2).size(), 1.625F, "Digit 12 selects midpoint size");
|
||||
helper.assertValueEqual(AgeSkyProfile.compile(AgeGenerationPlan.load(plan.save()),
|
||||
AgeEnvironmentCompiler.apply(plan, seeded)), sky,
|
||||
"Numbered sizes must survive an Age-plan save/load round trip");
|
||||
|
||||
OrderedWriting plain = new OrderedWriting(List.of(WritingEntry.linkPanel(),
|
||||
page("size/small"), page("celestial/sun"),
|
||||
page("size/normal"), page("celestial/moon"),
|
||||
page("size/large"), page("celestial/sun")));
|
||||
AgeGenerationPlan plainPlan = AgeGenerationPlan.compile(plain, 95L,
|
||||
AgeGenerationProfiles.STANDARD, AgeTraits.select(95L), helper.getLevel().registryAccess());
|
||||
AgeSkyProfile plainSky = AgeSkyProfile.compile(plainPlan,
|
||||
AgeEnvironmentCompiler.apply(plainPlan, AgeTraits.select(95L)));
|
||||
helper.assertValueEqual(plainSky.bodies().get(0).size(), 0.5F, "Small retains its fixed value");
|
||||
helper.assertValueEqual(plainSky.bodies().get(1).size(), 1.0F, "Normal retains its fixed value");
|
||||
helper.assertValueEqual(plainSky.bodies().get(2).size(), 2.0F, "Large retains its fixed value");
|
||||
|
||||
OrderedWriting separated = new OrderedWriting(List.of(WritingEntry.linkPanel(),
|
||||
page("number/24"), page("direction/clockwise"),
|
||||
page("size/large"), page("celestial/sun")));
|
||||
helper.assertValueEqual(WritingGrammar.parse(separated).writingInstability(), 100,
|
||||
"An intervening page must not allow a number to modify size");
|
||||
helper.succeed();
|
||||
}
|
||||
|
||||
private static WritingEntry page(String path) {
|
||||
return WritingEntry.symbol(new SymbolReference(ResourceLocation.fromNamespaceAndPath("rivencraft", path)));
|
||||
}
|
||||
}
|
||||
@@ -43,8 +43,9 @@ public final class HandheldBookTravelGameTests {
|
||||
helper.assertTrue(player.getInventory().getItem(1).is(Items.DIAMOND),
|
||||
"An unrelated inventory item must remain with the player");
|
||||
var drops = helper.getLevel().getEntitiesOfClass(DroppedBookEntity.class, new AABB(source, source).inflate(2.0),
|
||||
entity -> entity.getItem().is(ModItems.LINKING_BOOK.get()));
|
||||
helper.assertValueEqual(drops.size(), 1, "Exactly one recoverable book must remain at the departure point");
|
||||
entity -> entity.getItem() == book);
|
||||
helper.assertValueEqual(drops.size(), 1,
|
||||
"Exactly one entity for this active book must remain at the departure point");
|
||||
helper.assertTrue(drops.getFirst().getItem() == book,
|
||||
"The model-rendered entity must retain the exact active book stack");
|
||||
helper.assertTrue(drops.getFirst().copy() instanceof DroppedBookEntity,
|
||||
|
||||
@@ -107,7 +107,7 @@ public final class BookBinderScreen extends AbstractContainerScreen<BookBinderMe
|
||||
}
|
||||
graphics.disableScissor();
|
||||
drawScrollEnds(graphics);
|
||||
var severity = menu.grammarSeverity().orElse(null);
|
||||
var severity = menu.diagnosticsVisible() ? menu.grammarSeverity().orElse(null) : null;
|
||||
Component status = severity == WritingGrammar.Severity.FATAL
|
||||
? Component.translatable("screen.rivencraft.book_binder.status.fatal")
|
||||
: severity == WritingGrammar.Severity.INSTABILITY
|
||||
@@ -117,9 +117,9 @@ public final class BookBinderScreen extends AbstractContainerScreen<BookBinderMe
|
||||
if (status != null) graphics.drawString(font, status, leftPos + 77, topPos + 30,
|
||||
severity == WritingGrammar.Severity.FATAL ? 0xFFAA3030
|
||||
: severity == WritingGrammar.Severity.INSTABILITY ? 0xFF924F18 : 0xFF50624B, false);
|
||||
Component grammarTooltip = menu.grammarError().map(code -> Component.translatable(
|
||||
Component grammarTooltip = menu.diagnosticsVisible() ? menu.grammarError().map(code -> Component.translatable(
|
||||
"screen.rivencraft.book_binder.grammar." + code.name().toLowerCase(Locale.ROOT),
|
||||
errorStripIndex + 1)).orElse(null);
|
||||
errorStripIndex + 1)).orElse(null) : null;
|
||||
if (grammarTooltip != null && ((mouseX >= leftPos + 77 && mouseX < leftPos + 151)
|
||||
|| (mouseX >= leftPos + 152 && mouseX < leftPos + 168))
|
||||
&& mouseY >= topPos + 27 && mouseY < topPos + 43
|
||||
|
||||
@@ -12,6 +12,7 @@ import net.dnorberg.rivencraft.book.AgeRegistrySavedData;
|
||||
import net.dnorberg.rivencraft.book.AgeInstabilityControls;
|
||||
import net.dnorberg.rivencraft.book.AgeInstabilityRuntime;
|
||||
import net.dnorberg.rivencraft.config.RivencraftConfig;
|
||||
import net.dnorberg.rivencraft.menu.BookBinderDiagnostics;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.commands.CommandSourceStack;
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
@@ -29,6 +30,13 @@ public final class RivencraftCommands {
|
||||
public static void register(RegisterCommandsEvent event) {
|
||||
event.getDispatcher().register(Commands.literal("rivencraft")
|
||||
.requires(source -> source.hasPermission(2))
|
||||
.then(Commands.literal("binder")
|
||||
.then(Commands.literal("messages")
|
||||
.executes(context -> binderMessages(context.getSource(), null))
|
||||
.then(Commands.literal("enable")
|
||||
.executes(context -> binderMessages(context.getSource(), true)))
|
||||
.then(Commands.literal("disable")
|
||||
.executes(context -> binderMessages(context.getSource(), false)))))
|
||||
.then(Commands.literal("library")
|
||||
.then(Commands.literal("nearest")
|
||||
.executes(context -> LibraryLocateService.start(context.getSource())))
|
||||
@@ -94,6 +102,14 @@ public final class RivencraftCommands {
|
||||
.then(environmentCommand())));
|
||||
}
|
||||
|
||||
private static int binderMessages(CommandSourceStack source, Boolean enabled) {
|
||||
BookBinderDiagnostics diagnostics = BookBinderDiagnostics.get(source.getLevel());
|
||||
if (enabled != null) diagnostics.setEnabled(enabled);
|
||||
source.sendSuccess(() -> Component.literal("Book Binder diagnostic messages are "
|
||||
+ (diagnostics.enabled() ? "enabled for operators" : "disabled") + "."), false);
|
||||
return diagnostics.enabled() ? 1 : 0;
|
||||
}
|
||||
|
||||
private static LiteralArgumentBuilder<CommandSourceStack> environmentCommand() {
|
||||
return Commands.literal("environment")
|
||||
.then(Commands.literal("pulse")
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
package net.dnorberg.rivencraft.menu;
|
||||
|
||||
import net.minecraft.core.HolderLookup;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.util.datafix.DataFixTypes;
|
||||
import net.minecraft.world.level.saveddata.SavedData;
|
||||
|
||||
/** World-persistent OP-only visibility switch for Book Binder writing diagnostics. */
|
||||
public final class BookBinderDiagnostics extends SavedData {
|
||||
private static final String DATA_NAME = "rivencraft_binder_diagnostics";
|
||||
private static final Factory<BookBinderDiagnostics> FACTORY = new Factory<>(
|
||||
BookBinderDiagnostics::new, BookBinderDiagnostics::load, DataFixTypes.SAVED_DATA_MAP_DATA);
|
||||
private boolean enabled;
|
||||
|
||||
public static BookBinderDiagnostics get(ServerLevel level) {
|
||||
return level.getServer().overworld().getDataStorage().computeIfAbsent(FACTORY, DATA_NAME);
|
||||
}
|
||||
|
||||
public boolean enabled() { return enabled; }
|
||||
|
||||
public boolean visibleTo(ServerPlayer player) {
|
||||
return visibleTo(player.hasPermissions(2));
|
||||
}
|
||||
|
||||
boolean visibleTo(boolean operator) { return enabled && operator; }
|
||||
|
||||
public boolean setEnabled(boolean enabled) {
|
||||
if (this.enabled == enabled) return false;
|
||||
this.enabled = enabled;
|
||||
setDirty();
|
||||
return true;
|
||||
}
|
||||
|
||||
static BookBinderDiagnostics load(CompoundTag tag, HolderLookup.Provider registries) {
|
||||
BookBinderDiagnostics data = new BookBinderDiagnostics();
|
||||
data.enabled = tag.getBoolean("Enabled");
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override public CompoundTag save(CompoundTag tag, HolderLookup.Provider registries) {
|
||||
tag.putBoolean("Enabled", enabled);
|
||||
return tag;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package net.dnorberg.rivencraft.menu;
|
||||
|
||||
import net.dnorberg.rivencraft.Rivencraft;
|
||||
import net.minecraft.gametest.framework.GameTest;
|
||||
import net.minecraft.gametest.framework.GameTestHelper;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.neoforged.neoforge.gametest.GameTestHolder;
|
||||
import net.neoforged.neoforge.gametest.PrefixGameTestTemplate;
|
||||
|
||||
/** Binder diagnostics are world-persistent but never visible to non-operators. */
|
||||
@GameTestHolder(Rivencraft.MOD_ID)
|
||||
@PrefixGameTestTemplate(false)
|
||||
public final class BookBinderDiagnosticsGameTests {
|
||||
private BookBinderDiagnosticsGameTests() {}
|
||||
|
||||
@GameTest(template = "empty")
|
||||
public static void binderMessagesDefaultOffAndPersist(GameTestHelper helper) {
|
||||
BookBinderDiagnostics data = BookBinderDiagnostics.get(helper.getLevel());
|
||||
helper.assertFalse(data.enabled(), "Binder diagnostic messages must default to off");
|
||||
helper.assertTrue(data.setEnabled(true), "An OP toggle must change the world setting");
|
||||
helper.assertFalse(data.setEnabled(true), "Repeating a toggle must not change the setting");
|
||||
CompoundTag saved = data.save(new CompoundTag(), helper.getLevel().registryAccess());
|
||||
BookBinderDiagnostics restored = BookBinderDiagnostics.load(saved, helper.getLevel().registryAccess());
|
||||
helper.assertTrue(restored.enabled(), "The OP setting must survive world reload");
|
||||
helper.assertTrue(restored.visibleTo(true), "An OP must see enabled binder diagnostics");
|
||||
helper.assertFalse(restored.visibleTo(false), "A non-OP must not see enabled binder diagnostics");
|
||||
helper.assertTrue(restored.setEnabled(false), "An OP toggle must disable messages");
|
||||
helper.assertFalse(restored.visibleTo(true), "Disabled messages must be invisible even to OPs");
|
||||
data.setEnabled(false);
|
||||
helper.succeed();
|
||||
}
|
||||
}
|
||||
@@ -43,6 +43,7 @@ public final class BookBinderMenu extends AbstractContainerMenu {
|
||||
private int grammarErrorStripIndex = -1;
|
||||
private int grammarInstability;
|
||||
private int grammarIncompleteCount;
|
||||
private int diagnosticsVisible;
|
||||
private WritingGrammar.Result serverGrammar;
|
||||
|
||||
public BookBinderMenu(int id, Inventory inventory, RegistryFriendlyByteBuf data) {
|
||||
@@ -62,34 +63,38 @@ public final class BookBinderMenu extends AbstractContainerMenu {
|
||||
});
|
||||
addDataSlot(new DataSlot() {
|
||||
@Override public int get() {
|
||||
return clientSide || binder == null ? grammarErrorCode : binderDiagnostic()
|
||||
return clientSide || binder == null ? grammarErrorCode : !diagnosticsVisibleToAuthor() ? -1 : binderDiagnostic()
|
||||
.map(diagnostic -> diagnostic.code().ordinal()).orElse(-1);
|
||||
}
|
||||
@Override public void set(int value) { grammarErrorCode = value; }
|
||||
});
|
||||
addDataSlot(new DataSlot() {
|
||||
@Override public int get() {
|
||||
return clientSide || binder == null ? grammarErrorStripIndex : binderDiagnostic()
|
||||
return clientSide || binder == null ? grammarErrorStripIndex : !diagnosticsVisibleToAuthor() ? -1 : binderDiagnostic()
|
||||
.map(diagnostic -> binder.writingStripIndex(diagnostic.index())).orElse(-1);
|
||||
}
|
||||
@Override public void set(int value) { grammarErrorStripIndex = value; }
|
||||
});
|
||||
addDataSlot(new DataSlot() {
|
||||
@Override public int get() {
|
||||
return clientSide || binder == null ? grammarInstability
|
||||
return clientSide || binder == null ? grammarInstability : !diagnosticsVisibleToAuthor() ? 0
|
||||
: serverGrammar().writingInstability();
|
||||
}
|
||||
@Override public void set(int value) { grammarInstability = value; }
|
||||
});
|
||||
addDataSlot(new DataSlot() {
|
||||
@Override public int get() {
|
||||
return clientSide || binder == null ? grammarIncompleteCount
|
||||
return clientSide || binder == null ? grammarIncompleteCount : !diagnosticsVisibleToAuthor() ? 0
|
||||
: (int) serverGrammar().diagnostics().stream()
|
||||
.filter(diagnostic -> diagnostic.severity()
|
||||
== WritingGrammar.Severity.SEEDED_COMPLETION).count();
|
||||
}
|
||||
@Override public void set(int value) { grammarIncompleteCount = value; }
|
||||
});
|
||||
addDataSlot(new DataSlot() {
|
||||
@Override public int get() { return clientSide ? diagnosticsVisible : diagnosticsVisibleToAuthor() ? 1 : 0; }
|
||||
@Override public void set(int value) { diagnosticsVisible = value; }
|
||||
});
|
||||
addSlot(new BinderSlot(BookBinderBlockEntity.COVER, 8, 27, 64));
|
||||
addSlot(new BinderSlot(BookBinderBlockEntity.LINK_PANEL, -1000, -1000, 1));
|
||||
addSlot(new BinderSlot(BookBinderBlockEntity.NOTEBOOK, -1000, -1000, 1));
|
||||
@@ -130,7 +135,12 @@ public final class BookBinderMenu extends AbstractContainerMenu {
|
||||
}
|
||||
public int grammarInstability() { return grammarInstability; }
|
||||
public int grammarIncompleteCount() { return grammarIncompleteCount; }
|
||||
public boolean diagnosticsVisible() { return diagnosticsVisible != 0; }
|
||||
public int grammarErrorStripIndex() { return grammarErrorStripIndex; }
|
||||
private boolean diagnosticsVisibleToAuthor() {
|
||||
return bookAuthor instanceof ServerPlayer serverPlayer
|
||||
&& BookBinderDiagnostics.get(serverPlayer.serverLevel()).visibleTo(serverPlayer);
|
||||
}
|
||||
public String title() { return binder == null ? "" : binder.title(); }
|
||||
public boolean setTitle(Player player, String title) {
|
||||
if (clientSide || !stillValid(player) || title == null
|
||||
|
||||
@@ -191,7 +191,8 @@ public final class WritingGrammar {
|
||||
|
||||
private static boolean numberTarget(Role role) {
|
||||
return role == Role.COLOR || role == Role.PERIOD_MODIFIER
|
||||
|| role == Role.ANGLE_MODIFIER || role == Role.PHASE_MODIFIER;
|
||||
|| role == Role.ANGLE_MODIFIER || role == Role.PHASE_MODIFIER
|
||||
|| role == Role.SIZE_MODIFIER;
|
||||
}
|
||||
|
||||
private static int stage(Role role) {
|
||||
|
||||
@@ -260,7 +260,7 @@
|
||||
"symbol.rivencraft.number.22": "D'ni 22",
|
||||
"symbol.rivencraft.number.23": "D'ni 23",
|
||||
"symbol.rivencraft.number.24": "D'ni 24",
|
||||
"symbol.rivencraft.number.description": "Set the next color page to this number × 10, Angle or Phase to × 15°, or Length to × 0.08. A number page affects only the immediately following page.",
|
||||
"symbol.rivencraft.number.description": "Set the next color page to this number × 10, Angle or Phase to × 15°, Length to × 0.08, or Celestial Size from 0.25× to 3×. A number page affects only the immediately following page.",
|
||||
"symbol.rivencraft.weather.normal": "Normal Weather",
|
||||
"symbol.rivencraft.weather.normal.description": "Use the normal weather cycle.",
|
||||
"symbol.rivencraft.weather.fast": "Fast Weather",
|
||||
|
||||
Reference in new issue
Block a user