feat: add animated updates, styles, and box groups - #41
Merged
Merged
Conversation
Shapes can now change after spawning without respawning entities: - setPoints on LineShape, PolylineShape, TriangleShape, and ParallelogramShape updates the existing Text Displays. - setColor, setInterpolationDuration, and setTeleportDuration expose Display interpolation; updates restart the client interpolation, so geometry and background color animate. - translate moves the rendered geometry, riding the root anchor when enabled, unlike teleportOrigin which only rebases. - Packet updates of one shape are sent in a single VirtualEntities bundle, and PacketShapeFactory#batch groups updates across shapes. Adds ShapeStyle, ShapeGroup, BoxOutline, and BoxFaces, plus the platform-neutral DisplayTransform, ShapeGeometry, and BoxGeometry. Packet, Paper, and Spigot shapes now share one base class per platform instead of duplicating lifecycle code, and every public builder method is preserved. The new Shape methods are default methods, so existing third-party implementations still compile. Fixes getSegmentCount reporting two segments for a closed two-point polyline, and pins the E2E fixture to the checkout's version instead of the stale 3.0.0 artifact. The E2E now also verifies an animated update and an animated root-anchor move on a real Paper server. 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.
Summary
Shapes can now change after they spawn. Updates reuse the existing Text Display entities and use Minecraft's Display interpolation, so geometry, color, and position animate on the client instead of being respawned. This is the upstream work listed in the Sculpt redesign report (TWME-TW/SculptPlugin#3, §10.1).
New API
LineShape,PolylineShape,TriangleShape,ParallelogramShapewithsetPoints(...)Shape#setColor/getColorShape#setInterpolationDuration, builderinterpolationDuration(ticks)Shape#setTeleportDuration, builderteleportDuration(ticks)translate(0–59 ticks)Shape#translate(dx, dy, dz)Shape#getEntityCountShapeStyle+ builderstyle(...)ShapeGroupBoxOutline/BoxFaces+ factoryboxOutline/boxFacessetBoundsPacketShapeFactory#batchDisplayTransform,ShapeGeometry,BoxGeometryBehavior
Compatibility
ShapeandShapeBuildermethods are default methods, so third-party implementations still compile.RIGHT_ROTATION, as identity for lines. The client already defaulted to identity, so nothing looks different; it prevents stale rotations when an entity is reused for different geometry.Fixes
getSegmentCount()reported 2 for a closed two-point polyline that only spawns 1 segment.run-e2e.shnow builds the fixture against the version it just installed.Testing
mvn verify: new unit tests cover the geometry, face orientation, groups, styles, and builderstylepropagation.PacketShapeAnimationTest(mocked PacketEvents API, as in VirtualEntities) checks entity reuse, interpolation metadata, bundle framing per viewer, polyline growth and shrinkage, color fades,translatewith and without a root anchor, box outlines, and rejection of invalid updates.integration/mineflayer/run-e2e.sh: passes on a real Paper 1.21.11 server with PacketEvents 2.14.0. After the existing rebase checks, the client:transformation_interpolation_duration = 5, a doubled line scale, and the new color;pos_rot_interpolation_duration = 3and move up one block.🤖 Generated with Claude Code