-
-
Notifications
You must be signed in to change notification settings - Fork 96
Add generic particle path stream display #349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughA new Kotlin class, Changes
Sequence Diagram(s)sequenceDiagram
participant Player
participant ParticlePathStreamDisplayEntry
participant PathStreamDisplay
participant LinePathStreamProducer
Player->>ParticlePathStreamDisplayEntry: createDisplay()
ParticlePathStreamDisplayEntry->>PathStreamDisplay: instantiate with config
Player->>ParticlePathStreamDisplayEntry: createProducer(roadNetwork, start, end)
ParticlePathStreamDisplayEntry->>LinePathStreamProducer: instantiate with parameters
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
extensions/RoadNetworkExtension/src/main/kotlin/com/typewritermc/roadnetwork/entries/displays/ParticlePathStreamDisplayEntry.kt (1)
28-45
: Consider documenting the default values and adding parameter validation.The constructor properties are well-structured with appropriate defaults, but could benefit from additional documentation and validation:
- The
refreshDuration
default of 1700ms seems specific - consider documenting why this value was chosen- The
particleSpeed
default of 0f might need clarification on whether stationary particles are intended- Consider adding parameter validation for negative values where inappropriate
class ParticlePathStreamDisplayEntry( override val id: String = "", override val name: String = "", override val children: List<Ref<out AudienceEntry>> = emptyList(), + @Help("Refresh interval for the particle stream display") override val refreshDuration: Duration = Duration.ofMillis(1700), @Default("{\"x\": 0.3, \"y\": 0.0, \"z\": 0.3}") + @Help("Random offset applied to particle positions") val particleOffset: Vector = Vector(0.3, 0.0, 0.3), @Default("{\"x\": 0.0, \"y\": 0.2, \"z\": 0.0}") + @Help("Offset applied to the base path position") val positionOffset: Vector = Vector(0.0, 0.2, 0.0), @Default("1") + @Help("Number of particles to spawn per display tick") val count: Int = 1, + @Help("Initial velocity of spawned particles (0 for stationary)") val particleSpeed: Float = 0f, @Help("How fast the stream travels in blocks per second") @Default("20.0") val travelSpeed: Double = 20.0, @Default("\"TOTEM_OF_UNDYING\"") + @Help("Type of particle to display in the stream") val particleType: ParticleTypes = ParticleTypes.TOTEM_OF_UNDYING, ) : PathStreamDisplayEntry {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
extensions/RoadNetworkExtension/src/main/kotlin/com/typewritermc/roadnetwork/entries/displays/ParticlePathStreamDisplayEntry.kt
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build
🔇 Additional comments (4)
extensions/RoadNetworkExtension/src/main/kotlin/com/typewritermc/roadnetwork/entries/displays/ParticlePathStreamDisplayEntry.kt (4)
1-21
: Imports look clean and well-organized.All imports appear to be necessary and used appropriately throughout the class. The package structure follows standard conventions.
22-27
: Entry annotation configuration looks appropriate.The entry registration uses descriptive metadata with proper color coding and icon selection for the particle stream display.
46-53
: Display creation method is correctly implemented.The method properly delegates to
ParticlePathStreamDisplay
with all necessary parameters. The implementation is clean and follows the expected pattern.
55-69
: Producer creation method is well-structured.The method correctly creates a
LinePathStreamProducer
with appropriate parameters. The use ofref()
,displays()
, and other framework methods appears consistent with the pattern.
fa53ebc
to
5112919
Compare
Summary
Testing
./gradlew build --no-daemon --console=plain
(failed: Could not connect to Kotlin compile daemon)https://chatgpt.com/codex/tasks/task_e_6847ef5537a88322b53bfcc4315b69db
Summary by CodeRabbit