Handle conduit priority #1036
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#1036
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
The heart of this change resides in a single line in the item conduit ticker:
inserts.sort(Comparator.comparingInt((CapabilityConnection conn) -> conn.data.compute(conn.direction).priority).reversed());The insert connections are sorted in a descending order as to prioritize high priority values.
Tested only with item conduits with values in the range of integer.
TODO
Breaking Changes
Shouldn't have any (🤞)
Checklist
Summary by CodeRabbit
Walkthrough
The changes update the conduit system's GUI and internal priority handling. In the conduit screen, a conditional check is added to detect
ItemConduitTypeand render corresponding priority labels. Two new buttons in the item conduit screen allow users to increment or decrement conduit priority. The conduit data class now encapsulates the priority field with getter and setter methods that include range validation. Additionally, conduit connections are sorted based on priority in the ticker, a new language constant is introduced, and a dedicated multi-icon button component has been implemented to facilitate these interactions.Changes
src/.../ConduitScreen.javarenderLabelsto check forItemConduitTypeand display priority information; importedItemConduitType.src/.../ItemConduitScreenExtension.javaMultiIconButtonincreateWidgetsto adjust conduit priority using lambda functions.src/.../ItemConduitData.javapriorityfrom public to private; addedgetPriority()andsetPriority(int)with range validation (-9999 to 9999).src/.../ItemConduitTicker.javainsertslist in descending order based on conduit priority usingComparator.src/.../ConduitLang.javaCONDUIT_PRIORITYfor the "Priority" GUI label.src/.../MultiIconButton.javaMultiIconButtonclass with plus/minus button functionality; supports modifier keys for dynamic value changes and includes static factory methods.Sequence Diagram(s)
Poem
✨ Finishing Touches
🪧 Tips
Chat
There are 3 ways to chat with CodeRabbit:
I pushed a fix in commit <commit_id>, please review it.Generate unit testing code for this file.Open a follow-up GitHub issue for this discussion.@coderabbitaiin a new review comment at the desired location with your query. Examples:@coderabbitai generate unit testing code for this file.@coderabbitai modularize this function.@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 src/utils.ts and generate unit testing code.@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.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 pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai generate docstringsto generate docstrings for this PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.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.jsonDocumentation and Community
I'm not sure how I could keep the input box and have the value fully drawn on the screen

note: the "00" value on screen is 100 but the "1" is not showing
@coderabbitai review
✅ Actions performed
Review triggered.
Actionable comments posted: 0
🧹 Nitpick comments (3)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between
6fe4dcf45fandba79b7d7ef.⛔ Files ignored due to path filters (3)
src/core/resources/assets/enderio/textures/gui/multi_icon.pngis excluded by!**/*.pngsrc/generated/resources/assets/enderio/lang/en_ud.jsonis excluded by!**/generated/**src/generated/resources/assets/enderio/lang/en_us.jsonis excluded by!**/generated/**📒 Files selected for processing (6)
src/conduits/java/com/enderio/conduits/client/gui/ConduitScreen.java(2 hunks)src/conduits/java/com/enderio/conduits/client/gui/conduit/ItemConduitScreenExtension.java(2 hunks)src/conduits/java/com/enderio/conduits/common/conduit/type/item/ItemConduitData.java(1 hunks)src/conduits/java/com/enderio/conduits/common/conduit/type/item/ItemConduitTicker.java(2 hunks)src/conduits/java/com/enderio/conduits/common/init/ConduitLang.java(1 hunks)src/core/java/com/enderio/core/client/gui/widgets/MultiIconButton.java(1 hunks)🧰 Additional context used
🧬 Code Definitions (2)
src/conduits/java/com/enderio/conduits/client/gui/ConduitScreen.java (1)
src/conduits/java/com/enderio/conduits/client/gui/conduit/ItemConduitScreenExtension.java (1)
🔇 Additional comments (11)
I should be able to review these changes in the coming week or two as university is finishing up for me, thanks for your hard work and patience!
its fine, though I have to put this here

This looks good to me, thanks for working on this!
I'll manually port this up to 1.21.1 as part of my conduit rewrite work in #1025