Port Conduit Probe to 1.21.1 #1126

Merged
mosesyu1028 merged 16 commits from dev/1.21.1 into dev/1.21.1 2025-09-26 15:48:11 +00:00
mosesyu1028 commented 2025-08-28 14:16:25 +00:00 (Migrated from github.com)

Description

Closes #810, #1127
Port conduit probe from dev/1.20.1 to dev/1.21.1

image image image

TODO

  • Add copy/paste functionality
  • Add chat/tooltip logs showing what got copied
  • Add probe functionality (won't do in this PR)

Breaking Changes

None

Checklist

  • My code follows the style guidelines of this project (.editorconfig, most IDEs will use this for you).
  • I have made corresponding changes to the documentation.
  • My changes are ready for review from a contributor.

Summary by CodeRabbit

  • New Features

    • Added the Conduit Probe item with two modes (Probe, Copy/Paste), hover tooltips, on-screen messages, per-face copy/paste of conduit settings, and persistent/network-synced mode and copied data.
    • Shift + mouse wheel switches modes; mode changes sync to server and update the probe’s appearance.
    • Added crafting recipe, item models and localisation for the Conduit Probe.
  • Bug Fixes

    • Prevents opening the conduit GUI when interacting while holding wrench, facade or probe.
# Description Closes #810, #1127 Port conduit probe from dev/1.20.1 to dev/1.21.1 <img width="345" height="133" alt="image" src="https://github.com/user-attachments/assets/e9db59db-65f5-4594-b92f-ee8c059dbc98" /> <img width="1240" height="732" alt="image" src="https://github.com/user-attachments/assets/1398f0a2-c0c4-498e-a287-41ce57468488" /> <img width="760" height="554" alt="image" src="https://github.com/user-attachments/assets/dc473b77-7476-4e41-8c2d-e9b0aeb25bbe" /> # TODO - [x] Add copy/paste functionality - [x] Add chat/tooltip logs showing what got copied - Add probe functionality (won't do in this PR) # Breaking Changes None # Checklist - [X] My code follows the style guidelines of this project (.editorconfig, most IDEs will use this for you). - [x] I have made corresponding changes to the documentation. - [x] My changes are ready for review from a contributor. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added the Conduit Probe item with two modes (Probe, Copy/Paste), hover tooltips, on-screen messages, per-face copy/paste of conduit settings, and persistent/network-synced mode and copied data. - Shift + mouse wheel switches modes; mode changes sync to server and update the probe’s appearance. - Added crafting recipe, item models and localisation for the Conduit Probe. - **Bug Fixes** - Prevents opening the conduit GUI when interacting while holding wrench, facade or probe. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
coderabbitai[bot] commented 2025-08-28 14:16:31 +00:00 (Migrated from github.com)

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

Cohort / File(s) Summary
Client setup & input
enderio-conduits/.../client/ConduitClientSetup.java, enderio-conduits/.../client/input/InputEventListener.java
Registers probe_state item property for model overrides on the conduit probe; adds client-only Shift+Mouse Wheel listener to toggle probe state and cancel the scroll event.
Probe item, components & server sync
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.java
Adds ConduitProbeItem with PROBE and COPY_PASTE modes, ProbeConfigData and State codecs/stream-codecs, registers probe_config and probe_state data components, introduces a C2S sync packet and server handler to update held item state.
Items & recipes
enderio-conduits/.../common/init/ConduitItems.java, enderio-conduits/.../data/recipe/ConduitRecipes.java
Registers conduit_probe item and adds its crafting recipe (MISC); minor recipe builder formatting change.
Lang
enderio-conduits/.../common/init/ConduitLang.java
Adds translation keys/constants for probe tooltips, modes, states and copy/paste messages.
Block interaction guard
enderio-conduits/.../common/conduit/bundle/ConduitBlockEvent.java
Prevents opening conduit GUI when player holds Yeta Wrench, Conduit Facade, or Conduit Probe.
Models
enderio-conduits/.../resources/assets/enderio/models/item/conduit_probe.json, .../conduit_probe_copy.json
Adds base and override item models; switches appearance when enderio:probe_state predicate equals 1 (copy/paste mode).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Player
  participant Client as Client (Input)
  participant Item as ConduitProbeItem
  participant Server
  participant Handler as ConduitServerPayloadHandler

  rect rgba(230,240,255,0.6)
  note right of Client: Mode switch (Shift + Mouse Wheel)
  Player->>Client: Scroll + Shift
  Client->>Item: switchState(stack, player, sync=true)
  Item-->>Client: local PROBE_STATE update
  Client->>Server: send C2SSyncProbeStatePacket(state)
  Server->>Handler: handle(packet)
  Handler->>Server: update held item PROBE_STATE
  end
sequenceDiagram
  autonumber
  participant Player
  participant Item as ConduitProbeItem
  participant World
  participant Bundle as ConduitBundleBlockEntity

  rect rgba(240,255,240,0.6)
  note right of Bundle: Copy / Paste flow
  Player->>World: Use Probe on Conduit
  World->>Item: onItemUseFirst(ctx)
  alt COPY_PASTE + sneak-right-click
    Item->>Bundle: read face configs
    Item->>Item: store ProbeConfigData on stack
    Item-->>Player: show "copied" message
  else COPY_PASTE + normal use
    Item->>Item: read ProbeConfigData from stack
    Item->>Bundle: apply configs to matching conduits
    Bundle->>Bundle: mark shape re-eval
    Item-->>Player: show "pasted" message
  else PROBE
    Item-->>Player: show "probe not implemented" message
  end
  end

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Assessment against linked issues

Objective Addressed Explanation
Copy & Paste Functionality [#810]
Probing Functionality [#810] Probe mode contains only a "not implemented" response; no probing logic present.
Mode switching: Shift‑Mouse Wheel or 'Y' [#810] Shift+Mouse Wheel implemented; no implementation for 'Y' key binding in this diff.

Suggested reviewers

  • Rover656

Poem

I twitched my nose and turned the wheel,
I copied configs with a gentle feel,
Probe in paw, I hop and paste,
Bundles change with hurried haste,
🐇

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.

Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 help to get the list of available commands and usage tips.

<!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- walkthrough_start --> ## 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 | Cohort / File(s) | Summary | | --- | --- | | **Client setup & input**<br>`enderio-conduits/.../client/ConduitClientSetup.java`, `enderio-conduits/.../client/input/InputEventListener.java` | Registers `probe_state` item property for model overrides on the conduit probe; adds client-only Shift+Mouse Wheel listener to toggle probe state and cancel the scroll event. | | **Probe item, components & server sync**<br>`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.java` | Adds `ConduitProbeItem` with PROBE and COPY_PASTE modes, ProbeConfigData and State codecs/stream-codecs, registers `probe_config` and `probe_state` data components, introduces a C2S sync packet and server handler to update held item state. | | **Items & recipes**<br>`enderio-conduits/.../common/init/ConduitItems.java`, `enderio-conduits/.../data/recipe/ConduitRecipes.java` | Registers `conduit_probe` item and adds its crafting recipe (MISC); minor recipe builder formatting change. | | **Lang**<br>`enderio-conduits/.../common/init/ConduitLang.java` | Adds translation keys/constants for probe tooltips, modes, states and copy/paste messages. | | **Block interaction guard**<br>`enderio-conduits/.../common/conduit/bundle/ConduitBlockEvent.java` | Prevents opening conduit GUI when player holds Yeta Wrench, Conduit Facade, or Conduit Probe. | | **Models**<br>`enderio-conduits/.../resources/assets/enderio/models/item/conduit_probe.json`, `.../conduit_probe_copy.json` | Adds base and override item models; switches appearance when `enderio:probe_state` predicate equals 1 (copy/paste mode). | ## Sequence Diagram(s) ```mermaid sequenceDiagram autonumber participant Player participant Client as Client (Input) participant Item as ConduitProbeItem participant Server participant Handler as ConduitServerPayloadHandler rect rgba(230,240,255,0.6) note right of Client: Mode switch (Shift + Mouse Wheel) Player->>Client: Scroll + Shift Client->>Item: switchState(stack, player, sync=true) Item-->>Client: local PROBE_STATE update Client->>Server: send C2SSyncProbeStatePacket(state) Server->>Handler: handle(packet) Handler->>Server: update held item PROBE_STATE end ``` ```mermaid sequenceDiagram autonumber participant Player participant Item as ConduitProbeItem participant World participant Bundle as ConduitBundleBlockEntity rect rgba(240,255,240,0.6) note right of Bundle: Copy / Paste flow Player->>World: Use Probe on Conduit World->>Item: onItemUseFirst(ctx) alt COPY_PASTE + sneak-right-click Item->>Bundle: read face configs Item->>Item: store ProbeConfigData on stack Item-->>Player: show "copied" message else COPY_PASTE + normal use Item->>Item: read ProbeConfigData from stack Item->>Bundle: apply configs to matching conduits Bundle->>Bundle: mark shape re-eval Item-->>Player: show "pasted" message else PROBE Item-->>Player: show "probe not implemented" message end end ``` ## Estimated code review effort 🎯 3 (Moderate) | ⏱️ ~25 minutes ## Assessment against linked issues | Objective | Addressed | Explanation | | --- | --- | --- | | Copy & Paste Functionality [#810] | ✅ | | | Probing Functionality [#810] | ❌ | Probe mode contains only a "not implemented" response; no probing logic present. | | Mode switching: Shift‑Mouse Wheel or 'Y' [#810] | ❓ | Shift+Mouse Wheel implemented; no implementation for 'Y' key binding in this diff. | ## Possibly related PRs - Team-EnderIO/EnderIO#1124 — Overlaps changes to ConduitProbeItem copy/paste behaviour and per-conduit field persistence. - Team-EnderIO/EnderIO#1025 — Related to client initialization and item property registration for item model overrides. - Team-EnderIO/EnderIO#1066 — Related to network payload registration and server-side payload handling used here. ## Suggested reviewers - Rover656 ## Poem > I twitched my nose and turned the wheel, > I copied configs with a gentle feel, > Probe in paw, I hop and paste, > Bundles change with hurried haste, > 🐇✨ <!-- walkthrough_end --> <!-- This is an auto-generated comment: resource warnings by coderabbit.ai --> > [!WARNING] > ## Review ran into problems > > <details> > <summary>🔥 Problems</summary> > > Git: Failed to clone repository. Please run the `@coderabbitai full review` command to re-trigger a full review. If the issue persists, set `path_filters` to include or exclude specific files. > > </details> <!-- end of auto-generated comment: resource warnings by coderabbit.ai --> <!-- internal state start --> <!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKPR1AGxJcr+CrkgAYXwMWmx1awpBEkgCSABGDQAmRPjISAMAOUcBSi54+KSANkhAFAJIAFUbABkuWFxcbkQOAHoWonVYbAENJmYW6BI0ZjAAUVDKAEkAeRbxpQoZlu5sDw8WguL0gwrEPMhmfD3EWWx4gAYkgA4yyABlfGwKBhjAJMIYZ1JOSCUJDeTUpB3r9/ikNGkMndcNRsM1+NwyLdAhQhjRaFwkpcAKxgc5XMDXaDxAAsHHiRQ4SSxAC1ttUVCQPHDoLIEWMMLBMC82BhcAAaSAAQRRaDAwVC4VwiAFAFlAmBEmD4kYACLSBgUeDccQhSAACgAZmgxMgDVFmNYbABKDgGKBWJ7cI7eax+AJMCURXjRSBmlg/Eh/RXncGxfABoMA8EaIIeZ3IJAOaSQMxXC7oUIpzYAdg0dsgkwwDA82CUyFwsBRMUQGpIZEQsHwAWo0IYsB5UrzUEmzG4Xg7dBQWArqFstvSUGC3FkyzQiBovuwRZ1GDQHnU8gNfgUnvdIXIYngIUQeYnQU5uBaBHwHnE3EgcaIyAb+AA7vAMERIK+L5AiE2FG4eA6FPXQgn3UQVx+ag0EA2QPy/eBe37dhB1hBD0HA3tHlCaA0CIMABDnQc0G4b1jVgfUP1wKIwheegwk1T9IBRCRgNfH4kAYWFECPDArS7SBMgApC+xIAd6A/WIEGQMcDDPKwolyRdlz4tcN31LwDQCLc+Fgg08CeGI20wUgBPzaBphVaZGFgUQAGt13nccwKnGduDnBdMHoEzL2vW8tQffAnwOZx7MHWgQhIUD7SUmIDNUkJ1NweQUWYb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aAc1rENLd1t2Ig75NoiPECuBLWSAbNj61iDSCC2oAkN8a3DfjS7XVAWISa++nGty3ibJAeIP1doDZhswYtq4MSCuACADQud1G3rdTuMB3b8QZG/1ezA03i7LwA0ANaKBKBJrA19m0UBrt2VJrdiYO+NbrsxBurDVqzE1ZattXLNHV8TPjaAA= --> <!-- internal state end --> <!-- finishing_touch_checkbox_start --> <details> <summary>✨ Finishing Touches</summary> - [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings <details> <summary>🧪 Generate unit tests</summary> - [ ] <!-- {"checkboxId": "f47ac10b-58cc-4372-a567-0e02b2c3d479", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Create PR with unit tests - [ ] <!-- {"checkboxId": "07f1e7d6-8a8e-4e23-9900-8731c2c87f58", "radioGroupId": "utg-output-choice-group-unknown_comment_id"} --> Post copyable unit tests in a comment </details> </details> <!-- finishing_touch_checkbox_end --> <!-- tips_start --> --- 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. <details> <summary>❤️ Share</summary> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </details> <sub>Comment `@coderabbitai help` to get the list of available commands and usage tips.</sub> <!-- tips_end -->
mosesyu1028 commented 2025-08-29 07:51:07 +00:00 (Migrated from github.com)

@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 extractRedstoneControl and extractRedstoneChannel into RedstoneSensitiveConnectionConfig. I see that every IOConnectionConfig except for redstone conduit already implements RedstoneSensitiveConnectionConfig, so this seems like it's the desired behavior?

@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 `extractRedstoneControl` and `extractRedstoneChannel` into `RedstoneSensitiveConnectionConfig`. I see that every `IOConnectionConfig` except for redstone conduit already implements `RedstoneSensitiveConnectionConfig`, so this seems like it's the desired behavior?
Rover656 commented 2025-08-29 09:00:04 +00:00 (Migrated from github.com)

@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 extractRedstoneControl and extractRedstoneChannel into RedstoneSensitiveConnectionConfig. I see that every IOConnectionConfig except for redstone conduit already implements RedstoneSensitiveConnectionConfig, 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.

> @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 `extractRedstoneControl` and `extractRedstoneChannel` into `RedstoneSensitiveConnectionConfig`. I see that every `IOConnectionConfig` except for redstone conduit already implements `RedstoneSensitiveConnectionConfig`, 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.
mosesyu1028 commented 2025-08-29 09:23:16 +00:00 (Migrated from github.com)

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.

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.
Rover656 commented 2025-08-29 09:29:18 +00:00 (Migrated from github.com)

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

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
mosesyu1028 commented 2025-08-29 14:45:47 +00:00 (Migrated from github.com)

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

> 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
mosesyu1028 commented 2025-09-01 13:33:14 +00:00 (Migrated from github.com)

@coderabbitai review

@coderabbitai review
coderabbitai[bot] commented 2025-09-01 13:33:19 +00:00 (Migrated from github.com)
Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

<!-- This is an auto-generated reply by CodeRabbit --> <details> <summary>✅ Actions performed</summary> Review triggered. > Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused. </details>
coderabbitai[bot] (Migrated from github.com) reviewed 2025-09-01 13:41:09 +00:00
coderabbitai[bot] (Migrated from github.com) left a comment

Actionable comments posted: 3

🧹 Nitpick comments (13)
enderio-conduits/src/main/java/com/enderio/conduits/common/items/package-info.java (1)

1-4: LGTM; consider adding FieldsAreNonnullByDefault for completeness.

Optional: add @net.minecraft.FieldsAreNonnullByDefault to align with the other package-level nullness defaults and reduce annotations noise in this package.

Example:

 @javax.annotation.ParametersAreNonnullByDefault
 @net.minecraft.MethodsReturnNonnullByDefault
+@net.minecraft.FieldsAreNonnullByDefault

 package com.enderio.conduits.common.items;
enderio-conduits/src/main/java/com/enderio/conduits/common/conduit/bundle/ConduitBlockEvent.java (2)

14-14: Remove unused import.

TriState isn’t referenced directly; drop the import to avoid warnings.

-import net.neoforged.neoforge.common.util.TriState;

33-34: Minor: use the existing pos variable for consistency.

You get pos from the event; you can also use it for getBlockState(...) to keep things uniform.

enderio-conduits/src/main/java/com/enderio/conduits/client/ConduitClientSetup.java (1)

60-67: Item property registration looks correct; minor constant extraction would tidy usage

Good use of enqueueWork and the 4-arg getter. Consider extracting the ResourceLocation to a static constant to avoid repeating the literal elsewhere.

Apply within this hunk:

-            ItemProperties.register(ConduitItems.CONDUIT_PROBE.get(), EnderIO.loc("probe_state"),
+            ItemProperties.register(ConduitItems.CONDUIT_PROBE.get(), PROBE_STATE,
                 (stack, level, player, seed) -> {
                     ConduitProbeItem.State state = ConduitProbeItem.getState(stack);
                     return state == ConduitProbeItem.State.COPY_PASTE ? 1.0f : 0.0f;
                 });

And add outside this hunk:

// imports:
import net.minecraft.resources.ResourceLocation;

// near other constants:
private static final ResourceLocation PROBE_STATE = EnderIO.loc("probe_state");
enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitItems.java (1)

108-112: Set an explicit default probe state on the item to avoid null-state edge cases

If PROBE_STATE has no default in its DataComponentType, initialise it here to ensure stable client predicates and tooltips.

-    public static final RegiliteItem<ConduitProbeItem> CONDUIT_PROBE = ITEM_REGISTRY
-        .registerItem("conduit_probe", props -> new ConduitProbeItem(props.stacksTo(1)))
+    public static final RegiliteItem<ConduitProbeItem> CONDUIT_PROBE = ITEM_REGISTRY
+        .registerItem("conduit_probe", props -> new ConduitProbeItem(
+            props.stacksTo(1).component(ConduitComponents.PROBE_STATE, ConduitProbeItem.State.PROBE)))
         .setModelProvider((prov, ctx) -> {})
         .setTab(EIOCreativeTabs.CONDUITS);

Add imports outside the hunk if needed:

import com.enderio.conduits.common.init.ConduitComponents;
enderio-conduits/src/main/java/com/enderio/conduits/common/network/ConduitServerPayloadHandler.java (1)

90-103: Simplify duplicate hand checks; functionally identical

Minor dedup for readability; behaviour unchanged.

-            ItemStack heldMainHand = context.player().getMainHandItem();
-            ItemStack heldOffHand = context.player().getOffhandItem();
-            
-            // Update the state on whichever hand has the probe item
-            if (heldMainHand.getItem() instanceof ConduitProbeItem) {
-                heldMainHand.set(ConduitComponents.PROBE_STATE, packet.state());
-            }
-            if (heldOffHand.getItem() instanceof ConduitProbeItem) {
-                heldOffHand.set(ConduitComponents.PROBE_STATE, packet.state());
-            }
+            ItemStack heldMainHand = context.player().getMainHandItem();
+            ItemStack heldOffHand = context.player().getOffhandItem();
+            for (ItemStack stack : new ItemStack[] { heldMainHand, heldOffHand }) {
+                if (stack.getItem() instanceof ConduitProbeItem) {
+                    stack.set(ConduitComponents.PROBE_STATE, packet.state());
+                }
+            }
enderio-conduits/src/main/java/com/enderio/conduits/data/recipe/ConduitRecipes.java (1)

180-190: Give the probe recipe an explicit id for consistency and to avoid potential collisions

Most recipes in this class supply an explicit id; do the same here.

-        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ConduitItems.CONDUIT_PROBE)
+        ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ConduitItems.CONDUIT_PROBE)
                 .pattern("ARA")
                 .pattern("PCP")
                 .pattern("RIR")
                 .define('P', Tags.Items.GLASS_BLOCKS)
                 .define('I', ConduitIngredient.of(itemConduit))
                 .define('A', EIOTags.Items.INGOTS_CONDUCTIVE_ALLOY)
                 .define('C', Items.COMPARATOR)
                 .define('R', ConduitIngredient.of(redstoneConduit))
                 .unlockedBy("has_ingredient", InventoryChangeTrigger.TriggerInstance.hasItems(EIOItems.CONDUIT_BINDER))
-                .save(recipeOutput);
+                .save(recipeOutput, EnderIO.loc("conduit_probe"));
enderio-conduits/src/main/java/com/enderio/conduits/client/input/InputEventListener.java (1)

49-51: Remove unused locals in Key handler placeholder

These allocations do nothing and run every key event.

-        ItemStack heldMainHand = player.getMainHandItem();
-        ItemStack heldOffHand = player.getOffhandItem();
+        // No-op placeholder; avoid work until a keybinding is implemented.
enderio-conduits/src/main/java/com/enderio/conduits/common/network/C2SSyncProbeStatePacket.java (1)

9-23: Consider including the hand/slot to avoid ambiguous server updates

The packet only carries the state. If the server handler updates both hands, client UX can desync with intent (especially if future logic diverges per-hand). Include InteractionHand (or slot index) to target the correct stack.

Example change:

-import net.minecraft.network.RegistryFriendlyByteBuf;
+import net.minecraft.network.RegistryFriendlyByteBuf;
+import net.minecraft.world.InteractionHand;
 import net.minecraft.network.codec.StreamCodec;
@@
-public record C2SSyncProbeStatePacket(ConduitProbeItem.State state) implements CustomPacketPayload {
+public record C2SSyncProbeStatePacket(ConduitProbeItem.State state, InteractionHand hand) implements CustomPacketPayload {
@@
-    public static final StreamCodec<RegistryFriendlyByteBuf, C2SSyncProbeStatePacket> STREAM_CODEC = StreamCodec.composite(
-        ConduitProbeItem.State.STREAM_CODEC,
-        C2SSyncProbeStatePacket::state,
-        C2SSyncProbeStatePacket::new
-    );
+    public static final StreamCodec<RegistryFriendlyByteBuf, C2SSyncProbeStatePacket> STREAM_CODEC = StreamCodec.composite(
+        ConduitProbeItem.State.STREAM_CODEC, C2SSyncProbeStatePacket::state,
+        net.minecraft.network.codec.ByteBufCodecs.VAR_INT.map(i -> InteractionHand.values()[i], InteractionHand::ordinal),
+        C2SSyncProbeStatePacket::hand,
+        C2SSyncProbeStatePacket::new);

Please confirm how ConduitServerPayloadHandler currently applies the state (main-hand only, off-hand only, or both).

enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (4)

48-66: Server-only logic placement looks fine; verify client return semantics

Early-returning SUCCESS on the client is common, but please confirm in NeoForge 21.1 that this does not suppress the corresponding server-side call for onItemUseFirst in this path. If unsure, prefer InteractionResult.sidedSuccess(level.isClientSide()) at the end of the handled branch.


71-105: Avoid reflective field dumps; use an explicit, stable representation

Using reflection to list all declared fields risks leaking internals and breaking across updates. Prefer:

  • A Probeable interface on ConnectionConfig (or a CompoundTag serialiser) that returns a curated map/Component list for display.
  • Or use the existing CODEC to produce a filtered, human-readable summary.

This also makes it mod-extensible.

Would you like a small ProbeableConnectionConfig sketch wired into handleCopy?


134-143: Prefer translatable Components over server-side getString()

Using getString() on the server may yield untranslated keys on dedicated servers. Build Components and let the client render them:

  • For the tooltip (client): fine either way.
  • For chat messages (server): send Component lists (e.g., ComponentUtils.formatList) rather than a joined String.

Example (pasted list):

var names = pastedConduits.stream()
    .map(ResourceLocation::parse)
    .map(this::conduitKeyToDisplayNameComponent)
    .toList();
var list = net.minecraft.util.CommonComponents.joinLines(names);
player.sendSystemMessage(TooltipUtil.withArgs(ConduitLang.CONDUIT_PROBE_MESSAGE_PASTED, list));

And change conduitKeyToDisplayName to return a Component.


156-161: User feedback spam when toggled twice

Once the scroll handler is fixed to single-hand, this will send one message. If you later add keybinding plus scroll, consider debouncing to avoid duplicate “switched mode” messages in the same tick.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 59402bfbcd and 881736f160.

Files ignored due to path filters (3)
  • enderio-conduits/src/generated/resources/assets/enderio/lang/en_us.json is excluded by !**/generated/**
  • enderio-conduits/src/generated/resources/data/enderio/advancement/recipes/misc/conduit_probe.json is excluded by !**/generated/**
  • enderio-conduits/src/generated/resources/data/enderio/recipe/conduit_probe.json is 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
Learnt from: mosesyu1028
PR: Team-EnderIO/EnderIO#1124
File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118
Timestamp: 2025-08-26T17:19:26.776Z
Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user.
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)
  • GitHub Check: Run Tests
  • GitHub Check: Analyze (java-kotlin)
🔇 Additional comments (10)
enderio-conduits/src/main/resources/assets/enderio/models/item/conduit_probe_copy.json (1)

1-6: Texture file verifiedconduit_probe_copy.png exists under src/main/resources/assets/enderio/textures/item, and all references to conduit_probe_copy in models and code align.

enderio-conduits/src/main/resources/assets/enderio/models/item/conduit_probe.json (1)

1-14: Approve state override wiring; texture and property registration verified

Confirmed conduit_probe_probe.png under assets and ItemProperties.register for probe_state in ConduitClientSetup.java.

enderio-conduits/src/main/java/com/enderio/conduits/common/network/ConduitNetwork.java (2)

41-42: Additive packet registration looks good.

Direction (client→server) and handler binding are consistent with the existing pattern.


41-42: Verified matching handler and packet codec presence. Confirmed that C2SSyncProbeStatePacket defines both TYPE and STREAM_CODEC, and that ConduitServerPayloadHandler implements handle(C2SSyncProbeStatePacket, IPayloadContext).

enderio-conduits/src/main/java/com/enderio/conduits/common/conduit/bundle/ConduitBlockEvent.java (1)

38-43: Correct early-return to avoid opening the GUI with tools.

Prevents accidental GUI opens when using wrench/facade/probe; behaviour matches player expectation.

enderio-conduits/src/main/java/com/enderio/conduits/client/ConduitClientSetup.java (2)

16-18: Imports align with usage

Added imports are necessary for the property registration; no issues.

Also applies to: 26-26


60-67: No action needed for model predicate key
The conduit_probe.json override uses "enderio:probe_state": 1, matching the registered property key.

enderio-conduits/src/main/java/com/enderio/conduits/data/recipe/ConduitRecipes.java (1)

161-169: Refactor-only rechain of builder is fine

Semantically identical; no issues.

enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitComponents.java (1)

90-99: LGTM: components are correctly registered and synchronised

PROBE_CONFIG and PROBE_STATE use persistent codecs and stream codecs as expected.

enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitLang.java (1)

97-111: LGTM: translations cover mode, state, and messages

Keys and phrasing look consistent with existing patterns.

**Actionable comments posted: 3** <details> <summary>🧹 Nitpick comments (13)</summary><blockquote> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/items/package-info.java (1)</summary><blockquote> `1-4`: **LGTM; consider adding FieldsAreNonnullByDefault for completeness.** Optional: add `@net.minecraft.FieldsAreNonnullByDefault` to align with the other package-level nullness defaults and reduce annotations noise in this package. Example: ```diff @javax.annotation.ParametersAreNonnullByDefault @net.minecraft.MethodsReturnNonnullByDefault +@net.minecraft.FieldsAreNonnullByDefault package com.enderio.conduits.common.items; ``` </blockquote></details> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/conduit/bundle/ConduitBlockEvent.java (2)</summary><blockquote> `14-14`: **Remove unused import.** `TriState` isn’t referenced directly; drop the import to avoid warnings. ```diff -import net.neoforged.neoforge.common.util.TriState; ``` --- `33-34`: **Minor: use the existing pos variable for consistency.** You get `pos` from the event; you can also use it for `getBlockState(...)` to keep things uniform. </blockquote></details> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/client/ConduitClientSetup.java (1)</summary><blockquote> `60-67`: **Item property registration looks correct; minor constant extraction would tidy usage** Good use of enqueueWork and the 4-arg getter. Consider extracting the ResourceLocation to a static constant to avoid repeating the literal elsewhere. Apply within this hunk: ```diff - ItemProperties.register(ConduitItems.CONDUIT_PROBE.get(), EnderIO.loc("probe_state"), + ItemProperties.register(ConduitItems.CONDUIT_PROBE.get(), PROBE_STATE, (stack, level, player, seed) -> { ConduitProbeItem.State state = ConduitProbeItem.getState(stack); return state == ConduitProbeItem.State.COPY_PASTE ? 1.0f : 0.0f; }); ``` And add outside this hunk: ```java // imports: import net.minecraft.resources.ResourceLocation; // near other constants: private static final ResourceLocation PROBE_STATE = EnderIO.loc("probe_state"); ``` </blockquote></details> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitItems.java (1)</summary><blockquote> `108-112`: **Set an explicit default probe state on the item to avoid null-state edge cases** If PROBE_STATE has no default in its DataComponentType, initialise it here to ensure stable client predicates and tooltips. ```diff - public static final RegiliteItem<ConduitProbeItem> CONDUIT_PROBE = ITEM_REGISTRY - .registerItem("conduit_probe", props -> new ConduitProbeItem(props.stacksTo(1))) + public static final RegiliteItem<ConduitProbeItem> CONDUIT_PROBE = ITEM_REGISTRY + .registerItem("conduit_probe", props -> new ConduitProbeItem( + props.stacksTo(1).component(ConduitComponents.PROBE_STATE, ConduitProbeItem.State.PROBE))) .setModelProvider((prov, ctx) -> {}) .setTab(EIOCreativeTabs.CONDUITS); ``` Add imports outside the hunk if needed: ```java import com.enderio.conduits.common.init.ConduitComponents; ``` </blockquote></details> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/network/ConduitServerPayloadHandler.java (1)</summary><blockquote> `90-103`: **Simplify duplicate hand checks; functionally identical** Minor dedup for readability; behaviour unchanged. ```diff - ItemStack heldMainHand = context.player().getMainHandItem(); - ItemStack heldOffHand = context.player().getOffhandItem(); - - // Update the state on whichever hand has the probe item - if (heldMainHand.getItem() instanceof ConduitProbeItem) { - heldMainHand.set(ConduitComponents.PROBE_STATE, packet.state()); - } - if (heldOffHand.getItem() instanceof ConduitProbeItem) { - heldOffHand.set(ConduitComponents.PROBE_STATE, packet.state()); - } + ItemStack heldMainHand = context.player().getMainHandItem(); + ItemStack heldOffHand = context.player().getOffhandItem(); + for (ItemStack stack : new ItemStack[] { heldMainHand, heldOffHand }) { + if (stack.getItem() instanceof ConduitProbeItem) { + stack.set(ConduitComponents.PROBE_STATE, packet.state()); + } + } ``` </blockquote></details> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/data/recipe/ConduitRecipes.java (1)</summary><blockquote> `180-190`: **Give the probe recipe an explicit id for consistency and to avoid potential collisions** Most recipes in this class supply an explicit id; do the same here. ```diff - ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ConduitItems.CONDUIT_PROBE) + ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ConduitItems.CONDUIT_PROBE) .pattern("ARA") .pattern("PCP") .pattern("RIR") .define('P', Tags.Items.GLASS_BLOCKS) .define('I', ConduitIngredient.of(itemConduit)) .define('A', EIOTags.Items.INGOTS_CONDUCTIVE_ALLOY) .define('C', Items.COMPARATOR) .define('R', ConduitIngredient.of(redstoneConduit)) .unlockedBy("has_ingredient", InventoryChangeTrigger.TriggerInstance.hasItems(EIOItems.CONDUIT_BINDER)) - .save(recipeOutput); + .save(recipeOutput, EnderIO.loc("conduit_probe")); ``` </blockquote></details> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/client/input/InputEventListener.java (1)</summary><blockquote> `49-51`: **Remove unused locals in Key handler placeholder** These allocations do nothing and run every key event. ```diff - ItemStack heldMainHand = player.getMainHandItem(); - ItemStack heldOffHand = player.getOffhandItem(); + // No-op placeholder; avoid work until a keybinding is implemented. ``` </blockquote></details> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/network/C2SSyncProbeStatePacket.java (1)</summary><blockquote> `9-23`: **Consider including the hand/slot to avoid ambiguous server updates** The packet only carries the state. If the server handler updates both hands, client UX can desync with intent (especially if future logic diverges per-hand). Include InteractionHand (or slot index) to target the correct stack. Example change: ```diff -import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.network.RegistryFriendlyByteBuf; +import net.minecraft.world.InteractionHand; import net.minecraft.network.codec.StreamCodec; @@ -public record C2SSyncProbeStatePacket(ConduitProbeItem.State state) implements CustomPacketPayload { +public record C2SSyncProbeStatePacket(ConduitProbeItem.State state, InteractionHand hand) implements CustomPacketPayload { @@ - public static final StreamCodec<RegistryFriendlyByteBuf, C2SSyncProbeStatePacket> STREAM_CODEC = StreamCodec.composite( - ConduitProbeItem.State.STREAM_CODEC, - C2SSyncProbeStatePacket::state, - C2SSyncProbeStatePacket::new - ); + public static final StreamCodec<RegistryFriendlyByteBuf, C2SSyncProbeStatePacket> STREAM_CODEC = StreamCodec.composite( + ConduitProbeItem.State.STREAM_CODEC, C2SSyncProbeStatePacket::state, + net.minecraft.network.codec.ByteBufCodecs.VAR_INT.map(i -> InteractionHand.values()[i], InteractionHand::ordinal), + C2SSyncProbeStatePacket::hand, + C2SSyncProbeStatePacket::new); ``` Please confirm how ConduitServerPayloadHandler currently applies the state (main-hand only, off-hand only, or both). </blockquote></details> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (4)</summary><blockquote> `48-66`: **Server-only logic placement looks fine; verify client return semantics** Early-returning SUCCESS on the client is common, but please confirm in NeoForge 21.1 that this does not suppress the corresponding server-side call for onItemUseFirst in this path. If unsure, prefer InteractionResult.sidedSuccess(level.isClientSide()) at the end of the handled branch. --- `71-105`: **Avoid reflective field dumps; use an explicit, stable representation** Using reflection to list all declared fields risks leaking internals and breaking across updates. Prefer: - A Probeable interface on ConnectionConfig (or a CompoundTag serialiser) that returns a curated map/Component list for display. - Or use the existing CODEC to produce a filtered, human-readable summary. This also makes it mod-extensible. Would you like a small ProbeableConnectionConfig sketch wired into handleCopy? --- `134-143`: **Prefer translatable Components over server-side getString()** Using getString() on the server may yield untranslated keys on dedicated servers. Build Components and let the client render them: - For the tooltip (client): fine either way. - For chat messages (server): send Component lists (e.g., ComponentUtils.formatList) rather than a joined String. Example (pasted list): ```java var names = pastedConduits.stream() .map(ResourceLocation::parse) .map(this::conduitKeyToDisplayNameComponent) .toList(); var list = net.minecraft.util.CommonComponents.joinLines(names); player.sendSystemMessage(TooltipUtil.withArgs(ConduitLang.CONDUIT_PROBE_MESSAGE_PASTED, list)); ``` And change conduitKeyToDisplayName to return a Component. --- `156-161`: **User feedback spam when toggled twice** Once the scroll handler is fixed to single-hand, this will send one message. If you later add keybinding plus scroll, consider debouncing to avoid duplicate “switched mode” messages in the same tick. </blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used**: CodeRabbit UI **Review profile**: CHILL **Plan**: Pro **💡 Knowledge Base configuration:** - MCP integration is disabled by default for public repositories - Jira integration is disabled by default for public repositories - Linear integration is disabled by default for public repositories You can enable these sources in your CodeRabbit configuration. <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 59402bfbcd83b08f2a7f9f05ea164d3f0639ee8f and 881736f160cc309b05fbb4f0fd3b9f2df81d16a6. </details> <details> <summary>⛔ Files ignored due to path filters (3)</summary> * `enderio-conduits/src/generated/resources/assets/enderio/lang/en_us.json` is excluded by `!**/generated/**` * `enderio-conduits/src/generated/resources/data/enderio/advancement/recipes/misc/conduit_probe.json` is excluded by `!**/generated/**` * `enderio-conduits/src/generated/resources/data/enderio/recipe/conduit_probe.json` is excluded by `!**/generated/**` </details> <details> <summary>📒 Files selected for processing (15)</summary> * `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) </details> <details> <summary>🧰 Additional context used</summary> <details> <summary>🧠 Learnings (1)</summary> <details> <summary>📓 Common learnings</summary> ``` Learnt from: mosesyu1028 PR: Team-EnderIO/EnderIO#1124 File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118 Timestamp: 2025-08-26T17:19:26.776Z Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user. ``` </details> </details> </details> <details> <summary>⏰ 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)</summary> * GitHub Check: Run Tests * GitHub Check: Analyze (java-kotlin) </details> <details> <summary>🔇 Additional comments (10)</summary><blockquote> <details> <summary>enderio-conduits/src/main/resources/assets/enderio/models/item/conduit_probe_copy.json (1)</summary><blockquote> `1-6`: **Texture file verified** – `conduit_probe_copy.png` exists under `src/main/resources/assets/enderio/textures/item`, and all references to `conduit_probe_copy` in models and code align. </blockquote></details> <details> <summary>enderio-conduits/src/main/resources/assets/enderio/models/item/conduit_probe.json (1)</summary><blockquote> `1-14`: **Approve state override wiring; texture and property registration verified** Confirmed conduit_probe_probe.png under assets and `ItemProperties.register` for `probe_state` in ConduitClientSetup.java. </blockquote></details> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/network/ConduitNetwork.java (2)</summary><blockquote> `41-42`: **Additive packet registration looks good.** Direction (client→server) and handler binding are consistent with the existing pattern. --- `41-42`: **Verified matching handler and packet codec presence.** Confirmed that `C2SSyncProbeStatePacket` defines both `TYPE` and `STREAM_CODEC`, and that `ConduitServerPayloadHandler` implements `handle(C2SSyncProbeStatePacket, IPayloadContext)`. </blockquote></details> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/conduit/bundle/ConduitBlockEvent.java (1)</summary><blockquote> `38-43`: **Correct early-return to avoid opening the GUI with tools.** Prevents accidental GUI opens when using wrench/facade/probe; behaviour matches player expectation. </blockquote></details> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/client/ConduitClientSetup.java (2)</summary><blockquote> `16-18`: **Imports align with usage** Added imports are necessary for the property registration; no issues. Also applies to: 26-26 --- `60-67`: **No action needed for model predicate key** The `conduit_probe.json` override uses `"enderio:probe_state": 1`, matching the registered property key. </blockquote></details> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/data/recipe/ConduitRecipes.java (1)</summary><blockquote> `161-169`: **Refactor-only rechain of builder is fine** Semantically identical; no issues. </blockquote></details> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitComponents.java (1)</summary><blockquote> `90-99`: **LGTM: components are correctly registered and synchronised** PROBE_CONFIG and PROBE_STATE use persistent codecs and stream codecs as expected. </blockquote></details> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitLang.java (1)</summary><blockquote> `97-111`: **LGTM: translations cover mode, state, and messages** Keys and phrasing look consistent with existing patterns. </blockquote></details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
coderabbitai[bot] (Migrated from github.com) commented 2025-09-01 13:41:08 +00:00

🛠️ 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.

-/**
- * Get the list of redstone signal colors that this connection is sensitive to.
- * This is exclusively used for conduit connection rendering.
- */
+/**
+ * Contract for conduit connection configs that support copy/paste via the Conduit Probe.
+ * Implementations must serialise only the user-configurable settings that are safe to transfer.
+ */
 public interface ProbeableConnectionConfig {
     /**
-     * @return the data in a conduit connection to be copied
+     * Serialise the copyable settings for this connection.
+     * @return a tag containing only the fields intended for copy/paste (may be empty, never null)
      */
     CompoundTag getProbeTag();
 
     /**
-     * @param tag the new data to set in a conduit connection
+     * Apply settings from the given tag. Implementations may mutate and return {@code this},
+     * or return a new config instance if they are immutable.
+     * Callers should treat the return value as the updated config.
+     * @param tag input data (unknown keys must be ignored; validate ranges)
+     * @return the updated config instance
      */
     ProbeableConnectionConfig fromProbeTag(CompoundTag tag);
 }

Optional: consider renaming fromProbeTag to applyProbeTag for intent clarity.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

/**
 * Contract for conduit connection configs that support copy/paste via the Conduit Probe.
 * Implementations must serialise only the user-configurable settings that are safe to transfer.
 */
public interface ProbeableConnectionConfig {
    /**
     * Serialise the copyable settings for this connection.
     * @return a tag containing only the fields intended for copy/paste (may be empty, never null)
     */
    CompoundTag getProbeTag();

    /**
     * Apply settings from the given tag. Implementations may mutate and return {@code this},
     * or return a new config instance if they are immutable.
     * Callers should treat the return value as the updated config.
     * @param tag input data (unknown keys must be ignored; validate ranges)
     * @return the updated config instance
     */
    ProbeableConnectionConfig fromProbeTag(CompoundTag tag);
}
🤖 Prompt for AI Agents
In
enderio-conduits/src/main/java/com/enderio/conduits/api/connection/config/ProbeableConnectionConfig.java
around lines 5 to 19, replace the incorrect class Javadoc about redstone colours
with a short description that this interface provides
serialization/deserialization of per-connection probe data via a CompoundTag
used for copy/paste or probing; update the method Javadocs so getProbeTag
clearly states it returns a defensive copy (or immutable snapshot) of this
connection's probe data suitable for serialization, and fromProbeTag explicitly
documents the contract you choose (preferred: it applies the provided tag to
mutate this instance and returns this for chaining) — if you prefer different
semantics (may return a new instance), state that instead; optionally rename
fromProbeTag to applyProbeTag if you want clearer intent, and keep the
code/public API consistent with the chosen contract.
_🛠️ 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. ```diff -/** - * Get the list of redstone signal colors that this connection is sensitive to. - * This is exclusively used for conduit connection rendering. - */ +/** + * Contract for conduit connection configs that support copy/paste via the Conduit Probe. + * Implementations must serialise only the user-configurable settings that are safe to transfer. + */ public interface ProbeableConnectionConfig { /** - * @return the data in a conduit connection to be copied + * Serialise the copyable settings for this connection. + * @return a tag containing only the fields intended for copy/paste (may be empty, never null) */ CompoundTag getProbeTag(); /** - * @param tag the new data to set in a conduit connection + * Apply settings from the given tag. Implementations may mutate and return {@code this}, + * or return a new config instance if they are immutable. + * Callers should treat the return value as the updated config. + * @param tag input data (unknown keys must be ignored; validate ranges) + * @return the updated config instance */ ProbeableConnectionConfig fromProbeTag(CompoundTag tag); } ``` Optional: consider renaming fromProbeTag to applyProbeTag for intent clarity. <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. ```suggestion /** * Contract for conduit connection configs that support copy/paste via the Conduit Probe. * Implementations must serialise only the user-configurable settings that are safe to transfer. */ public interface ProbeableConnectionConfig { /** * Serialise the copyable settings for this connection. * @return a tag containing only the fields intended for copy/paste (may be empty, never null) */ CompoundTag getProbeTag(); /** * Apply settings from the given tag. Implementations may mutate and return {@code this}, * or return a new config instance if they are immutable. * Callers should treat the return value as the updated config. * @param tag input data (unknown keys must be ignored; validate ranges) * @return the updated config instance */ ProbeableConnectionConfig fromProbeTag(CompoundTag tag); } ``` </details> <!-- suggestion_end --> <details> <summary>🤖 Prompt for AI Agents</summary> ``` In enderio-conduits/src/main/java/com/enderio/conduits/api/connection/config/ProbeableConnectionConfig.java around lines 5 to 19, replace the incorrect class Javadoc about redstone colours with a short description that this interface provides serialization/deserialization of per-connection probe data via a CompoundTag used for copy/paste or probing; update the method Javadocs so getProbeTag clearly states it returns a defensive copy (or immutable snapshot) of this connection's probe data suitable for serialization, and fromProbeTag explicitly documents the contract you choose (preferred: it applies the provided tag to mutate this instance and returns this for chaining) — if you prefer different semantics (may return a new instance), state that instead; optionally rename fromProbeTag to applyProbeTag if you want clearer intent, and keep the code/public API consistent with the chosen contract. ``` </details> <!-- fingerprinting:phantom:poseidon:chinchilla --> <!-- This is an auto-generated reply by CodeRabbit -->
@ -0,0 +1,40 @@
package com.enderio.conduits.client.input;
coderabbitai[bot] (Migrated from github.com) commented 2025-09-01 13:41:08 +00:00

🛠️ 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:

-        if (Math.abs(event.getScrollDeltaY()) > 0 && player.isShiftKeyDown()) {
-            boolean cancelScroll = false;
-            if (heldMainHand.getItem() instanceof ConduitProbeItem) {
-                ConduitProbeItem.switchState(heldMainHand, player, true);
-                cancelScroll = true;
-            }
-            if (heldOffHand.getItem() instanceof ConduitProbeItem) {
-                ConduitProbeItem.switchState(heldOffHand, player, true);
-                cancelScroll = true;
-            }
-            event.setCanceled(cancelScroll);
-        }
+        if (event.getScrollDeltaY() != 0 && player.isShiftKeyDown() && Minecraft.getInstance().screen == null) {
+            if (heldMainHand.getItem() instanceof ConduitProbeItem) {
+                ConduitProbeItem.switchState(heldMainHand, player, true);
+                event.setCanceled(true);
+            } else if (heldOffHand.getItem() instanceof ConduitProbeItem) {
+                ConduitProbeItem.switchState(heldOffHand, player, true);
+                event.setCanceled(true);
+            }
+        }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

        // Only toggle when scrolling (up or down), while sneaking, and no GUI is open
        if (event.getScrollDeltaY() != 0 && player.isShiftKeyDown() && Minecraft.getInstance().screen == null) {
            if (heldMainHand.getItem() instanceof ConduitProbeItem) {
                ConduitProbeItem.switchState(heldMainHand, player, true);
                event.setCanceled(true);
            } else if (heldOffHand.getItem() instanceof ConduitProbeItem) {
                ConduitProbeItem.switchState(heldOffHand, player, true);
                event.setCanceled(true);
            }
        }
🤖 Prompt for AI Agents
In
enderio-conduits/src/main/java/com/enderio/conduits/client/input/InputEventListener.java
around lines 28-39, the current scroll handling toggles the probe twice if it is
held in both hands and also fires while a GUI/screen is open; change the logic
to first ignore the event if a screen is open (screen != null) or player is
null, then detect if either hand holds a ConduitProbeItem but only perform a
single toggle (prefer the main hand when both hold the item) and set
event.setCanceled(true) when a toggle occurred; this prevents double-toggle and
avoids mode changes while GUIs are open.

Addressed in commit dd73ab3

_🛠️ 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: ```diff - if (Math.abs(event.getScrollDeltaY()) > 0 && player.isShiftKeyDown()) { - boolean cancelScroll = false; - if (heldMainHand.getItem() instanceof ConduitProbeItem) { - ConduitProbeItem.switchState(heldMainHand, player, true); - cancelScroll = true; - } - if (heldOffHand.getItem() instanceof ConduitProbeItem) { - ConduitProbeItem.switchState(heldOffHand, player, true); - cancelScroll = true; - } - event.setCanceled(cancelScroll); - } + if (event.getScrollDeltaY() != 0 && player.isShiftKeyDown() && Minecraft.getInstance().screen == null) { + if (heldMainHand.getItem() instanceof ConduitProbeItem) { + ConduitProbeItem.switchState(heldMainHand, player, true); + event.setCanceled(true); + } else if (heldOffHand.getItem() instanceof ConduitProbeItem) { + ConduitProbeItem.switchState(heldOffHand, player, true); + event.setCanceled(true); + } + } ``` <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. ```suggestion // Only toggle when scrolling (up or down), while sneaking, and no GUI is open if (event.getScrollDeltaY() != 0 && player.isShiftKeyDown() && Minecraft.getInstance().screen == null) { if (heldMainHand.getItem() instanceof ConduitProbeItem) { ConduitProbeItem.switchState(heldMainHand, player, true); event.setCanceled(true); } else if (heldOffHand.getItem() instanceof ConduitProbeItem) { ConduitProbeItem.switchState(heldOffHand, player, true); event.setCanceled(true); } } ``` </details> <!-- suggestion_end --> <details> <summary>🤖 Prompt for AI Agents</summary> ``` In enderio-conduits/src/main/java/com/enderio/conduits/client/input/InputEventListener.java around lines 28-39, the current scroll handling toggles the probe twice if it is held in both hands and also fires while a GUI/screen is open; change the logic to first ignore the event if a screen is open (screen != null) or player is null, then detect if either hand holds a ConduitProbeItem but only perform a single toggle (prefer the main hand when both hold the item) and set event.setCanceled(true) when a toggle occurred; this prevents double-toggle and avoids mode changes while GUIs are open. ``` </details> <!-- fingerprinting:phantom:poseidon:chinchilla --> <!-- This is an auto-generated reply by CodeRabbit --> ✅ Addressed in commit dd73ab3 <!-- This is an auto-generated comment by CodeRabbit -->
@ -0,0 +1,232 @@
package com.enderio.conduits.common.items;
coderabbitai[bot] (Migrated from github.com) commented 2025-09-01 13:41:08 +00:00

🛠️ 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):

var ops = com.mojang.serialization.RegistryOps.create(net.minecraft.nbt.NbtOps.INSTANCE, conduitBlock.getLevel().registryAccess());
var nbt = ConnectionConfig.GENERIC_CODEC.encodeStart(ops, storedConfig).getOrThrow();
var cloned = ConnectionConfig.GENERIC_CODEC.parse(ops, nbt).getOrThrow();
conduitBlock.setConnectionConfig(conduit, face, cloned);
🤖 Prompt for AI Agents
In
enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java
around lines 107 to 128, the code currently reuses the stored ConnectionConfig
instances when pasting which can create shared mutable state; before calling
conduitBlock.setConnectionConfig(conduit, face, storedConfig) create a defensive
deep copy of storedConfig and pass the clone instead. Fix by either invoking an
existing copy()/clone() API on ConnectionConfig if available, or do a CODEC
round-trip using RegistryOps.create(..., NbtOps.INSTANCE) to encode storedConfig
to NBT and then parse it back to get a fresh instance; ensure necessary imports
and exception handling for the codec operations and then call
setConnectionConfig with the cloned config.

Addressed in commit d13ab88

_🛠️ 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): ```java var ops = com.mojang.serialization.RegistryOps.create(net.minecraft.nbt.NbtOps.INSTANCE, conduitBlock.getLevel().registryAccess()); var nbt = ConnectionConfig.GENERIC_CODEC.encodeStart(ops, storedConfig).getOrThrow(); var cloned = ConnectionConfig.GENERIC_CODEC.parse(ops, nbt).getOrThrow(); conduitBlock.setConnectionConfig(conduit, face, cloned); ``` <details> <summary>🤖 Prompt for AI Agents</summary> ``` In enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java around lines 107 to 128, the code currently reuses the stored ConnectionConfig instances when pasting which can create shared mutable state; before calling conduitBlock.setConnectionConfig(conduit, face, storedConfig) create a defensive deep copy of storedConfig and pass the clone instead. Fix by either invoking an existing copy()/clone() API on ConnectionConfig if available, or do a CODEC round-trip using RegistryOps.create(..., NbtOps.INSTANCE) to encode storedConfig to NBT and then parse it back to get a fresh instance; ensure necessary imports and exception handling for the codec operations and then call setConnectionConfig with the cloned config. ``` </details> <!-- fingerprinting:phantom:poseidon:chinchilla --> <!-- This is an auto-generated reply by CodeRabbit --> ✅ Addressed in commit d13ab88 <!-- This is an auto-generated comment by CodeRabbit -->
mosesyu1028 (Migrated from github.com) reviewed 2025-09-01 18:22:35 +00:00
@ -0,0 +1,40 @@
package com.enderio.conduits.client.input;
mosesyu1028 (Migrated from github.com) commented 2025-09-01 18:22:35 +00:00

tested, no problem with conduit probe in each hand and scroll doesn't fire when in a gui

tested, no problem with conduit probe in each hand and scroll doesn't fire when in a gui
coderabbitai[bot] (Migrated from github.com) reviewed 2025-09-01 18:22:57 +00:00
@ -0,0 +1,40 @@
package com.enderio.conduits.client.input;
coderabbitai[bot] (Migrated from github.com) commented 2025-09-01 18:22:57 +00:00

@mosesyu1028 Good, the fix prevents both issues as intended.


🧠 Learnings used
Learnt from: mosesyu1028
PR: Team-EnderIO/EnderIO#1124
File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118
Timestamp: 2025-08-26T17:19:26.776Z
Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user.

If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

@mosesyu1028 Good, the fix prevents both issues as intended. --- <details> <summary>🧠 Learnings used</summary> ``` Learnt from: mosesyu1028 PR: Team-EnderIO/EnderIO#1124 File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118 Timestamp: 2025-08-26T17:19:26.776Z Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user. ``` </details> --- <!-- This is an auto-generated comment: tweet message by coderabbit.ai --> If you found this review helpful, would you consider giving us a shout-out on [X](https://twitter.com/intent/tweet?related=CodeRabbitAI&text=Refined%20scroll%20toggle%3A%20prevents%20double-toggle%20when%20probe%20in%20both%20hands%20and%20ignores%20scrolls%20while%20GUIs%20open.%20Prefers%20main%20hand%2C%20cancels%20event%20on%20toggle.%20Smart%20fix%20%E2%80%94%20try%20%40coderabbitai%20%F0%9F%9A%80%F0%9F%9B%A0%EF%B8%8F&url=https%3A%2F%2Fgithub.com%2FTeam-EnderIO%2FEnderIO%2Fpull%2F1126%23discussion_r2313998878)? Thank you for using CodeRabbit! <!-- end of auto-generated comment: tweet message by coderabbit.ai --> <!-- This is an auto-generated reply by CodeRabbit -->
mosesyu1028 (Migrated from github.com) reviewed 2025-09-01 18:23:00 +00:00
mosesyu1028 (Migrated from github.com) commented 2025-09-01 18:23:00 +00:00

fixed, removed unused file

fixed, removed unused file
coderabbitai[bot] (Migrated from github.com) reviewed 2025-09-01 18:23:19 +00:00
coderabbitai[bot] (Migrated from github.com) commented 2025-09-01 18:23:19 +00:00

@mosesyu1028 Good, the Javadoc correction and cleanup are complete.


🧠 Learnings used
Learnt from: mosesyu1028
PR: Team-EnderIO/EnderIO#1124
File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118
Timestamp: 2025-08-26T17:19:26.776Z
Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user.

If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

@mosesyu1028 Good, the Javadoc correction and cleanup are complete. --- <details> <summary>🧠 Learnings used</summary> ``` Learnt from: mosesyu1028 PR: Team-EnderIO/EnderIO#1124 File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118 Timestamp: 2025-08-26T17:19:26.776Z Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user. ``` </details> --- <!-- This is an auto-generated comment: tweet message by coderabbit.ai --> If you found this review helpful, would you consider giving us a shout-out on [X](https://twitter.com/intent/tweet?related=CodeRabbitAI&text=%40coderabbitai%20flagged%20misleading%20Javadoc%20and%20tightened%20ProbeableConnectionConfig%20copy%2Fpaste%20contract%3A%20getProbeTag%20%3D%20defensive%20snapshot%2C%20fromProbeTag%2FapplyProbeTag%20clarifies%20mutate%20vs%20new-instance%20return%20for%20safer%20API.%20Try%20%40coderabbitai%20%F0%9F%9B%A0%EF%B8%8F&url=https%3A%2F%2Fgithub.com%2FTeam-EnderIO%2FEnderIO%2Fpull%2F1126%23discussion_r2313998868)? Thank you for using CodeRabbit! <!-- end of auto-generated comment: tweet message by coderabbit.ai --> <!-- This is an auto-generated reply by CodeRabbit -->
mosesyu1028 commented 2025-09-01 18:24:04 +00:00 (Migrated from github.com)

@coderabbit review

@coderabbit review
coderabbitai[bot] commented 2025-09-01 18:24:11 +00:00 (Migrated from github.com)
Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

<!-- This is an auto-generated reply by CodeRabbit --> <details> <summary>✅ Actions performed</summary> Review triggered. > Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused. </details>
coderabbitai[bot] (Migrated from github.com) reviewed 2025-09-01 18:29:13 +00:00
coderabbitai[bot] (Migrated from github.com) left a comment

Actionable comments posted: 0

♻️ Duplicate comments (1)
enderio-conduits/src/main/java/com/enderio/conduits/client/input/InputEventListener.java (1)

28-39: Prevent double-toggle and ignore scroll while a screen is open

Toggle only one hand (prefer main-hand) and gate on screen == null to avoid flipping in GUIs. Also simplify the delta check.

-        if (Math.abs(event.getScrollDeltaY()) > 0 && player.isShiftKeyDown()) {
-            boolean cancelScroll = false;
-            if (heldMainHand.getItem() instanceof ConduitProbeItem) {
-                ConduitProbeItem.switchState(heldMainHand, player, true);
-                cancelScroll = true;
-            }
-            if (heldOffHand.getItem() instanceof ConduitProbeItem) {
-                ConduitProbeItem.switchState(heldOffHand, player, true);
-                cancelScroll = true;
-            }
-            event.setCanceled(cancelScroll);
-        }
+        if (event.getScrollDeltaY() != 0 && player.isShiftKeyDown() && Minecraft.getInstance().screen == null) {
+            if (heldMainHand.getItem() instanceof ConduitProbeItem) {
+                ConduitProbeItem.switchState(heldMainHand, player, true);
+                event.setCanceled(true);
+            } else if (heldOffHand.getItem() instanceof ConduitProbeItem) {
+                ConduitProbeItem.switchState(heldOffHand, player, true);
+                event.setCanceled(true);
+            }
+        }
🧹 Nitpick comments (5)
enderio-conduits/src/main/java/com/enderio/conduits/client/input/InputEventListener.java (3)

16-16: Ensure subscription is on the Forge bus

Mouse input events are fired on the Forge bus. Add the bus parameter to avoid silent non-delivery if defaulting to the MOD bus in this NeoForge version.

-@EventBusSubscriber(modid = EnderIOConduits.MODULE_MOD_ID, value = Dist.CLIENT)
+@EventBusSubscriber(modid = EnderIOConduits.MODULE_MOD_ID, value = Dist.CLIENT, bus = EventBusSubscriber.Bus.FORGE)

19-19: Name the handler after the event

Minor clarity: rename to onMouseScroll.

-    public static void inputEvent(InputEvent.MouseScrollingEvent event) {
+    public static void onMouseScroll(InputEvent.MouseScrollingEvent event) {

4-4: Remove commented import or wire up the 'Y' key

Either delete the commented KeyBindings import or implement the key toggle handler in this (or a sibling) class to support the 'Y' control mentioned in scope.

enderio-conduits/src/main/java/com/enderio/conduits/data/recipe/ConduitRecipes.java (2)

383-383: Remove stray blank line before closing brace.

Tiny cleanup; keeps file endings consistent.

- 
 }

180-191: Conduit Probe recipe validated—assets and datagen recipe present

  • Item registration in ConduitItems.java, model JSON at assets/enderio/models/item/conduit_probe.json, and datagen recipe in ConduitRecipes.java confirmed; no static recipe JSON detected.
  • Category MISC is consistent with other recipes; change to TOOLS only if you prefer it under the tools tab.
  • Glass ingredient uses Tags.Items.GLASS_BLOCKS; switch to EIOTags.Items.CLEAR_GLASS to gate on clear glass if desired.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 881736f160 and dd73ab339b.

📒 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)
  • enderio-conduits/src/main/java/com/enderio/conduits/common/conduit/bundle/ConduitBlockEvent.java
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: mosesyu1028
PR: Team-EnderIO/EnderIO#1124
File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118
Timestamp: 2025-08-26T17:19:26.776Z
Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user.
🔇 Additional comments (2)
enderio-conduits/src/main/java/com/enderio/conduits/data/recipe/ConduitRecipes.java (2)

28-28: Import of NeoForge Tags is correct for glass tag usage.

Matches the new P mapping in the probe recipe. No issues.


160-169: Refactor to fluent builder is fine; semantics unchanged.

Output, pattern, ingredients, and unlock remain identical. Good to keep style consistent with earlier sections.

**Actionable comments posted: 0** <details> <summary>♻️ Duplicate comments (1)</summary><blockquote> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/client/input/InputEventListener.java (1)</summary><blockquote> `28-39`: **Prevent double-toggle and ignore scroll while a screen is open** Toggle only one hand (prefer main-hand) and gate on screen == null to avoid flipping in GUIs. Also simplify the delta check. ```diff - if (Math.abs(event.getScrollDeltaY()) > 0 && player.isShiftKeyDown()) { - boolean cancelScroll = false; - if (heldMainHand.getItem() instanceof ConduitProbeItem) { - ConduitProbeItem.switchState(heldMainHand, player, true); - cancelScroll = true; - } - if (heldOffHand.getItem() instanceof ConduitProbeItem) { - ConduitProbeItem.switchState(heldOffHand, player, true); - cancelScroll = true; - } - event.setCanceled(cancelScroll); - } + if (event.getScrollDeltaY() != 0 && player.isShiftKeyDown() && Minecraft.getInstance().screen == null) { + if (heldMainHand.getItem() instanceof ConduitProbeItem) { + ConduitProbeItem.switchState(heldMainHand, player, true); + event.setCanceled(true); + } else if (heldOffHand.getItem() instanceof ConduitProbeItem) { + ConduitProbeItem.switchState(heldOffHand, player, true); + event.setCanceled(true); + } + } ``` </blockquote></details> </blockquote></details> <details> <summary>🧹 Nitpick comments (5)</summary><blockquote> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/client/input/InputEventListener.java (3)</summary><blockquote> `16-16`: **Ensure subscription is on the Forge bus** Mouse input events are fired on the Forge bus. Add the bus parameter to avoid silent non-delivery if defaulting to the MOD bus in this NeoForge version. ```diff -@EventBusSubscriber(modid = EnderIOConduits.MODULE_MOD_ID, value = Dist.CLIENT) +@EventBusSubscriber(modid = EnderIOConduits.MODULE_MOD_ID, value = Dist.CLIENT, bus = EventBusSubscriber.Bus.FORGE) ``` --- `19-19`: **Name the handler after the event** Minor clarity: rename to onMouseScroll. ```diff - public static void inputEvent(InputEvent.MouseScrollingEvent event) { + public static void onMouseScroll(InputEvent.MouseScrollingEvent event) { ``` --- `4-4`: **Remove commented import or wire up the 'Y' key** Either delete the commented KeyBindings import or implement the key toggle handler in this (or a sibling) class to support the 'Y' control mentioned in scope. </blockquote></details> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/data/recipe/ConduitRecipes.java (2)</summary><blockquote> `383-383`: **Remove stray blank line before closing brace.** Tiny cleanup; keeps file endings consistent. ```diff - } ``` --- `180-191`: **Conduit Probe recipe validated—assets and datagen recipe present** - Item registration in ConduitItems.java, model JSON at assets/enderio/models/item/conduit_probe.json, and datagen recipe in ConduitRecipes.java confirmed; no static recipe JSON detected. - Category MISC is consistent with other recipes; change to TOOLS only if you prefer it under the tools tab. - Glass ingredient uses Tags.Items.GLASS_BLOCKS; switch to EIOTags.Items.CLEAR_GLASS to gate on clear glass if desired. </blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used**: CodeRabbit UI **Review profile**: CHILL **Plan**: Pro **💡 Knowledge Base configuration:** - MCP integration is disabled by default for public repositories - Jira integration is disabled by default for public repositories - Linear integration is disabled by default for public repositories You can enable these sources in your CodeRabbit configuration. <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 881736f160cc309b05fbb4f0fd3b9f2df81d16a6 and dd73ab339b0093acee7673fa0757f4f600e3f400. </details> <details> <summary>📒 Files selected for processing (3)</summary> * `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) </details> <details> <summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary> * enderio-conduits/src/main/java/com/enderio/conduits/common/conduit/bundle/ConduitBlockEvent.java </details> <details> <summary>🧰 Additional context used</summary> <details> <summary>🧠 Learnings (1)</summary> <details> <summary>📓 Common learnings</summary> ``` Learnt from: mosesyu1028 PR: Team-EnderIO/EnderIO#1124 File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118 Timestamp: 2025-08-26T17:19:26.776Z Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user. ``` </details> </details> </details> <details> <summary>🔇 Additional comments (2)</summary><blockquote> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/data/recipe/ConduitRecipes.java (2)</summary><blockquote> `28-28`: **Import of NeoForge Tags is correct for glass tag usage.** Matches the new `P` mapping in the probe recipe. No issues. --- `160-169`: **Refactor to fluent builder is fine; semantics unchanged.** Output, pattern, ingredients, and unlock remain identical. Good to keep style consistent with earlier sections. </blockquote></details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
mosesyu1028 (Migrated from github.com) reviewed 2025-09-01 18:38:03 +00:00
@ -0,0 +1,232 @@
package com.enderio.conduits.common.items;
mosesyu1028 (Migrated from github.com) commented 2025-09-01 18:38:02 +00:00

won't change, current implementation is similar to dev/1.20.1 with conduitBlock.handleConnectionStateUpdate()

won't change, current implementation is similar to dev/1.20.1 with `conduitBlock.handleConnectionStateUpdate()`
coderabbitai[bot] (Migrated from github.com) reviewed 2025-09-01 18:38:23 +00:00
@ -0,0 +1,232 @@
package com.enderio.conduits.common.items;
coderabbitai[bot] (Migrated from github.com) commented 2025-09-01 18:38:22 +00:00

@mosesyu1028 Understood, maintaining consistency with the existing dev/1.20.1 pattern makes sense.


🧠 Learnings used
Learnt from: mosesyu1028
PR: Team-EnderIO/EnderIO#1124
File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118
Timestamp: 2025-08-26T17:19:26.776Z
Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user.
@mosesyu1028 Understood, maintaining consistency with the existing dev/1.20.1 pattern makes sense. --- <details> <summary>🧠 Learnings used</summary> ``` Learnt from: mosesyu1028 PR: Team-EnderIO/EnderIO#1124 File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118 Timestamp: 2025-08-26T17:19:26.776Z Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user. ``` </details> <!-- This is an auto-generated reply by CodeRabbit -->
coderabbitai[bot] (Migrated from github.com) reviewed 2025-09-02 07:03:59 +00:00
coderabbitai[bot] (Migrated from github.com) left a comment

Actionable comments posted: 1

♻️ Duplicate comments (1)
enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (1)

107-120: Paste should deep-copy configs, not reuse instances
Reusing the same ConnectionConfig instance can couple multiple connections. Clone per paste (CODEC round-trip) before setConnectionConfig.

-            ConnectionConfig storedConfig = configData.conduitData().get(conduitKey);
-            if (storedConfig != null) {
-                conduitBlock.setConnectionConfig(conduit, face, storedConfig);
-                pastedConduits.add(conduitKeyToDisplayName(conduitKey));
-            }
+            ConnectionConfig storedConfig = configData.conduitData().get(conduitKey);
+            if (storedConfig != null) {
+                var ops = net.minecraft.resources.RegistryOps.create(net.minecraft.nbt.NbtOps.INSTANCE, conduitBlock.getLevel().registryAccess());
+                var nbt = ConnectionConfig.GENERIC_CODEC.encodeStart(ops, storedConfig).result();
+                nbt.flatMap(tag -> ConnectionConfig.GENERIC_CODEC.parse(ops, tag).result())
+                   .ifPresent(cloned -> {
+                       conduitBlock.setConnectionConfig(conduit, face, cloned);
+                       pastedConduits.add(conduitKeyToDisplayName(conduitKey));
+                   });
+            }
🧹 Nitpick comments (5)
enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (5)

59-61: Localise the “not implemented” message

Avoid hard-coded English. Route this via ConduitLang for i18n consistency.

- player.sendSystemMessage(Component.literal("This feature isn't implemented yet.").withStyle(ChatFormatting.RED));
+ // Add a key like CONDUIT_PROBE_MESSAGE_NOT_IMPLEMENTED in ConduitLang
+ player.sendSystemMessage(ConduitLang.CONDUIT_PROBE_MESSAGE_NOT_IMPLEMENTED.withStyle(ChatFormatting.RED));

90-101: Filter static/synthetic fields in reflection dump

The current dump may include static or synthetic members. Filter them to avoid noise and accidental leaking of internal constants.

-                for (var field : connectionConfig.getClass().getDeclaredFields()) {
-                    if (SKIP_FIELDS.contains(field.getName())) continue;
+                for (var field : connectionConfig.getClass().getDeclaredFields()) {
+                    if (java.lang.reflect.Modifier.isStatic(field.getModifiers()) || field.isSynthetic() || SKIP_FIELDS.contains(field.getName()))
+                        continue;
                     sb.append(" - " + field.getName() + ": ");

If you want deterministic output, consider sorting by field name.


111-111: Use diamond operator
Minor tidy-up.

-        List<String> pastedConduits = new ArrayList<String>();
+        List<String> pastedConduits = new ArrayList<>();

163-167: Fallback when translation is missing
If no translation exists, return the RL as a fallback rather than the raw translation key string.

-        return Component.translatable(translationKey).getString();
+        var trans = Component.translatable(translationKey);
+        var resolved = trans.getString();
+        return resolved.equals(translationKey) || resolved.isEmpty() ? conduitKey.toString() : resolved;

179-186: Prefer StringRepresentable for enum codecs
This avoids IllegalArgumentException on bad data and gives nicer error messages.

-        public static final Codec<State> CODEC = Codec.STRING.xmap(
-            State::valueOf,
-            State::name
-        );
+        // Make State implement net.minecraft.util.StringRepresentable and return getSerializedName()
+        public static final Codec<State> CODEC = net.minecraft.util.StringRepresentable.fromEnum(State::values);

Add getSerializedName() and optionally lower-case serialised names for stability.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between b54649345b and 2d121799cd.

📒 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
Learnt from: mosesyu1028
PR: Team-EnderIO/EnderIO#1124
File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118
Timestamp: 2025-08-26T17:19:26.821Z
Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user.
📚 Learning: 2025-08-26T17:19:26.821Z
Learnt from: mosesyu1028
PR: Team-EnderIO/EnderIO#1124
File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118
Timestamp: 2025-08-26T17:19:26.821Z
Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user.

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)
enderio-conduits/src/main/java/com/enderio/conduits/common/conduit/bundle/ConduitBundleBlockEntity.java (1)
  • ConduitBundleBlockEntity (85-1796)
enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitComponents.java (1)
  • ConduitComponents (21-103)
enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitLang.java (1)
  • ConduitLang (9-124)
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)
  • GitHub Check: Analyze (java-kotlin)
  • GitHub Check: Run Tests
🔇 Additional comments (3)
enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (3)

122-128: Double-check shape updates aren’t duplicated
setConnectionConfig() already triggers bundleChanged(); ensure updateShape() here doesn’t cause redundant recomputation or flicker.


149-154: Guard client-only sync calls
Ensure setState(..., syncToServer=true) is only invoked on the logical client; otherwise you’ll send a no-op C2S from the server.


189-202: LGTM: component codecs and stream codecs
Codec wiring for ProbeConfigData looks correct and matches ConduitComponents registration.

**Actionable comments posted: 1** <details> <summary>♻️ Duplicate comments (1)</summary><blockquote> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (1)</summary><blockquote> `107-120`: **Paste should deep-copy configs, not reuse instances** Reusing the same ConnectionConfig instance can couple multiple connections. Clone per paste (CODEC round-trip) before setConnectionConfig. ```diff - ConnectionConfig storedConfig = configData.conduitData().get(conduitKey); - if (storedConfig != null) { - conduitBlock.setConnectionConfig(conduit, face, storedConfig); - pastedConduits.add(conduitKeyToDisplayName(conduitKey)); - } + ConnectionConfig storedConfig = configData.conduitData().get(conduitKey); + if (storedConfig != null) { + var ops = net.minecraft.resources.RegistryOps.create(net.minecraft.nbt.NbtOps.INSTANCE, conduitBlock.getLevel().registryAccess()); + var nbt = ConnectionConfig.GENERIC_CODEC.encodeStart(ops, storedConfig).result(); + nbt.flatMap(tag -> ConnectionConfig.GENERIC_CODEC.parse(ops, tag).result()) + .ifPresent(cloned -> { + conduitBlock.setConnectionConfig(conduit, face, cloned); + pastedConduits.add(conduitKeyToDisplayName(conduitKey)); + }); + } ``` </blockquote></details> </blockquote></details> <details> <summary>🧹 Nitpick comments (5)</summary><blockquote> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (5)</summary><blockquote> `59-61`: **Localise the “not implemented” message** Avoid hard-coded English. Route this via ConduitLang for i18n consistency. ```diff - player.sendSystemMessage(Component.literal("This feature isn't implemented yet.").withStyle(ChatFormatting.RED)); + // Add a key like CONDUIT_PROBE_MESSAGE_NOT_IMPLEMENTED in ConduitLang + player.sendSystemMessage(ConduitLang.CONDUIT_PROBE_MESSAGE_NOT_IMPLEMENTED.withStyle(ChatFormatting.RED)); ``` --- `90-101`: **Filter static/synthetic fields in reflection dump** The current dump may include static or synthetic members. Filter them to avoid noise and accidental leaking of internal constants. ```diff - for (var field : connectionConfig.getClass().getDeclaredFields()) { - if (SKIP_FIELDS.contains(field.getName())) continue; + for (var field : connectionConfig.getClass().getDeclaredFields()) { + if (java.lang.reflect.Modifier.isStatic(field.getModifiers()) || field.isSynthetic() || SKIP_FIELDS.contains(field.getName())) + continue; sb.append(" - " + field.getName() + ": "); ``` If you want deterministic output, consider sorting by field name. --- `111-111`: **Use diamond operator** Minor tidy-up. ```diff - List<String> pastedConduits = new ArrayList<String>(); + List<String> pastedConduits = new ArrayList<>(); ``` --- `163-167`: **Fallback when translation is missing** If no translation exists, return the RL as a fallback rather than the raw translation key string. ```diff - return Component.translatable(translationKey).getString(); + var trans = Component.translatable(translationKey); + var resolved = trans.getString(); + return resolved.equals(translationKey) || resolved.isEmpty() ? conduitKey.toString() : resolved; ``` --- `179-186`: **Prefer StringRepresentable for enum codecs** This avoids IllegalArgumentException on bad data and gives nicer error messages. ```diff - public static final Codec<State> CODEC = Codec.STRING.xmap( - State::valueOf, - State::name - ); + // Make State implement net.minecraft.util.StringRepresentable and return getSerializedName() + public static final Codec<State> CODEC = net.minecraft.util.StringRepresentable.fromEnum(State::values); ``` Add getSerializedName() and optionally lower-case serialised names for stability. </blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used**: CodeRabbit UI **Review profile**: CHILL **Plan**: Pro **💡 Knowledge Base configuration:** - MCP integration is disabled by default for public repositories - Jira integration is disabled by default for public repositories - Linear integration is disabled by default for public repositories You can enable these sources in your CodeRabbit configuration. <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between b54649345bcc2a869ea8db6e1c58031eeaa5aca0 and 2d121799cdc1a5e8ac4ded03ad0796ba6be2a04b. </details> <details> <summary>📒 Files selected for processing (1)</summary> * `enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java` (1 hunks) </details> <details> <summary>🧰 Additional context used</summary> <details> <summary>🧠 Learnings (2)</summary> <details> <summary>📓 Common learnings</summary> ``` Learnt from: mosesyu1028 PR: Team-EnderIO/EnderIO#1124 File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118 Timestamp: 2025-08-26T17:19:26.821Z Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user. ``` </details> <details> <summary>📚 Learning: 2025-08-26T17:19:26.821Z</summary> ``` Learnt from: mosesyu1028 PR: Team-EnderIO/EnderIO#1124 File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118 Timestamp: 2025-08-26T17:19:26.821Z Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user. ``` **Applied to files:** - `enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java` </details> </details><details> <summary>🧬 Code graph analysis (1)</summary> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (3)</summary><blockquote> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/conduit/bundle/ConduitBundleBlockEntity.java (1)</summary> * `ConduitBundleBlockEntity` (85-1796) </details> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitComponents.java (1)</summary> * `ConduitComponents` (21-103) </details> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitLang.java (1)</summary> * `ConduitLang` (9-124) </details> </blockquote></details> </details> </details> <details> <summary>⏰ 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)</summary> * GitHub Check: Analyze (java-kotlin) * GitHub Check: Run Tests </details> <details> <summary>🔇 Additional comments (3)</summary><blockquote> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (3)</summary><blockquote> `122-128`: **Double-check shape updates aren’t duplicated** setConnectionConfig() already triggers bundleChanged(); ensure updateShape() here doesn’t cause redundant recomputation or flicker. --- `149-154`: **Guard client-only sync calls** Ensure setState(..., syncToServer=true) is only invoked on the logical client; otherwise you’ll send a no-op C2S from the server. --- `189-202`: **LGTM: component codecs and stream codecs** Codec wiring for ProbeConfigData looks correct and matches ConduitComponents registration. </blockquote></details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
@ -0,0 +1,232 @@
package com.enderio.conduits.common.items;
coderabbitai[bot] (Migrated from github.com) commented 2025-09-02 07:03:58 +00:00

🛠️ 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.

-            ConnectionConfig connectionConfig = conduitBlock.getConnectionConfig(conduit, face);
+            ConnectionConfig connectionConfig = conduitBlock.getConnectionConfig(conduit, face);
             if (connectionConfig != null) {
                 ResourceLocation conduitKey = ResourceLocation.parse(conduit.getRegisteredName());
-                configData.conduitData().put(conduitKey, connectionConfig);
+                var ops = net.minecraft.resources.RegistryOps.create(net.minecraft.nbt.NbtOps.INSTANCE, conduitBlock.getLevel().registryAccess());
+                var nbt = ConnectionConfig.GENERIC_CODEC.encodeStart(ops, connectionConfig).result();
+                nbt.flatMap(tag -> ConnectionConfig.GENERIC_CODEC.parse(ops, tag).result())
+                   .ifPresent(cloned -> configData.conduitData().put(conduitKey, cloned));
             }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

    private void handleCopy(ConduitBundleBlockEntity conduitBlock, Direction face, ItemStack itemStack, Player player) {
        ProbeConfigData configData = new ProbeConfigData(new HashMap<>());

        var conduits = conduitBlock.getConduits();
        conduits.forEach(conduit -> {
            ConnectionConfig connectionConfig = conduitBlock.getConnectionConfig(conduit, face);
            if (connectionConfig != null) {
                ResourceLocation conduitKey = ResourceLocation.parse(conduit.getRegisteredName());
                var ops = net.minecraft.resources.RegistryOps.create(
                    net.minecraft.nbt.NbtOps.INSTANCE,
                    conduitBlock.getLevel().registryAccess()
                );
                var nbt = ConnectionConfig.GENERIC_CODEC
                    .encodeStart(ops, connectionConfig)
                    .result();
                nbt.flatMap(tag -> ConnectionConfig.GENERIC_CODEC
                        .parse(ops, tag)
                        .result()
                )
                .ifPresent(cloned -> configData.conduitData().put(conduitKey, cloned));
            }
        });
        itemStack.set(ConduitComponents.PROBE_CONFIG, configData);
        if (!configData.conduitData().isEmpty()) {
            // …remaining logic…
        }
    }

Addressed in commit d13ab88

_🛠️ 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. ```diff - ConnectionConfig connectionConfig = conduitBlock.getConnectionConfig(conduit, face); + ConnectionConfig connectionConfig = conduitBlock.getConnectionConfig(conduit, face); if (connectionConfig != null) { ResourceLocation conduitKey = ResourceLocation.parse(conduit.getRegisteredName()); - configData.conduitData().put(conduitKey, connectionConfig); + var ops = net.minecraft.resources.RegistryOps.create(net.minecraft.nbt.NbtOps.INSTANCE, conduitBlock.getLevel().registryAccess()); + var nbt = ConnectionConfig.GENERIC_CODEC.encodeStart(ops, connectionConfig).result(); + nbt.flatMap(tag -> ConnectionConfig.GENERIC_CODEC.parse(ops, tag).result()) + .ifPresent(cloned -> configData.conduitData().put(conduitKey, cloned)); } ``` <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. ```suggestion private void handleCopy(ConduitBundleBlockEntity conduitBlock, Direction face, ItemStack itemStack, Player player) { ProbeConfigData configData = new ProbeConfigData(new HashMap<>()); var conduits = conduitBlock.getConduits(); conduits.forEach(conduit -> { ConnectionConfig connectionConfig = conduitBlock.getConnectionConfig(conduit, face); if (connectionConfig != null) { ResourceLocation conduitKey = ResourceLocation.parse(conduit.getRegisteredName()); var ops = net.minecraft.resources.RegistryOps.create( net.minecraft.nbt.NbtOps.INSTANCE, conduitBlock.getLevel().registryAccess() ); var nbt = ConnectionConfig.GENERIC_CODEC .encodeStart(ops, connectionConfig) .result(); nbt.flatMap(tag -> ConnectionConfig.GENERIC_CODEC .parse(ops, tag) .result() ) .ifPresent(cloned -> configData.conduitData().put(conduitKey, cloned)); } }); itemStack.set(ConduitComponents.PROBE_CONFIG, configData); if (!configData.conduitData().isEmpty()) { // …remaining logic… } } ``` </details> <!-- suggestion_end --> <!-- fingerprinting:phantom:medusa:chinchilla --> <!-- This is an auto-generated reply by CodeRabbit --> ✅ Addressed in commit d13ab88
mosesyu1028 (Migrated from github.com) reviewed 2025-09-02 07:59:59 +00:00
@ -0,0 +1,232 @@
package com.enderio.conduits.common.items;
mosesyu1028 (Migrated from github.com) commented 2025-09-02 07:59:59 +00:00

Fixed with d13ab887b but I'm not that sure if this should be done... please check in review?

Fixed with d13ab887b but I'm not that sure if this should be done... please check in review?
coderabbitai[bot] (Migrated from github.com) reviewed 2025-09-02 08:01:06 +00:00
@ -0,0 +1,232 @@
package com.enderio.conduits.common.items;
coderabbitai[bot] (Migrated from github.com) commented 2025-09-02 08:01:06 +00:00
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check the specific commit d13ab88 to see what was implemented
git show d13ab88887b --stat
echo "=== COMMIT DETAILS ==="
git show d13ab88887b

Length of output: 491


🏁 Script executed:

#!/bin/bash
# Check recent commits to find the fix
echo "=== RECENT COMMITS ==="
git log --oneline -10

echo -e "\n=== CURRENT BRANCH ==="
git branch --show-current

echo -e "\n=== CURRENT HANDLECOPY METHOD ==="
# Look at the current handleCopy method implementation
grep -A 20 "private void handleCopy" enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java

Length of output: 1563


🏁 Script executed:

#!/bin/bash
# Check how ConnectionConfig.GENERIC_CODEC is used elsewhere in the codebase
echo "=== CONNECTIONCONFIG.GENERIC_CODEC USAGE ==="
rg -n "GENERIC_CODEC" --type java -C2

echo -e "\n=== OTHER CONNECTIONCONFIG DEEP-COPY PATTERNS ==="
# Look for other places where ConnectionConfig might be copied or serialized
rg -n "ConnectionConfig.*copy\|ConnectionConfig.*clone\|ConnectionConfig.*serialize" --type java -C2

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_CODEC is the official codec used throughout the project for ConnectionConfig serialization. The same encode/decode pattern is used in ConduitBundleBlockEntity for persistence (lines 1359, 1437). Your implementation:

  1. Prevents shared mutable state - the original issue
  2. Follows existing patterns - same approach as bundle entity persistence
  3. Uses the correct API - GENERIC_CODEC is the standard codec for this type
  4. Handles registries properly - via RegistryOps

The 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
Learnt from: mosesyu1028
PR: Team-EnderIO/EnderIO#1124
File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118
Timestamp: 2025-08-26T17:19:26.821Z
Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user.
<details> <summary>🧩 Analysis chain</summary> 🏁 Script executed: ``` #!/bin/bash # Check the specific commit d13ab88 to see what was implemented git show d13ab88887b --stat echo "=== COMMIT DETAILS ===" git show d13ab88887b ``` Length of output: 491 --- 🏁 Script executed: ``` #!/bin/bash # Check recent commits to find the fix echo "=== RECENT COMMITS ===" git log --oneline -10 echo -e "\n=== CURRENT BRANCH ===" git branch --show-current echo -e "\n=== CURRENT HANDLECOPY METHOD ===" # Look at the current handleCopy method implementation grep -A 20 "private void handleCopy" enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java ``` Length of output: 1563 --- 🏁 Script executed: ``` #!/bin/bash # Check how ConnectionConfig.GENERIC_CODEC is used elsewhere in the codebase echo "=== CONNECTIONCONFIG.GENERIC_CODEC USAGE ===" rg -n "GENERIC_CODEC" --type java -C2 echo -e "\n=== OTHER CONNECTIONCONFIG DEEP-COPY PATTERNS ===" # Look for other places where ConnectionConfig might be copied or serialized rg -n "ConnectionConfig.*copy\|ConnectionConfig.*clone\|ConnectionConfig.*serialize" --type java -C2 ``` Length of output: 9605 --- </details> @mosesyu1028 The deep-copy implementation is **correct** and follows the established pattern in the codebase. Looking at the code, `ConnectionConfig.GENERIC_CODEC` is the official codec used throughout the project for ConnectionConfig serialization. The same encode/decode pattern is used in `ConduitBundleBlockEntity` for persistence (lines 1359, 1437). Your implementation: 1. **Prevents shared mutable state** - the original issue 2. **Follows existing patterns** - same approach as bundle entity persistence 3. **Uses the correct API** - `GENERIC_CODEC` is the standard codec for this type 4. **Handles registries properly** - via `RegistryOps` The 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. --- <details> <summary>🧠 Learnings used</summary> ``` Learnt from: mosesyu1028 PR: Team-EnderIO/EnderIO#1124 File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118 Timestamp: 2025-08-26T17:19:26.821Z Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user. ``` </details> <!-- This is an auto-generated reply by CodeRabbit -->
coderabbitai[bot] (Migrated from github.com) reviewed 2025-09-02 08:05:40 +00:00
coderabbitai[bot] (Migrated from github.com) left a comment

Actionable comments posted: 0

♻️ Duplicate comments (1)
enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (1)

118-131: Deep-copy on paste to avoid shared mutable config across tiles

Reusing the stored ConnectionConfig instance across multiple pastes can couple block-entities. Clone via CODEC before setConnectionConfig. This mirrors your copy path.

-        List<String> pastedConduits = new ArrayList<String>();
-        var conduits = conduitBlock.getConduits();
+        List<String> pastedConduits = new ArrayList<>();
+        var conduits = conduitBlock.getConduits();
+        var ops = net.minecraft.resources.RegistryOps.create(
+            net.minecraft.nbt.NbtOps.INSTANCE,
+            conduitBlock.getLevel().registryAccess()
+        );
         conduits.forEach(conduit -> {
             ResourceLocation conduitKey = ResourceLocation.parse(conduit.getRegisteredName());
             ConnectionConfig storedConfig = configData.conduitData().get(conduitKey);
             if (storedConfig != null) {
-                conduitBlock.setConnectionConfig(conduit, face, storedConfig);
-                pastedConduits.add(conduitKeyToDisplayName(conduitKey));
+                var nbt = ConnectionConfig.GENERIC_CODEC.encodeStart(ops, storedConfig).result();
+                nbt.flatMap(tag -> ConnectionConfig.GENERIC_CODEC.parse(ops, tag).result())
+                   .ifPresent(cloned -> {
+                       conduitBlock.setConnectionConfig(conduit, face, cloned);
+                       pastedConduits.add(conduitKeyToDisplayName(conduitKey));
+                   });
             }
         });
🧹 Nitpick comments (5)
enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (5)

59-61: Localise the “not implemented” message

Avoid hard-coded English; use ConduitLang so it’s translatable.

-                        player.sendSystemMessage(Component.literal("This feature isn't implemented yet.").withStyle(ChatFormatting.RED));
+                        player.sendSystemMessage(ConduitLang.CONDUIT_PROBE_MESSAGE_NOT_IMPLEMENTED.withStyle(ChatFormatting.RED));

Note: add CONDUIT_PROBE_MESSAGE_NOT_IMPLEMENTED to ConduitLang.


74-85: Create RegistryOps once, not per conduit

Minor perf/alloc win: move ops creation outside the loop.

-        var conduits = conduitBlock.getConduits();
-        conduits.forEach(conduit -> {
+        var conduits = conduitBlock.getConduits();
+        var ops = net.minecraft.resources.RegistryOps.create(
+            net.minecraft.nbt.NbtOps.INSTANCE,
+            conduitBlock.getLevel().registryAccess()
+        );
+        conduits.forEach(conduit -> {
             ConnectionConfig connectionConfig = conduitBlock.getConnectionConfig(conduit, face);
             if (connectionConfig != null) {
                 ResourceLocation conduitKey = ResourceLocation.parse(conduit.getRegisteredName());
-                var ops = net.minecraft.resources.RegistryOps.create(
-                    net.minecraft.nbt.NbtOps.INSTANCE,
-                    conduitBlock.getLevel().registryAccess()
-                );
                 var nbt = ConnectionConfig.GENERIC_CODEC
                     .encodeStart(ops, connectionConfig)
                     .result();

101-113: Filter out static fields and simplify append

Prevent static fields leaking into the debug dump; cleaner building of the line.

-                for (var field : connectionConfig.getClass().getDeclaredFields()) {
-                    if (SKIP_FIELDS.contains(field.getName())) continue;
-                    sb.append(" - " + field.getName() + ": ");
-                    try {
-                        field.setAccessible(true);
-                        Object value = field.get(connectionConfig);
-                        sb.append(value);
-                    } catch (IllegalAccessException e) {
-                        sb.append(": <unable to access>");
-                    }
-                    sb.append("\n");
-                }
+                for (var field : connectionConfig.getClass().getDeclaredFields()) {
+                    if (SKIP_FIELDS.contains(field.getName()) || java.lang.reflect.Modifier.isStatic(field.getModifiers())) continue;
+                    try {
+                        field.setAccessible(true);
+                        Object value = field.get(connectionConfig);
+                        sb.append(" - ").append(field.getName()).append(": ").append(String.valueOf(value)).append("\n");
+                    } catch (IllegalAccessException e) {
+                        sb.append(" - ").append(field.getName()).append(": <unable to access>\n");
+                    }
+                }

Add import (outside range):

import java.lang.reflect.Modifier;

78-79: Guard RL parsing to avoid crashes with invalid IDs

ResourceLocation.parse throws; tryParse is safer for third-party conduits.

-                ResourceLocation conduitKey = ResourceLocation.parse(conduit.getRegisteredName());
+                ResourceLocation conduitKey = ResourceLocation.tryParse(conduit.getRegisteredName());
+                if (conduitKey == null) return;
-            ResourceLocation conduitKey = ResourceLocation.parse(conduit.getRegisteredName());
+            ResourceLocation conduitKey = ResourceLocation.tryParse(conduit.getRegisteredName());
+            if (conduitKey == null) return;

Also applies to: 125-126


122-122: Use diamond operator

Small cleanup.

-        List<String> pastedConduits = new ArrayList<String>();
+        List<String> pastedConduits = new ArrayList<>();
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 2d121799cd and d13ab887b5.

📒 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
Learnt from: mosesyu1028
PR: Team-EnderIO/EnderIO#1124
File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118
Timestamp: 2025-08-26T17:19:26.821Z
Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user.
📚 Learning: 2025-08-26T17:19:26.821Z
Learnt from: mosesyu1028
PR: Team-EnderIO/EnderIO#1124
File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118
Timestamp: 2025-08-26T17:19:26.821Z
Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user.

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)
enderio-conduits/src/main/java/com/enderio/conduits/common/conduit/bundle/ConduitBundleBlockEntity.java (1)
  • ConduitBundleBlockEntity (85-1796)
enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitComponents.java (1)
  • ConduitComponents (21-103)
enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitLang.java (1)
  • ConduitLang (9-124)
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)
  • GitHub Check: Run Tests
  • GitHub Check: Analyze (java-kotlin)
🔇 Additional comments (2)
enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (2)

137-139: Double shape updates? Verify redundancy

setConnectionConfig() already calls bundleChanged() which typically triggers shape/dirtiness; confirm whether explicit setChanged()/updateShape() are still needed to avoid duplicate work.


200-213: CODEC/STREAM_CODEC for ProbeConfigData look solid

Good use of unboundedMap with GENERIC_CODEC and matching STREAM_CODEC for networking.

**Actionable comments posted: 0** <details> <summary>♻️ Duplicate comments (1)</summary><blockquote> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (1)</summary><blockquote> `118-131`: **Deep-copy on paste to avoid shared mutable config across tiles** Reusing the stored ConnectionConfig instance across multiple pastes can couple block-entities. Clone via CODEC before setConnectionConfig. This mirrors your copy path. ```diff - List<String> pastedConduits = new ArrayList<String>(); - var conduits = conduitBlock.getConduits(); + List<String> pastedConduits = new ArrayList<>(); + var conduits = conduitBlock.getConduits(); + var ops = net.minecraft.resources.RegistryOps.create( + net.minecraft.nbt.NbtOps.INSTANCE, + conduitBlock.getLevel().registryAccess() + ); conduits.forEach(conduit -> { ResourceLocation conduitKey = ResourceLocation.parse(conduit.getRegisteredName()); ConnectionConfig storedConfig = configData.conduitData().get(conduitKey); if (storedConfig != null) { - conduitBlock.setConnectionConfig(conduit, face, storedConfig); - pastedConduits.add(conduitKeyToDisplayName(conduitKey)); + var nbt = ConnectionConfig.GENERIC_CODEC.encodeStart(ops, storedConfig).result(); + nbt.flatMap(tag -> ConnectionConfig.GENERIC_CODEC.parse(ops, tag).result()) + .ifPresent(cloned -> { + conduitBlock.setConnectionConfig(conduit, face, cloned); + pastedConduits.add(conduitKeyToDisplayName(conduitKey)); + }); } }); ``` </blockquote></details> </blockquote></details> <details> <summary>🧹 Nitpick comments (5)</summary><blockquote> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (5)</summary><blockquote> `59-61`: **Localise the “not implemented” message** Avoid hard-coded English; use ConduitLang so it’s translatable. ```diff - player.sendSystemMessage(Component.literal("This feature isn't implemented yet.").withStyle(ChatFormatting.RED)); + player.sendSystemMessage(ConduitLang.CONDUIT_PROBE_MESSAGE_NOT_IMPLEMENTED.withStyle(ChatFormatting.RED)); ``` Note: add CONDUIT_PROBE_MESSAGE_NOT_IMPLEMENTED to ConduitLang. --- `74-85`: **Create RegistryOps once, not per conduit** Minor perf/alloc win: move ops creation outside the loop. ```diff - var conduits = conduitBlock.getConduits(); - conduits.forEach(conduit -> { + var conduits = conduitBlock.getConduits(); + var ops = net.minecraft.resources.RegistryOps.create( + net.minecraft.nbt.NbtOps.INSTANCE, + conduitBlock.getLevel().registryAccess() + ); + conduits.forEach(conduit -> { ConnectionConfig connectionConfig = conduitBlock.getConnectionConfig(conduit, face); if (connectionConfig != null) { ResourceLocation conduitKey = ResourceLocation.parse(conduit.getRegisteredName()); - var ops = net.minecraft.resources.RegistryOps.create( - net.minecraft.nbt.NbtOps.INSTANCE, - conduitBlock.getLevel().registryAccess() - ); var nbt = ConnectionConfig.GENERIC_CODEC .encodeStart(ops, connectionConfig) .result(); ``` --- `101-113`: **Filter out static fields and simplify append** Prevent static fields leaking into the debug dump; cleaner building of the line. ```diff - for (var field : connectionConfig.getClass().getDeclaredFields()) { - if (SKIP_FIELDS.contains(field.getName())) continue; - sb.append(" - " + field.getName() + ": "); - try { - field.setAccessible(true); - Object value = field.get(connectionConfig); - sb.append(value); - } catch (IllegalAccessException e) { - sb.append(": <unable to access>"); - } - sb.append("\n"); - } + for (var field : connectionConfig.getClass().getDeclaredFields()) { + if (SKIP_FIELDS.contains(field.getName()) || java.lang.reflect.Modifier.isStatic(field.getModifiers())) continue; + try { + field.setAccessible(true); + Object value = field.get(connectionConfig); + sb.append(" - ").append(field.getName()).append(": ").append(String.valueOf(value)).append("\n"); + } catch (IllegalAccessException e) { + sb.append(" - ").append(field.getName()).append(": <unable to access>\n"); + } + } ``` Add import (outside range): ```java import java.lang.reflect.Modifier; ``` --- `78-79`: **Guard RL parsing to avoid crashes with invalid IDs** ResourceLocation.parse throws; tryParse is safer for third-party conduits. ```diff - ResourceLocation conduitKey = ResourceLocation.parse(conduit.getRegisteredName()); + ResourceLocation conduitKey = ResourceLocation.tryParse(conduit.getRegisteredName()); + if (conduitKey == null) return; ``` ```diff - ResourceLocation conduitKey = ResourceLocation.parse(conduit.getRegisteredName()); + ResourceLocation conduitKey = ResourceLocation.tryParse(conduit.getRegisteredName()); + if (conduitKey == null) return; ``` Also applies to: 125-126 --- `122-122`: **Use diamond operator** Small cleanup. ```diff - List<String> pastedConduits = new ArrayList<String>(); + List<String> pastedConduits = new ArrayList<>(); ``` </blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used**: CodeRabbit UI **Review profile**: CHILL **Plan**: Pro **💡 Knowledge Base configuration:** - MCP integration is disabled by default for public repositories - Jira integration is disabled by default for public repositories - Linear integration is disabled by default for public repositories You can enable these sources in your CodeRabbit configuration. <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 2d121799cdc1a5e8ac4ded03ad0796ba6be2a04b and d13ab887b5575781da70d911b91ef13b76a0b9f3. </details> <details> <summary>📒 Files selected for processing (1)</summary> * `enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java` (1 hunks) </details> <details> <summary>🧰 Additional context used</summary> <details> <summary>🧠 Learnings (2)</summary> <details> <summary>📓 Common learnings</summary> ``` Learnt from: mosesyu1028 PR: Team-EnderIO/EnderIO#1124 File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118 Timestamp: 2025-08-26T17:19:26.821Z Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user. ``` </details> <details> <summary>📚 Learning: 2025-08-26T17:19:26.821Z</summary> ``` Learnt from: mosesyu1028 PR: Team-EnderIO/EnderIO#1124 File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118 Timestamp: 2025-08-26T17:19:26.821Z Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user. ``` **Applied to files:** - `enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java` </details> </details><details> <summary>🧬 Code graph analysis (1)</summary> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (3)</summary><blockquote> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/conduit/bundle/ConduitBundleBlockEntity.java (1)</summary> * `ConduitBundleBlockEntity` (85-1796) </details> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitComponents.java (1)</summary> * `ConduitComponents` (21-103) </details> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/init/ConduitLang.java (1)</summary> * `ConduitLang` (9-124) </details> </blockquote></details> </details> </details> <details> <summary>⏰ 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)</summary> * GitHub Check: Run Tests * GitHub Check: Analyze (java-kotlin) </details> <details> <summary>🔇 Additional comments (2)</summary><blockquote> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (2)</summary><blockquote> `137-139`: **Double shape updates? Verify redundancy** setConnectionConfig() already calls bundleChanged() which typically triggers shape/dirtiness; confirm whether explicit setChanged()/updateShape() are still needed to avoid duplicate work. --- `200-213`: **CODEC/STREAM_CODEC for ProbeConfigData look solid** Good use of unboundedMap with GENERIC_CODEC and matching STREAM_CODEC for networking. </blockquote></details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
Rover656 (Migrated from github.com) requested changes 2025-09-07 11:17:27 +00:00
Rover656 (Migrated from github.com) left a comment

Some initial commentary :)

Some initial commentary :)
Rover656 (Migrated from github.com) commented 2025-09-07 11:04:08 +00:00

I'm fairly sure this shouldn't be required?

I'm fairly sure this shouldn't be required?
@ -0,0 +1,232 @@
package com.enderio.conduits.common.items;
Rover656 (Migrated from github.com) commented 2025-09-07 11:08:51 +00:00

Tend to prefer curly braces around all conditions please :)

Tend to prefer curly braces around all conditions please :)
Rover656 (Migrated from github.com) commented 2025-09-07 11:09:20 +00:00

We can reduce nesting a bit if we invert the condition and early return :)

We can reduce nesting a bit if we invert the condition and early return :)
Rover656 (Migrated from github.com) commented 2025-09-07 11:11:32 +00:00

Just to make this method more readable, perhaps we can extract the string building out to its own method?

Just to make this method more readable, perhaps we can extract the string building out to its own method?
Rover656 (Migrated from github.com) commented 2025-09-07 11:12:21 +00:00

Please import these :)

Please import these :)
@ -88,1 +101,4 @@
}
});
}
}
Rover656 (Migrated from github.com) commented 2025-09-07 11:06:48 +00:00

Maybe we should send the hand in the packet too? That way we definitely get the correct item when syncing.

Maybe we should send the hand in the packet too? That way we definitely get the correct item when syncing.
Rover656 (Migrated from github.com) commented 2025-09-07 11:16:45 +00:00

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.

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.
coderabbitai[bot] (Migrated from github.com) reviewed 2025-09-07 12:05:58 +00:00
coderabbitai[bot] (Migrated from github.com) left a comment

Actionable comments posted: 0

♻️ Duplicate comments (1)
enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (1)

139-143: Deep-copy config on paste to avoid shared mutable state

Reusing the stored instance can couple multiple connections if the BE doesn’t defensively copy. Clone per paste via CODEC round-trip.

-            if (storedConfig != null) {
-                conduitBlock.setConnectionConfig(conduit, face, storedConfig);
-                pastedConduits.add(conduitKeyToDisplayName(conduitKey));
-            }
+            if (storedConfig != null) {
+                var ops = net.minecraft.resources.RegistryOps.create(
+                    net.minecraft.nbt.NbtOps.INSTANCE,
+                    conduitBlock.getLevel().registryAccess()
+                );
+                var nbt = com.enderio.conduits.api.connection.config.ConnectionConfig.GENERIC_CODEC
+                    .encodeStart(ops, storedConfig)
+                    .result();
+                var cloned = nbt.flatMap(tag ->
+                        com.enderio.conduits.api.connection.config.ConnectionConfig.GENERIC_CODEC.parse(ops, tag).result()
+                    ).orElse(storedConfig);
+                conduitBlock.setConnectionConfig(conduit, face, cloned);
+                pastedConduits.add(conduitKeyToDisplayName(conduitKey));
+            }
🧹 Nitpick comments (5)
enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (5)

71-73: Localise the “not implemented” message

Use ConduitLang to allow translation.

-                player.sendSystemMessage(Component.literal("This feature isn't implemented yet.").withStyle(ChatFormatting.RED));
+                player.sendSystemMessage(ConduitLang.CONDUIT_PROBE_NOT_IMPLEMENTED.withStyle(ChatFormatting.RED));

Add a corresponding key in ConduitLang if not present.


3-29: Avoid reflective leakage; skip static/synthetic fields and use trySetAccessible

Prevents dumping constants and reduces illegal-access noise. Minimal change; still keeps your current UX.

+import java.lang.reflect.Modifier;
-                for (var field : connectionConfig.getClass().getDeclaredFields()) {
-                    if (SKIP_FIELDS.contains(field.getName())) continue;
+                for (var field : connectionConfig.getClass().getDeclaredFields()) {
+                    if (SKIP_FIELDS.contains(field.getName())) { continue; }
+                    if (Modifier.isStatic(field.getModifiers()) || field.isSynthetic()) { continue; }
                     StringBuilder sb = new StringBuilder();
                     sb.append(" - " + field.getName() + ": ");
                     try {
-                        field.setAccessible(true);
+                        if (!field.trySetAccessible()) { continue; }
                         Object value = field.get(connectionConfig);
                         sb.append(value);
                     } catch (IllegalAccessException e) {
                         sb.append(": <unable to access>");
                     }
                     sb.append("\n");
                     message.append(Component.literal(sb.toString()).withStyle(ChatFormatting.GRAY));
                 }

Also applies to: 110-123


135-135: Use diamond operator

-        List<String> pastedConduits = new ArrayList<String>();
+        List<String> pastedConduits = new ArrayList<>();

163-165: Stable, sorted tooltip order for copied conduits

Improves readability across sessions.

-            configData.conduitData().keySet().forEach(conduitKey -> {
-                tooltipComponents.add(Component.literal("- " + conduitKeyToDisplayName(conduitKey)).withStyle(ChatFormatting.DARK_GRAY));
-            });
+            configData.conduitData().keySet().stream()
+                .map(this::conduitKeyToDisplayName)
+                .sorted()
+                .forEach(name -> tooltipComponents.add(Component.literal("- " + name).withStyle(ChatFormatting.DARK_GRAY)));

105-109: Remove leading newline in copied-fields header

Minor polish; avoids a blank line at the start of the message.

-                message.append(Component.literal("\n" + conduitName + ":\n").withStyle(ChatFormatting.UNDERLINE));
+                message.append(Component.literal(conduitName + ":\n").withStyle(ChatFormatting.UNDERLINE));
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bfada24e6b and d2c3a1ffd1.

📒 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
Learnt from: mosesyu1028
PR: Team-EnderIO/EnderIO#1124
File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118
Timestamp: 2025-08-26T17:19:26.821Z
Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user.
📚 Learning: 2025-08-26T17:19:26.821Z
Learnt from: mosesyu1028
PR: Team-EnderIO/EnderIO#1124
File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118
Timestamp: 2025-08-26T17:19:26.821Z
Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user.

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)
  • GitHub Check: Run Tests
  • GitHub Check: Analyze (java-kotlin)
🔇 Additional comments (2)
enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (2)

50-52: Prefer PASS on client to avoid swallowing interactions

Returning SUCCESS on the client for every click can consume the action even when not targeting conduits. PASS defers to the server cleanly. Please verify NeoForge 1.21.1 semantics in your input pipeline.

-        if (pContext.getLevel().isClientSide()) {
-            return InteractionResult.SUCCESS;
-        }
+        if (pContext.getLevel().isClientSide()) {
+            return InteractionResult.PASS;
+        }

58-60: Return PASS when no conduit connection is hit

FAIL may block other handlers. PASS is typically safer for “no-op”.

-        if (conduitConnection == null) {
-            return InteractionResult.FAIL;
-        }
+        if (conduitConnection == null) {
+            return InteractionResult.PASS;
+        }
**Actionable comments posted: 0** <details> <summary>♻️ Duplicate comments (1)</summary><blockquote> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (1)</summary><blockquote> `139-143`: **Deep-copy config on paste to avoid shared mutable state** Reusing the stored instance can couple multiple connections if the BE doesn’t defensively copy. Clone per paste via CODEC round-trip. ```diff - if (storedConfig != null) { - conduitBlock.setConnectionConfig(conduit, face, storedConfig); - pastedConduits.add(conduitKeyToDisplayName(conduitKey)); - } + if (storedConfig != null) { + var ops = net.minecraft.resources.RegistryOps.create( + net.minecraft.nbt.NbtOps.INSTANCE, + conduitBlock.getLevel().registryAccess() + ); + var nbt = com.enderio.conduits.api.connection.config.ConnectionConfig.GENERIC_CODEC + .encodeStart(ops, storedConfig) + .result(); + var cloned = nbt.flatMap(tag -> + com.enderio.conduits.api.connection.config.ConnectionConfig.GENERIC_CODEC.parse(ops, tag).result() + ).orElse(storedConfig); + conduitBlock.setConnectionConfig(conduit, face, cloned); + pastedConduits.add(conduitKeyToDisplayName(conduitKey)); + } ``` </blockquote></details> </blockquote></details> <details> <summary>🧹 Nitpick comments (5)</summary><blockquote> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (5)</summary><blockquote> `71-73`: **Localise the “not implemented” message** Use ConduitLang to allow translation. ```diff - player.sendSystemMessage(Component.literal("This feature isn't implemented yet.").withStyle(ChatFormatting.RED)); + player.sendSystemMessage(ConduitLang.CONDUIT_PROBE_NOT_IMPLEMENTED.withStyle(ChatFormatting.RED)); ``` Add a corresponding key in ConduitLang if not present. --- `3-29`: **Avoid reflective leakage; skip static/synthetic fields and use trySetAccessible** Prevents dumping constants and reduces illegal-access noise. Minimal change; still keeps your current UX. ```diff +import java.lang.reflect.Modifier; ``` ```diff - for (var field : connectionConfig.getClass().getDeclaredFields()) { - if (SKIP_FIELDS.contains(field.getName())) continue; + for (var field : connectionConfig.getClass().getDeclaredFields()) { + if (SKIP_FIELDS.contains(field.getName())) { continue; } + if (Modifier.isStatic(field.getModifiers()) || field.isSynthetic()) { continue; } StringBuilder sb = new StringBuilder(); sb.append(" - " + field.getName() + ": "); try { - field.setAccessible(true); + if (!field.trySetAccessible()) { continue; } Object value = field.get(connectionConfig); sb.append(value); } catch (IllegalAccessException e) { sb.append(": <unable to access>"); } sb.append("\n"); message.append(Component.literal(sb.toString()).withStyle(ChatFormatting.GRAY)); } ``` Also applies to: 110-123 --- `135-135`: **Use diamond operator** ```diff - List<String> pastedConduits = new ArrayList<String>(); + List<String> pastedConduits = new ArrayList<>(); ``` --- `163-165`: **Stable, sorted tooltip order for copied conduits** Improves readability across sessions. ```diff - configData.conduitData().keySet().forEach(conduitKey -> { - tooltipComponents.add(Component.literal("- " + conduitKeyToDisplayName(conduitKey)).withStyle(ChatFormatting.DARK_GRAY)); - }); + configData.conduitData().keySet().stream() + .map(this::conduitKeyToDisplayName) + .sorted() + .forEach(name -> tooltipComponents.add(Component.literal("- " + name).withStyle(ChatFormatting.DARK_GRAY))); ``` --- `105-109`: **Remove leading newline in copied-fields header** Minor polish; avoids a blank line at the start of the message. ```diff - message.append(Component.literal("\n" + conduitName + ":\n").withStyle(ChatFormatting.UNDERLINE)); + message.append(Component.literal(conduitName + ":\n").withStyle(ChatFormatting.UNDERLINE)); ``` </blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used**: CodeRabbit UI **Review profile**: CHILL **Plan**: Pro <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between bfada24e6b8cbd5f5c14b56cb45ba18f0e586051 and d2c3a1ffd1bb59cac3e846e13d7717848bf59b5b. </details> <details> <summary>📒 Files selected for processing (1)</summary> * `enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java` (1 hunks) </details> <details> <summary>🧰 Additional context used</summary> <details> <summary>🧠 Learnings (2)</summary> <details> <summary>📓 Common learnings</summary> ``` Learnt from: mosesyu1028 PR: Team-EnderIO/EnderIO#1124 File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118 Timestamp: 2025-08-26T17:19:26.821Z Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user. ``` </details> <details> <summary>📚 Learning: 2025-08-26T17:19:26.821Z</summary> ``` Learnt from: mosesyu1028 PR: Team-EnderIO/EnderIO#1124 File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118 Timestamp: 2025-08-26T17:19:26.821Z Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user. ``` **Applied to files:** - `enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java` </details> </details> </details> <details> <summary>⏰ 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)</summary> * GitHub Check: Run Tests * GitHub Check: Analyze (java-kotlin) </details> <details> <summary>🔇 Additional comments (2)</summary><blockquote> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (2)</summary><blockquote> `50-52`: **Prefer PASS on client to avoid swallowing interactions** Returning SUCCESS on the client for every click can consume the action even when not targeting conduits. PASS defers to the server cleanly. Please verify NeoForge 1.21.1 semantics in your input pipeline. ```diff - if (pContext.getLevel().isClientSide()) { - return InteractionResult.SUCCESS; - } + if (pContext.getLevel().isClientSide()) { + return InteractionResult.PASS; + } ``` --- `58-60`: **Return PASS when no conduit connection is hit** FAIL may block other handlers. PASS is typically safer for “no-op”. ```diff - if (conduitConnection == null) { - return InteractionResult.FAIL; - } + if (conduitConnection == null) { + return InteractionResult.PASS; + } ``` </blockquote></details> </blockquote></details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
mosesyu1028 (Migrated from github.com) reviewed 2025-09-07 12:27:00 +00:00
mosesyu1028 (Migrated from github.com) commented 2025-09-07 12:27:00 +00:00

It seems to be required - from testing, not including this guard has the following effects:

  • Yeta Wrench: right clicking (or shift-right clicking) a conduit connection will open the GUI instead of removing the connection
  • Conduit Facade: the facade can only be placed on the non-connection parts of the conduit, making it easier to accidentally go into a GUI when trying to place (let's say) a wall of facades
  • Conduit Probe: functionality is basically completely gone because it requires clicking on the bundle connection itself
It seems to be required - from testing, not including this guard has the following effects: - Yeta Wrench: right clicking (or shift-right clicking) a conduit connection will open the GUI instead of removing the connection - Conduit Facade: the facade can only be placed on the non-connection parts of the conduit, making it easier to accidentally go into a GUI when trying to place (let's say) a wall of facades - Conduit Probe: functionality is basically completely gone because it requires clicking on the bundle connection itself
coderabbitai[bot] (Migrated from github.com) reviewed 2025-09-07 12:30:02 +00:00
coderabbitai[bot] (Migrated from github.com) left a comment

Actionable comments posted: 0

♻️ Duplicate comments (1)
enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (1)

126-135: Deep-copy on paste to prevent shared mutable state across connections

Reusing the stored ConnectionConfig instance can couple multiple connections if the object is mutated later. Clone via CODEC round‑trip before setConnectionConfig. Same rationale as the earlier bot comment.

-        List<String> pastedConduits = new ArrayList<String>();
-        var conduits = conduitBlock.getConduits();
-        conduits.forEach(conduit -> {
+        List<String> pastedConduits = new ArrayList<>();
+        var conduits = conduitBlock.getConduits();
+        var ops = net.minecraft.resources.RegistryOps.create(
+            net.minecraft.nbt.NbtOps.INSTANCE,
+            conduitBlock.getLevel().registryAccess()
+        );
+        conduits.forEach(conduit -> {
             ResourceLocation conduitKey = ResourceLocation.parse(conduit.getRegisteredName());
             ConnectionConfig storedConfig = configData.conduitData().get(conduitKey);
-            if (storedConfig != null) {
-                conduitBlock.setConnectionConfig(conduit, face, storedConfig);
-                pastedConduits.add(conduitKeyToDisplayName(conduitKey));
-            }
+            if (storedConfig != null) {
+                ConnectionConfig cloned = ConnectionConfig.GENERIC_CODEC
+                    .encodeStart(ops, storedConfig).result()
+                    .flatMap(tag -> ConnectionConfig.GENERIC_CODEC.parse(ops, tag).result())
+                    .orElse(null);
+                if (cloned != null) {
+                    conduitBlock.setConnectionConfig(conduit, face, cloned);
+                    pastedConduits.add(conduitKeyToDisplayName(conduitKey));
+                }
+            }
         });
🧹 Nitpick comments (3)
enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (3)

111-115: Skip static/synthetic fields and use braces for style consistency

Avoid leaking internals like CODEC fields and follow team preference for braces.

-                for (Field field : connectionConfig.getClass().getDeclaredFields()) {
-                    if (SKIP_FIELDS.contains(field.getName())) continue;
-                    message.append(createFieldTextComponent(field, connectionConfig));
-                }
+                for (Field field : connectionConfig.getClass().getDeclaredFields()) {
+                    if (SKIP_FIELDS.contains(field.getName())
+                        || java.lang.reflect.Modifier.isStatic(field.getModifiers())
+                        || field.isSynthetic()) {
+                        continue;
+                    }
+                    message.append(createFieldTextComponent(field, connectionConfig));
+                }

120-124: User feedback when nothing is copied

Early out is fine, but telling the user why nothing happened improves UX.

-        if (configData == null) {
-            return;
-        }
+        if (configData == null) {
+            player.sendSystemMessage(ConduitLang.CONDUIT_PROBE_MESSAGE_NOTHING_TO_PASTE.withStyle(ChatFormatting.RED));
+            return;
+        }

73-74: Localise the “not implemented” message

Prefer ConduitLang over hardcoded literals for i18n.

-                player.sendSystemMessage(Component.literal("This feature isn't implemented yet.").withStyle(ChatFormatting.RED));
+                player.sendSystemMessage(ConduitLang.CONDUIT_PROBE_MESSAGE_NOT_IMPLEMENTED.withStyle(ChatFormatting.RED));
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d2c3a1ffd1 and cf319e37a8.

📒 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
Learnt from: mosesyu1028
PR: Team-EnderIO/EnderIO#1124
File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118
Timestamp: 2025-08-26T17:19:26.821Z
Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user.
📚 Learning: 2025-08-26T17:19:26.821Z
Learnt from: mosesyu1028
PR: Team-EnderIO/EnderIO#1124
File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118
Timestamp: 2025-08-26T17:19:26.821Z
Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user.

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)
  • GitHub Check: Run Tests
  • GitHub Check: Analyze (java-kotlin)
**Actionable comments posted: 0** <details> <summary>♻️ Duplicate comments (1)</summary><blockquote> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (1)</summary><blockquote> `126-135`: **Deep-copy on paste to prevent shared mutable state across connections** Reusing the stored `ConnectionConfig` instance can couple multiple connections if the object is mutated later. Clone via CODEC round‑trip before `setConnectionConfig`. Same rationale as the earlier bot comment. ```diff - List<String> pastedConduits = new ArrayList<String>(); - var conduits = conduitBlock.getConduits(); - conduits.forEach(conduit -> { + List<String> pastedConduits = new ArrayList<>(); + var conduits = conduitBlock.getConduits(); + var ops = net.minecraft.resources.RegistryOps.create( + net.minecraft.nbt.NbtOps.INSTANCE, + conduitBlock.getLevel().registryAccess() + ); + conduits.forEach(conduit -> { ResourceLocation conduitKey = ResourceLocation.parse(conduit.getRegisteredName()); ConnectionConfig storedConfig = configData.conduitData().get(conduitKey); - if (storedConfig != null) { - conduitBlock.setConnectionConfig(conduit, face, storedConfig); - pastedConduits.add(conduitKeyToDisplayName(conduitKey)); - } + if (storedConfig != null) { + ConnectionConfig cloned = ConnectionConfig.GENERIC_CODEC + .encodeStart(ops, storedConfig).result() + .flatMap(tag -> ConnectionConfig.GENERIC_CODEC.parse(ops, tag).result()) + .orElse(null); + if (cloned != null) { + conduitBlock.setConnectionConfig(conduit, face, cloned); + pastedConduits.add(conduitKeyToDisplayName(conduitKey)); + } + } }); ``` </blockquote></details> </blockquote></details> <details> <summary>🧹 Nitpick comments (3)</summary><blockquote> <details> <summary>enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java (3)</summary><blockquote> `111-115`: **Skip static/synthetic fields and use braces for style consistency** Avoid leaking internals like CODEC fields and follow team preference for braces. ```diff - for (Field field : connectionConfig.getClass().getDeclaredFields()) { - if (SKIP_FIELDS.contains(field.getName())) continue; - message.append(createFieldTextComponent(field, connectionConfig)); - } + for (Field field : connectionConfig.getClass().getDeclaredFields()) { + if (SKIP_FIELDS.contains(field.getName()) + || java.lang.reflect.Modifier.isStatic(field.getModifiers()) + || field.isSynthetic()) { + continue; + } + message.append(createFieldTextComponent(field, connectionConfig)); + } ``` --- `120-124`: **User feedback when nothing is copied** Early out is fine, but telling the user why nothing happened improves UX. ```diff - if (configData == null) { - return; - } + if (configData == null) { + player.sendSystemMessage(ConduitLang.CONDUIT_PROBE_MESSAGE_NOTHING_TO_PASTE.withStyle(ChatFormatting.RED)); + return; + } ``` --- `73-74`: **Localise the “not implemented” message** Prefer `ConduitLang` over hardcoded literals for i18n. ```diff - player.sendSystemMessage(Component.literal("This feature isn't implemented yet.").withStyle(ChatFormatting.RED)); + player.sendSystemMessage(ConduitLang.CONDUIT_PROBE_MESSAGE_NOT_IMPLEMENTED.withStyle(ChatFormatting.RED)); ``` </blockquote></details> </blockquote></details> <details> <summary>📜 Review details</summary> **Configuration used**: CodeRabbit UI **Review profile**: CHILL **Plan**: Pro <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between d2c3a1ffd1bb59cac3e846e13d7717848bf59b5b and cf319e37a8e1cef736de9738068bef956bdc3f5e. </details> <details> <summary>📒 Files selected for processing (1)</summary> * `enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java` (1 hunks) </details> <details> <summary>🧰 Additional context used</summary> <details> <summary>🧠 Learnings (2)</summary> <details> <summary>📓 Common learnings</summary> ``` Learnt from: mosesyu1028 PR: Team-EnderIO/EnderIO#1124 File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118 Timestamp: 2025-08-26T17:19:26.821Z Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user. ``` </details> <details> <summary>📚 Learning: 2025-08-26T17:19:26.821Z</summary> ``` Learnt from: mosesyu1028 PR: Team-EnderIO/EnderIO#1124 File: src/conduits/java/com/enderio/conduits/common/items/ConduitProbeItem.java:113-118 Timestamp: 2025-08-26T17:19:26.821Z Learning: User mosesyu1028 prefers concise, direct communication without verbose explanations or excessive politeness ("AI glaze"). Keep responses brief and technical when interacting with this user. ``` **Applied to files:** - `enderio-conduits/src/main/java/com/enderio/conduits/common/items/ConduitProbeItem.java` </details> </details> </details> <details> <summary>⏰ 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)</summary> * GitHub Check: Run Tests * GitHub Check: Analyze (java-kotlin) </details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
mosesyu1028 (Migrated from github.com) reviewed 2025-09-07 13:11:34 +00:00
@ -88,1 +101,4 @@
}
});
}
}
mosesyu1028 (Migrated from github.com) commented 2025-09-07 13:11:34 +00:00

C2SSyncProbeStatePacket only 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:51 ensures that the copy/paste code is done on the server side only:

if (pContext.getLevel().isClientSide()) {
    return InteractionResult.SUCCESS;
}
...
if (...) {
    handleCopy(...);
} else {
    handlePaste(...);
}
`C2SSyncProbeStatePacket` only 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:51` ensures that the copy/paste code is done on the server side only: ```java if (pContext.getLevel().isClientSide()) { return InteractionResult.SUCCESS; } ... if (...) { handleCopy(...); } else { handlePaste(...); } ```
mosesyu1028 (Migrated from github.com) reviewed 2025-09-07 13:15:38 +00:00
@ -88,1 +101,4 @@
}
});
}
}
mosesyu1028 (Migrated from github.com) commented 2025-09-07 13:15:38 +00:00

Maybe we should send the hand in the packet too? That way we definitely get the correct item when syncing.

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?

> Maybe we should send the hand in the packet too? That way we definitely get the correct item when syncing. 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?
mosesyu1028 commented 2025-09-07 13:18:43 +00:00 (Migrated from github.com)

Some initial commentary :)

Hiya, re-requested review :)

Sorry if I resolved some comments that I shouldn't have, not sure what the protocol is.

> Some initial commentary :) Hiya, re-requested review :) Sorry if I resolved some comments that I shouldn't have, not sure what the protocol is.
Rover656 (Migrated from github.com) approved these changes 2025-09-26 15:47:33 +00:00
Rover656 (Migrated from github.com) left a comment

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.

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.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Team-EnderIO/EnderIO#1126
No description provided.