Vellum 0.8.0 (NeoForge 26.2)
Curse Maven Snippet
What's new
<scene>: a small 3D world in a box. Blocks come from a structure file (structure="ns:path/file.nbt") and<block x y z state>children;<block-group x y z>claims a box of them (x="3..7" y="2", an axis left out being all of it) to show, fade (opacity), move (-mc-translate) and turn (-mc-yaw,-mc-pitchand the new-mc-roll) with ordinary CSS transitions and animations;<entity x y z>children stand in it; and<scene-anchor x y z>pins HTML captions to points in it. The camera is-mc-yaw,-mc-pitch,-mc-model-scaleand the new-mc-scene-center, plus dragging withrotatable. Hovering a block shows its name and firesblockhover, clicking firesblockclick. Each group is meshed once, with neighbors culled, fluids, connected blocks and block entities, and a scene that doesn't change is one blit a frame. Scripts change scenes by changing their children. 26.x only: on 1.21.1 a scene lays out and fires its events but draws nothing. The previewer draws scenes from the blocks' models. See "Scenes" indocs/api/elements.md, and the Cottage showcase (/vellum showcase scene), which builds itself step by step.Host.loadBytes: hosts give the engine binary resources (structure files). In game it reads resources, dev source trees and page folders asloadTextdoes.- Style changes cost much less when selectors can't see them: a script writing
el.styleor text every frame no longer rematches every selector in the page (about 1 ms a frame down to 0.2 ms on a 500-element page). Selectors are matched again only after tree changes, state changes (:hover,:checked...), changes to attributes some selector reads,idandclass, and text that empties or fills an element. - Changing a
<link>'shref,relormedia, or text inside an element in a<style>, restyles the page at once, not with the next change that happens to. DocumentDriver.patch(key, value)sets one top-level field ofvellum.datawithout sending the rest. Only the value is serialized and parsed, the page's other objects stay as they are, and the page getsvellum.on('patch', ({key, value}) => ...), then its'data'listeners with the key as a second argument. A null value removes the field. Patches are kept across reloads, as pushes are.VellumSession.patchandVellumHud.patchdo the same from a server and for HUD overlays; a server's patches count towardclient.maxDataCharsandclient.maxDataDepth.mergeno longer parses and re-serializes the whole data: the driver keeps each top-level field's JSON and only serializes the fields you pass. The page still gets the whole data.
This mod has no additional files

