Repository navigation
feat(jvm)!: host sessions through engine-neutral primitives, split minestom and multistom - #334
Merged
Merged
Conversation
Add SessionHandler, SessionControl, Delivery and ChunkSessions to jvm/runtime so apps decide what a session is and how it is isolated, and add jvm/minestom-primitives with ChunkLogin for upstream Minestom. runtime-minestom now runs on top of these primitives.
… deadlines in sweep Release a delivery only when player cleanup or leave succeeds, enforce the session creation deadline from sweep() instead of the common pool, and publish SessionCreateEvent only when ready() took effect.
Rename runtime-minestom to multistom, runtime-minestom-kotlin to multistom-kotlin and minestom-primitives to minestom, so each published module names the Minestom it compiles against. The version catalog now calls the fork `multistom` and upstream Minestom `minestom`.
This was referenced Oct 6, 2026
2 tasks
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.
Summary
Lets apps bring their own session isolation instead of being bound to the multistom fork.
jvm/runtimegains engine-neutral primitives:SessionHandler— the app decides what a session is (create,finish, optionalmethod).SessionControl— reportsready()(returns whether it took effect) /fail()/ended()back to core.SessionMethod— one session method call; handlers callstart()right before running effects, which re-checks cancellation, the deadline and the player's delivery.Delivery— a delivered player:arrived(),left()(stops methods, keeps the fence),release(),move(destination),operationId(action).ChunkSessions— the ledger behindChunkProcess.host(handler): appliesjvm/<host>entries, admits players by theirchunk:deliverycapability, enforces the creation deadline, fences generations, and reportsJvmReports.ChunkProcessadds publichost,tick,bind(port, protocol)andplayerAddress().jvm/minestom(new, artifactcom.chunkzero.chunk:minestom):ChunkLoginfor upstreamnet.minestom:minestom. It answers the login request, admits only prepared deliveries with the gateway-authenticated profile, and releases each delivery after the app's leave handler once the connection closes. Spawning, arrival and isolation stay with the app (shared instances, several per session, ormax_sessions = 1).jvm/multistom(renamed fromjvm/runtime-minestom;runtime-minestom-kotlinis nowmultistom-kotlin) is rebuilt on top:SessionManagerimplementsSessionHandler, andProcessService/SessionMethodServiceare gone.Behavior changes
The multistom runtime moved from
com.chunkzero.chunk.runtimetocom.chunkzero.chunk.multistom(.assets,.bootstrap,.event,.internal); engine-neutral classes stay incom.chunkzero.chunk.runtime. Generated code (Gradle plugin registries, chunk-build Java codegen and release analysis) targets the new names, so apps need the matchingchunkCLI.SessionControl.isReady()andChunkProcess.app()are now public;ManagedSession.getPhase()is gone.Artifacts renamed:
runtime-minestom→multistom,runtime-minestom-kotlin→multistom-kotlin. The version catalog calls the forklibs.multistomand upstreamlibs.minestom.minestomandmultistomare independent; neither depends on the other.ATTACHED is reported at admission rather than when the player reaches PLAY.
A session method that its handler completes without calling
start()reports CANCELLED; one that fails before starting (e.g. undeclared) reports FAILED.ChunkMinestom's tick notices disconnects (gameplay.flush()) before running queued tick tasks.runtime-minestom-kotlinand runtime tests now build sessions throughChunkSessions.detached(...).jvm/runtimeexposesbackend-clientasapi.Known limitations
multistom(the fork) and generates@SessionTyperegistrations, so a chunk project can't opt into upstream Minestom yet. That needs a follow-up.ended(), same as before.Validation
./gradlew :jvm:runtime:test :jvm:multistom:test :jvm:multistom-kotlin:test :jvm:minestom:test,jvm/gradle-plugintestsexamples/localCoinCommandTestjust fmtcargo test -p chunk-build(release, codegen);examples/{local,arena,load}testClasses🤖 Generated with Claude Code