Repository navigation
Add the estate API (stage 6b) - #46
Merged
Merged
Conversation
Fires on the main thread after a dead character has been saved as alive again, carrying the character and the death it came back from. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add net.tfminecraft.tlibs.character.estate for stage 6b estates: EstateDecision with typed Recipient parts, EstateParticipant with Outcome and Holdings, EstateFallback with DeathGuild and GuildLookup answers that keep UNAVAILABLE apart from NONE and GONE, EstateService and EstateState, EstateDecidedEvent, and the Estates facade. The facade looks services up on every call, enforces the main thread, answers UNAVAILABLE without a fallback and offers guardHolds, the participant guard: testator DEAD with the decision's deathId and the estate DECIDED at that revision. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
guardHolds now requires the service's current decision to equal the one the participant holds, not only its revision, and the testator's saved ref to match the decision's. report refuses a blank participant ID and a negative revision. The facade reads null answers from a broken service as empty, and participants() no longer promises an order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the stage 6b estate API (design rule E5) in
net.tfminecraft.tlibs.character.estate, plusCharacterRevivedEventinnet.tfminecraft.tlibs.character. Everything is additive; no existing API changes.RPCharacters registers an
EstateServiceand decides each estate. SimpleFactions registers anEstateFallbackfor guild answers. Each plugin that moves a dead character's records registers anEstateParticipant. All three areServicesManagerservices, so the plugins keep no hard dependency on each other.EstateDecisionholds the death, testator, death time (empty for legacy deaths), heir, death guild and realm, the four part recipients and a revision. The constructor refuses a recipient a part cannot have (money: ACCOUNT or FROZEN; property and guild locks: CHARACTER, WAITING or FROZEN; letters: CHARACTER or SENDER).RecipientandOutcomeare sealed types with factories, constants and akind()enum for storage.Outcome.done(counts, movedIds)carries the IDs of every record moved.DeathGuild(UNAVAILABLE, NONE, GUILD) andGuildLookup(UNAVAILABLE, GONE, LIVE) keep "cannot tell now" apart from "no guild" and "gone". Realm UUIDs are the realm's ruling-guild incarnation, soguild(realm)gives the realm treasury.Estatesfacade followsCharacters: main thread only, services looked up on every call, empty answers without a service, andUNAVAILABLEguild answers without a fallback.Estates.guardHolds(decision)is the participant guard: testator DEAD with the decision'sdeathId, estate DECIDED with this exact decision current. Null answers from a broken service read as empty.EstateDecidedEventandCharacterRevivedEventare synchronous wake-ups; their Javadoc says delivery is not durable.Intended release: TLibs 2.6.0 (not tagged; installed locally from
654f780for the dependent stage 6b builds).Gate:
tfmc-mvn -o -B clean verify, 232 tests, 0 failures, JaCoCo line gate (0 missed lines) met; the new classes have no missed lines or branches.Docs: TF-Minecraft/Docs#212
🤖 Generated with Claude Code