Port Conduit Probe to 1.21.1 #1126
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#1126
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "dev/1.21.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
Closes #810, #1127
Port conduit probe from dev/1.20.1 to dev/1.21.1
TODO
Breaking Changes
None
Checklist
Summary by CodeRabbit
New Features
Bug Fixes
Walkthrough
Adds a Conduit Probe item with PROBE/COPY_PASTE modes, client-side Shift+Mouse‑Wheel mode switching, item property for model override, persistent/networked probe state and copied config storage, server packet handling, recipe, translations, and a guard to avoid opening conduit GUI when holding probe/wrench/facade. (≤50 words)
Changes
enderio-conduits/.../client/ConduitClientSetup.java,enderio-conduits/.../client/input/InputEventListener.javaprobe_stateitem property for model overrides on the conduit probe; adds client-only Shift+Mouse Wheel listener to toggle probe state and cancel the scroll event.enderio-conduits/.../common/items/ConduitProbeItem.java,enderio-conduits/.../common/items/package-info.java,enderio-conduits/.../common/init/ConduitComponents.java,enderio-conduits/.../common/network/C2SSyncProbeStatePacket.java,enderio-conduits/.../common/network/ConduitNetwork.java,enderio-conduits/.../common/network/ConduitServerPayloadHandler.javaConduitProbeItemwith PROBE and COPY_PASTE modes, ProbeConfigData and State codecs/stream-codecs, registersprobe_configandprobe_statedata components, introduces a C2S sync packet and server handler to update held item state.enderio-conduits/.../common/init/ConduitItems.java,enderio-conduits/.../data/recipe/ConduitRecipes.javaconduit_probeitem and adds its crafting recipe (MISC); minor recipe builder formatting change.enderio-conduits/.../common/init/ConduitLang.javaenderio-conduits/.../common/conduit/bundle/ConduitBlockEvent.javaenderio-conduits/.../resources/assets/enderio/models/item/conduit_probe.json,.../conduit_probe_copy.jsonenderio:probe_statepredicate equals 1 (copy/paste mode).Sequence Diagram(s)
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~25 minutes
Assessment against linked issues
Possibly related PRs
Suggested 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
Comment
@coderabbitai helpto get the list of available commands and usage tips.@Rover656 thanks for the reaction :)
Wondering if you could explain a little bit about
RedstoneSensitiveConnectionConfig.It seems like it is dealing with extract redstone colors, and in the future you are able to select multiple colors to emit? If so, then we should put the extract redstone parameters
extractRedstoneControlandextractRedstoneChannelintoRedstoneSensitiveConnectionConfig. I see that everyIOConnectionConfigexcept for redstone conduit already implementsRedstoneSensitiveConnectionConfig, so this seems like it's the desired behavior?The idea is that redstone control can be defined by each conduit in any way it deems fit - that interface exists only to get the redstone colours in use for rendering the conduit model.
I see. Would it make sense to extend IOConnectionConfig into a
RedstoneEnabledIOConnectionConfig interface or something like that? and
have item, fluid, and energy (but not redstone) implement it, because they
all share the same extractRedstoneChannel and extractRedstoneControl?
Otherwise there would be repeated code to check for those settings for each
connectionconfig.
Is it instead possible to introduce a new interface which allows a conduit connection to send and receive a CompoundTag from which it can take settings? Then you can make custom connection data copying pretty extensible, even by modded conduits
Oh yeah, thats a much better idea, I'll implement that instead
@coderabbitai review
✅ Actions performed
Review triggered.
Actionable comments posted: 3
🧹 Nitpick comments (13)
📜 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
59402bfbcdand881736f160.⛔ Files ignored due to path filters (3)
enderio-conduits/src/generated/resources/assets/enderio/lang/en_us.jsonis excluded by!**/generated/**enderio-conduits/src/generated/resources/data/enderio/advancement/recipes/misc/conduit_probe.jsonis excluded by!**/generated/**enderio-conduits/src/generated/resources/data/enderio/recipe/conduit_probe.jsonis excluded by!**/generated/**📒 Files selected for processing (15)
enderio-conduits/src/main/java/com/enderio/conduits/api/connection/config/ProbeableConnectionConfig.java(1 hunks)enderio-conduits/src/main/java/com/enderio/conduits/client/ConduitClientSetup.java(3 hunks)enderio-conduits/src/main/java/com/enderio/conduits/client/input/InputEventListener.java(1 hunks)enderio-conduits/src/main/java/com/enderio/conduits/common/conduit/bundle/ConduitBlockEvent.java(2 hunks)enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitComponents.java(2 hunks)enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitItems.java(3 hunks)enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitLang.java(1 hunks)enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java(1 hunks)enderio-conduits/src/main/java/com/enderio/conduits/common/items/package-info.java(1 hunks)enderio-conduits/src/main/java/com/enderio/conduits/common/network/C2SSyncProbeStatePacket.java(1 hunks)enderio-conduits/src/main/java/com/enderio/conduits/common/network/ConduitNetwork.java(1 hunks)enderio-conduits/src/main/java/com/enderio/conduits/common/network/ConduitServerPayloadHandler.java(2 hunks)enderio-conduits/src/main/java/com/enderio/conduits/data/recipe/ConduitRecipes.java(4 hunks)enderio-conduits/src/main/resources/assets/enderio/models/item/conduit_probe.json(1 hunks)enderio-conduits/src/main/resources/assets/enderio/models/item/conduit_probe_copy.json(1 hunks)🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (10)
🛠️ Refactor suggestion
Fix incorrect Javadoc and clarify the contract for copy/paste semantics
The current class-level comment mentions redstone colours, which is unrelated and misleading here. Also, clarify whether fromProbeTag mutates and returns this or may return a new instance.
Optional: consider renaming fromProbeTag to applyProbeTag for intent clarity.
📝 Committable suggestion
🤖 Prompt for AI Agents
@ -0,0 +1,40 @@package com.enderio.conduits.client.input;🛠️ Refactor suggestion
⚠️ Potential issue
Prevent double-toggle and avoid toggling while a GUI is open
If the probe is held in both hands, this toggles twice and net state remains unchanged. Also guard against firing while a screen is open (inventory/chat), which currently flips mode on scroll inside GUIs.
Apply:
📝 Committable suggestion
🤖 Prompt for AI Agents
✅ Addressed in commit
dd73ab3@ -0,0 +1,232 @@package com.enderio.conduits.common.items;🛠️ Refactor suggestion
Paste should deep-copy configs, not reuse instances
Reusing the same ConnectionConfig instance can couple multiple connections and create shared mutable state. Create a defensive copy per paste (via CODEC round-trip or a copy() API) before setConnectionConfig.
Sketch using CODEC (adjust imports/types to your environment):
🤖 Prompt for AI Agents
✅ Addressed in commit
d13ab88@ -0,0 +1,40 @@package com.enderio.conduits.client.input;tested, no problem with conduit probe in each hand and scroll doesn't fire when in a gui
@ -0,0 +1,40 @@package com.enderio.conduits.client.input;@mosesyu1028 Good, the fix prevents both issues as intended.
🧠 Learnings used
If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!
fixed, removed unused file
@mosesyu1028 Good, the Javadoc correction and cleanup are complete.
🧠 Learnings used
If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!
@coderabbit review
✅ Actions performed
Review triggered.
Actionable comments posted: 0
♻️ Duplicate comments (1)
🧹 Nitpick comments (5)
📜 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
881736f160anddd73ab339b.📒 Files selected for processing (3)
enderio-conduits/src/main/java/com/enderio/conduits/client/input/InputEventListener.java(1 hunks)enderio-conduits/src/main/java/com/enderio/conduits/common/conduit/bundle/ConduitBlockEvent.java(2 hunks)enderio-conduits/src/main/java/com/enderio/conduits/data/recipe/ConduitRecipes.java(4 hunks)🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
🔇 Additional comments (2)
@ -0,0 +1,232 @@package com.enderio.conduits.common.items;won't change, current implementation is similar to dev/1.20.1 with
conduitBlock.handleConnectionStateUpdate()@ -0,0 +1,232 @@package com.enderio.conduits.common.items;@mosesyu1028 Understood, maintaining consistency with the existing dev/1.20.1 pattern makes sense.
🧠 Learnings used
Actionable comments posted: 1
♻️ Duplicate comments (1)
🧹 Nitpick comments (5)
📜 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
b54649345band2d121799cd.📒 Files selected for processing (1)
enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java(1 hunks)🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
📚 Learning: 2025-08-26T17:19:26.821Z
Applied to files:
enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java🧬 Code graph analysis (1)
enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (3)
@ -0,0 +1,232 @@package com.enderio.conduits.common.items;🛠️ Refactor suggestion
Do not store live ConnectionConfig instances on the ItemStack; deep-copy on copy
Storing the actual config objects risks shared mutable state and potential memory retention if configs reference world/state. Persist a cloned instance via a CODEC round-trip before putting it into ProbeConfigData.
📝 Committable suggestion
✅ Addressed in commit
d13ab88@ -0,0 +1,232 @@package com.enderio.conduits.common.items;Fixed with
d13ab887bbut I'm not that sure if this should be done... please check in review?@ -0,0 +1,232 @@package com.enderio.conduits.common.items;🧩 Analysis chain
🏁 Script executed:
Length of output: 491
🏁 Script executed:
Length of output: 1563
🏁 Script executed:
Length of output: 9605
@mosesyu1028 The deep-copy implementation is correct and follows the established pattern in the codebase.
Looking at the code,
ConnectionConfig.GENERIC_CODECis the official codec used throughout the project for ConnectionConfig serialization. The same encode/decode pattern is used inConduitBundleBlockEntityfor persistence (lines 1359, 1437). Your implementation:GENERIC_CODECis the standard codec for this typeRegistryOpsThe approach is sound. The CODEC round-trip ensures you get a proper deep copy that's safe to store on the ItemStack without risking memory leaks or shared state issues.
🧠 Learnings used
Actionable comments posted: 0
♻️ Duplicate comments (1)
🧹 Nitpick comments (5)
📜 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
2d121799cdandd13ab887b5.📒 Files selected for processing (1)
enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java(1 hunks)🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
📚 Learning: 2025-08-26T17:19:26.821Z
Applied to files:
enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java🧬 Code graph analysis (1)
enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (2)
Some initial commentary :)
I'm fairly sure this shouldn't be required?
@ -0,0 +1,232 @@package com.enderio.conduits.common.items;Tend to prefer curly braces around all conditions please :)
We can reduce nesting a bit if we invert the condition and early return :)
Just to make this method more readable, perhaps we can extract the string building out to its own method?
Please import these :)
@ -88,1 +101,4 @@}});}}Maybe we should send the hand in the packet too? That way we definitely get the correct item when syncing.
Actually, should we need to sync these details? The copying should really be performed on the server, not the client (some conduit options aren't synchronised to the client bundle anymore) - when it is updated on the server, it'll be synced automatically to the client.
Actionable comments posted: 0
♻️ Duplicate comments (1)
🧹 Nitpick comments (5)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between
bfada24e6bandd2c3a1ffd1.📒 Files selected for processing (1)
enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java(1 hunks)🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
📚 Learning: 2025-08-26T17:19:26.821Z
Applied to files:
enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (2)
It seems to be required - from testing, not including this guard has the following effects:
Actionable comments posted: 0
♻️ Duplicate comments (1)
🧹 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
d2c3a1ffd1andcf319e37a8.📒 Files selected for processing (1)
enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java(1 hunks)🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
📚 Learning: 2025-08-26T17:19:26.821Z
Applied to files:
enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
@ -88,1 +101,4 @@}});}}C2SSyncProbeStatePacketonly deals with syncing the state of the conduit probe from probe mode to copy/paste mode, and it doesn't handle any of the copying and pasting, which is the same as 1.20.1.ConduitProbeItem.java:51ensures that the copy/paste code is done on the server side only:@ -88,1 +101,4 @@}});}}I guess I could do this, because something like pressing switch hands rapidly on a high ping server might bug it out? But I can't replicate any issue, and for what it's worth it shouldn't matter too much?
Hiya, re-requested review :)
Sorry if I resolved some comments that I shouldn't have, not sure what the protocol is.
The code looks good, thanks a lot.
I'm going to merge now, and I am going to look at writing some game tests for it in a little while, and perhaps make some small modifications to the networking code and the ConduitBlockEvent handling.
Thanks for your hard work on this feature, I know players will be incredibly excited to see the item probe return on 1.21.