Skip to content

Conversation

gabber235
Copy link
Owner

@gabber235 gabber235 commented Jun 9, 2025

Summary

  • add InterpolationDurationData to control positionRotationInterpolationDuration on display entities
  • hook new property into DisplayData so it is applied with other display properties
  • use Duration for the interpolation data and convert to ticks

Testing

  • ./gradlew build -x test (fails: Could not resolve io.lumine:Mythic-Dist:5.8.2)

https://chatgpt.com/codex/tasks/task_e_6846c2d58f6c8322a2039259d2bd469e

Summary by CodeRabbit

  • New Features
    • Added support for configuring interpolation duration on display entities, allowing more precise control over animation timing.

Copy link
Contributor

coderabbitai bot commented Jun 9, 2025

Walkthrough

A new feature for handling interpolation duration on display entities was introduced. This includes a new data class and property for interpolation duration, along with logic to apply this property to entities. The main display entity data application function was updated to support this new property type.

Changes

File(s) Change Summary
.../display/DisplayData.kt Updated applyDisplayEntityData to handle InterpolationDurationProperty by calling a new function.
.../display/InterpolationDurationData.kt Added new classes and logic for managing and applying interpolation duration to display entities.

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant DisplayData
    participant InterpolationDurationData
    participant WrapperEntity

    Caller->>DisplayData: applyDisplayEntityData(entity, property)
    DisplayData->>DisplayData: when(property)
    DisplayData-->>InterpolationDurationData: applyInterpolationDurationData(entity, property)
    InterpolationDurationData->>WrapperEntity: Set interpolation duration meta
    WrapperEntity-->>InterpolationDurationData: Success/Failure
Loading

Poem

In the land of code where entities play,
A new duration hops in today.
Interpolation ticks now glide with grace,
Display entities move at a smoother pace.
With a whisk of logic and a dash of delight,
The rabbits cheer, "It works just right!"
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/display/InterpolationDurationData.kt (1)

40-40: Consider validation for duration conversion.

Converting duration to ticks and then to Int could cause data loss for very large durations that exceed Int.MAX_VALUE. Consider adding validation or using a larger data type if the Minecraft API supports it.

-        meta<AbstractDisplayMeta> { positionRotationInterpolationDuration = property.duration.toTicks().toInt() }
+        meta<AbstractDisplayMeta> { 
+            val ticks = property.duration.toTicks()
+            require(ticks <= Int.MAX_VALUE) { "Duration too large: ${property.duration}" }
+            positionRotationInterpolationDuration = ticks.toInt() 
+        }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d9349fc and 26e477a.

📒 Files selected for processing (2)
  • extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/display/DisplayData.kt (1 hunks)
  • extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/display/InterpolationDurationData.kt (1 hunks)
👮 Files not reviewed due to content moderation or server errors (2)
  • extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/display/InterpolationDurationData.kt
  • extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/display/DisplayData.kt
🧰 Additional context used
🧬 Code Graph Analysis (2)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/display/DisplayData.kt (1)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/display/InterpolationDurationData.kt (1)
  • applyInterpolationDurationData (38-43)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/display/InterpolationDurationData.kt (1)
engine/engine-paper/src/main/kotlin/com/typewritermc/engine/paper/command/dsl/TypewriterDsl.kt (1)
  • error (21-23)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build
🔇 Additional comments (10)
extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/display/InterpolationDurationData.kt (7)

17-29: LGTM! Well-structured data class implementation.

The InterpolationDurationData class follows the established patterns correctly with proper annotations, interface implementation, and default values.


31-36: LGTM! Property class follows established patterns.

The InterpolationDurationProperty data class and companion object implementation correctly follows the framework's property pattern.


17-29: LGTM: Well-structured data class implementation.

The InterpolationDurationData class follows the established patterns with proper annotations, implements the correct interface, and provides sensible defaults. The use of Duration.ZERO as default is appropriate.


31-36: LGTM: Property implementation follows framework conventions.

The InterpolationDurationProperty data class and companion object are correctly implemented, following the SinglePropertyCollectorSupplier pattern used throughout the codebase.


1-16: LGTM: Clean package structure and imports.

The package structure follows the expected pattern and all imports are properly used and necessary for the functionality.


17-29: LGTM: Well-structured entry class implementation.

The InterpolationDurationData class follows the established patterns with proper annotations, implements the correct interface, and provides appropriate default values. The Duration.ZERO default is sensible for interpolation duration.


31-36: LGTM: Property class follows established patterns.

The InterpolationDurationProperty data class and companion object correctly implement the expected pattern with SinglePropertyCollectorSupplier and a sensible default value.

extensions/EntityExtension/src/main/kotlin/com/typewritermc/entity/entries/data/minecraft/display/DisplayData.kt (3)

18-18: LGTM! Correct integration of new property type.

The addition of InterpolationDurationProperty to the when expression follows the established pattern and correctly calls the corresponding application function.


18-18: LGTM: Proper integration of the new property type.

The addition of InterpolationDurationProperty to the when expression follows the established pattern and correctly delegates to the applyInterpolationDurationData function.


18-18: LGTM: Proper integration following established patterns.

The new case for InterpolationDurationProperty correctly follows the same pattern as other property types and calls the appropriate application function.

@gabber235 gabber235 merged commit f63c1c8 into develop Jun 9, 2025
3 of 4 checks passed
@gabber235 gabber235 deleted the codex/add-positionrotationinterpolationduration-to-displaydata branch June 9, 2025 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant