v0.20.0
minor5 new · 11 fixes and changes · 4 breaking
New 5
- 0df23d5
Run every command from one registry.
/tps,/version(/about),/debug,/banand/pardonnow register into the same@jsprismarine/commandsregistry as the vanilla set, so/helplists them and the remote console completes every command name rather than these five alone./banand/pardonstill complete a name from the players online and accept one who is offline.Breaking: what to update
Removed with the second dispatcher: the
Commandclass,CommandArguments, theCommandsnamespace,CommandManager.registerCommand,getCommand,getCommands,getCommandsListandgetDispatcher, thecommandRegisterevent andCommandRegisterEvent, andvanillaPermissionOf, which is nowcommandPermissionOf.asyncCommandis gone;deferCommandWorkandcollectAsyncCommandsmove tocommand/deferred. - dc2dfdd
The query protocol is part of the server's networking now, with a new
query-portsetting besideenable-query, which stays on by default.Details
A
query-portequal toport, which a fresh config writes, answers on the RakNet socket as before; any other port gets a UDP socket of its own. Query replies now require the challenge token from the handshake, so a forged source address gets no status reply, and full stat requests get the full key list and player names. Basic stat replies follow the protocol, with the host port as a little-endian short.Breaking: what to update
QueryManager,Server.getQueryManager()and thequeryTokenkernel token are removed,NetworkDispatcherOptionsno longer takes aqueryoption, and aRakNetTransportSourceneedssendBuffer. - 4bb200f
Remove the legacy recipe manager. Crafting runs on the content build's recipe book only:
CraftingDataPacketis built from it and anItemStackRequestis resolved against it, so the two always agree on net ids. A content build that produced no crafting payload now sends no recipes, where it used to fall back to a second, differently numbered list.Breaking: what to update
Removed:
Server.getRecipeManager,Server.getStationRegistry,recipesToken,stationsToken, therecipeRegisterevent andRecipeRegisterEvent, and thecrafting/RecipeManager,Recipe,RecipeIngredient,VanillaRecipesandCraftingStationmodules. Add recipes through a pack's recipe definitions instead. - 16e3296
The server now names every connection itself, so transports other than RakNet can plug in without their clients' identities colliding.
Details
A
ConnectionIdis allocated per accepted connection from one sequence every transport shares (1, 2, 3 in accept order, never reused), and the session registry, per-connection frame queues, and inbound and outbound packet traces all key on it. A client reconnecting from the same address and port is a new connection with a new ID.The transport seam changes with it.
TransportConnection.tokenis replaced byidand gainsaddress, the client's IP address and port.Transport.onDisconnectlisteners receive(id, address, reason)andTransport.onFramelisteners(payload, id), andonRawis optional because only RakNet carries datagrams from hosts that are not connected.SessionManager.add,has,getandremovetake aConnectionId.BaseTransport,KeyedTransportandMultiTransporthold the subscriptions, per-connection ordering, wire-key mapping and transport merging that every transport shares;MultiTransportowns the allocator and hands it to the transports it builds, andServer.getMetadata()no longer needs RakNet to be enabled;RakNetTransporttakes the allocator as a third argument.ClientConnection.getConnectionId()andClientConnection.getAddress()work whichever transport carried the client;ClientConnection.getRakNetSession()is deprecated and throws for a client that did not connect over RakNet. TheraknetDisconnectevent fires for every transport's clients. - 2f505cd
@jsprismarine/authcovers both ends of a Bedrock login.Details
XboxAuthProvidersigns in to Xbox Live through prismarine-auth, an optional peer dependency loaded only when a provider signs in, and presents the chain and multiplayer token Minecraft services issue for its key.createAuthProviderbuilds a provider by name, andKeyedAuthProvideris the base both providers share. A provider'sgetMultiplayerToken()returns its token, and@jsprismarine/clientsigns its NetherNet offer with it, as a signed-in game client does. The server's login verification moved into the package asverifyLogin, exported from@jsprismarine/auth/server, beside the values both ends agree on in@jsprismarine/auth/protocol.Every JWT and JWS is now signed, verified and decoded by
joserather than by hand or through fast-jwt, which no package depends on any more.verifyLoginfetches the issuer's keys throughjose's remote key set, and allows a minute of clock drift on a token's expiry as well as its start.Breaking: what to update
@jsprismarine/prismarine/network/LoginVerifieris removed; importverifyLogin,LoginRefused,MojangKeysanduseLoginKeysfrom@jsprismarine/auth/server, andTOKEN_ISSUERfrom@jsprismarine/auth/protocol.MojangKeystakes afetchimplementation instead of a key set loader and a clock.SessionEncryption.beginreturns a promise.
Fixes and changes 11
- 8c2054b
Build the shipped block-state schemas from
@jsprismarine/blocks' vanilla palette instead of reading the generated catalog a second time, so one package owns which states a block has and what each accepts.BlockStateValueis now@jsprismarine/blocks' type, re-exported unchanged, andschemaFromModelturns aBlockStateModelinto the NBT-typed schema the runtime id hash uses. Runtime ids do not change. - bfa224c
Give each data-driven mob one runtime id. Its client-facing body used to draw a second id after the runtime drew the first, so the wire, the world's entity map and the runtime named the same mob by two numbers bridged by a lookup table. The body now carries the runtime's id, and
EntityandGenericEntitytake an optionalruntimeIdfor a body whose id was drawn elsewhere. - e498e81
New package
@jsprismarine/nethernetholds the NetherNet pieces a server and a client share: HTTP signaling, the signeda=identityon SDP answers, the LAN advertisement codec and the ES384 JSON Web Signatures Bedrock uses.@jsprismarine/prismarineuses it for its NetherNet transport and its encryption handshake. - 40bef5d
The server accepts Bedrock clients over NetherNet, the WebRTC transport Bedrock Dedicated Server defaults to, alongside RakNet.
Details
A client joining by address signals over HTTP on the TCP side of the game port (
GET /v1/joinandPOST /v1/join/{networkId}), and every answer carries the server's signed identity, whose P-384 key the server keeps innethernet-identity.pemin its data directory so returning players are not asked to trust a new one. Withenable-lan-visibilityon, it answers NetherNet discovery on UDP port 7551, so players on the local network see it among their LAN games and join it over NetherNet. The advertisement carries the same MOTD, version and player counts as the RakNet server list entry, and the player count now covers every transport's clients.NetherNetTransportcarries the peers of anethernetserver, adding and removing the0xFEbatch id the NetherNet wire leaves out. - 5409d2e
ServerName.ownPlayerCount()hands the advertised player count to whoever owns the server name: the RakNet sockets then report their sessions throughServerName.setSessionCount, which no longer changes the count. JSPrismarine takes the count over, so a RakNet socket no longer briefly overwrites a count that includes NetherNet players with its own session count. - 67d6870
Remove
ProtoChunk,ProtoChunkDetachedError,HEIGHTMAPSand theProtoChunk*payload types from@jsprismarine/chunkgen.Details
Nothing ran on them: the server's generator climbs the ladder with its own
GenerationChunk.ChunkHolder,ChunkHolderMap,GenerationScheduler,StepRegion,StepTask,StepTasks,NeighborReaderandChunkStepBodynow take the chunk type as a required parameter.ChunkStatusRegressionErrormoves besideStagedChunk, and the prismarine generator raises it in place of its ownGenerationChunkRegressionError.