Add Round Robin, Self Feed, and Priority to Conduit Probe Copy/Paste #1124
No reviewers
Labels
No labels
Area-Assets
Area-Backend
Area-Conduits
Area-Datapacks
Area-Lang
Area-Mod Compat
Area-Parity
Area-Rendering
Good first issue
MC-1.19.2
MC-1.20.1
MC-1.20.4
MC-1.20.6
MC-1.21
MC-1.21.1
Modtoberfest
P-0-High
P-1-Medium
P-2-Low
Status-Awaiting Response
Status-Behind-Flag
Status-Blocked
Status-Cannot Reproduce
Status-Duplicate
Status-Help Wanted
Status-Incomplete Report
Status-Invalid
Status-Needs LTS Backport
Status-Needs Updating
Status-Stale
Status-To Implement
Status-Triage
Status-Wontfix
Status-Wontmerge
Type-Backport
Type-Bug
Type-Documentation
Type-Enhancement
Type-Question
Type-RFC
Type-Suggestion
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Team-EnderIO/EnderIO#1124
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev/1.20.1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Add ItemConduitData data (round-robin, self-feed, and priority) to the conduit probe's copy/paste function. #1105
It seems like priority and round robin (and probably self-feed too?) should stay in ItemConduitData.
So, the code grabs data directly from
ItemConduitData.ItemSidedDatathroughbundle.getNodeFor(type).getConduitData().get(direction)after checking thatconduitTypeisitemConduitType, instead of adding these properties to DynamicConnectionState.TODO
Breaking Changes
None.
Checklist
Summary by CodeRabbit
Walkthrough
Adds per-face item conduit settings (round-robin, self-feed, priority) to ConduitProbeItem copy/paste. On copy, for ItemConduitType, reads clicked face’s ItemSidedData and stores fields in NBT. On paste, if present, applies those fields to the target face after connection state update. Non-item conduits unchanged.
Changes
src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.javaROUND_ROBIN,SELF_FEED,PRIORITY; extends handleCopy to write per-face item settings to NBT; extends handlePaste to read/apply settings for ItemConduitType using presence checks; leaves other conduit types unaffected.Sequence Diagram(s)
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested labels
Area-Conduits,MC-1.20.1Suggested reviewers
Poem
✨ Finishing Touches
🧪 Generate unit tests
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:
I pushed a fix in commit <commit_id>, please review it.Open a follow-up GitHub issue for this discussion.@coderabbitaiin a new review comment at the desired location with your query.@coderabbitaiin 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.Support
Need help? Create a ticket on our support page for assistance with any issues or questions.
CodeRabbit Commands (Invoked using PR/Issue comments)
Type
@coderabbitai helpto get the list of available commands.Other keywords and placeholders
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed.@coderabbitai summaryto generate the high-level summary at a specific location in the PR description.@coderabbitaianywhere in the PR title to generate the title automatically.CodeRabbit Configuration File (
.coderabbit.yaml).coderabbit.yamlfile to the root of your repository.# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.jsonStatus, Documentation and Community
@coderabbitai review
✅ Actions performed
Review triggered.
Actionable comments posted: 1
🧹 Nitpick comments (1)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration.
📥 Commits
Reviewing files that changed from the base of the PR and between
e4d323c5f0and14191c6583.📒 Files selected for processing (1)
src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java(4 hunks)🔇 Additional comments (3)
⚠️ Potential issue
Possible NPE when copying ItemSidedData if no sided data exists for the clicked face.
get(face)may return null for a type present in the bundle but not initialised on that face. Copy should be read-only and must not create data; add a null-guard instead of usingcompute(...).Apply this diff:
📝 Committable suggestion
🤖 Prompt for AI Agents
sidedData should never be null - my code only runs when the
connectionStateof aconduitType(in abundle) is an instance ofDynamicConnectionState, which implies that the conduit face is initialized.I've tested this with:
[copy] bundle faces without item conduit connection → [paste] bundle face with existing item conduit connection (result: item conduit connection on the paste side gets removed)
[copy] bundle face with existing item conduit connection → [paste] bundle facing block incapable of receiving item conduit connection (result: nothing happens - intended)
🧩 Analysis chain
🏁 Script executed:
Length of output: 1148
🏁 Script executed:
Length of output: 5160
@mosesyu1028, you're absolutely correct! I apologize for the confusion.
Looking at the
ItemConduitData.get()method:The method uses
getOrDefault()with a newItemSidedData()as the default value, which means it never returns null. If no data exists for that direction, it returns a new instance with default values (isRoundRobin=false, isSelfFeed=false, priority=0).Your distinction between
get()andcompute()is also spot-on:get(): Read-only operation that returns existing data or default values without modifying the mapcompute(): Creates and stores new data in the map if it doesn't existUsing
get()in the copy operation is the correct choice since it maintains the read-only nature of copying. My suggested null guard is unnecessary and can be ignored.Thank you for the detailed explanation and testing scenarios - they clearly demonstrate the intended behavior works as expected.
the ai glaze is crazy
@mosesyu1028 Got it - I'll keep responses more direct and to the point. Thanks for the feedback on the communication style.
✏️ Learnings added
@Rover656, could you take a look at this PR? It's ready for review and I'm happy to do extra testing/screenshots if needed.
Looks like this will work as expected - thanks!