Give Click Slot the three clicks a player actually makes - #81
Closed
Gaetarra wants to merge 1 commit into
Closed
Conversation
Click Slot always sent ClickType.PICKUP, so shift-clicking a stack into the other container or swapping it to the offhand with F had to be built out of Move Item or the raw packet fabricator in UI Utils. Both are more work than the click they stand in for, and neither matches what the server sees from a real player. Click Slot gains three modes, mapping to what the vanilla screen sends for the same input: Left Click is PICKUP and stays the default, Shift Click is QUICK_MOVE, and F is SWAP on button 40, the offhand's button index in AbstractContainerScreen. Two supporting changes: - Click Slot is tagged RENDER_INLINE_PARAMETERS. NodeGraph.rendersInline Parameters gates the parameter strip and the mode selector is drawn inside it, so without the tag the modes would exist but not be selectable. - The click_slot_index write-in parameter is removed, and the parameter slot is relabelled from Selection to Slot. The node had two ways to name a slot and only one of them ever won: the parameter slot is required, so every Click Slot has a Slot node attached, and that node's value was copied over the write-in on every run by applyParameterValuesFromMap. The field was redundant by construction. With no host parameter to copy into, the executor now reads the index straight off the attachment, resolving variable indirection the same way the selection type already does. Parameter preprocessing needs the same claim: it marks a slot handled by writing the attached node's value into one of the host's own parameters, and a host with none left would have reported its own Slot node as an incompatible parameter. Saved presets are unaffected. The removed parameter never held a value the attached node did not already supply, and it was not editable before this change either, since Click Slot rendered no field for it. Mode display names get lang entries, since NodeMode.getDisplayName ignores the strings in the enum constructor and builds "pathmind.node.mode.<name>" as a translation key. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Gaetarra
force-pushed
the
feature/click-slot-modes
branch
from
August 30, 2026 23:49
4dfc7e8 to
288aff3
Compare
Member
|
Implemented and tested in c2d40d3, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What This Changes
Click Slot always sent
ClickType.PICKUP. Shift-clicking a stack into the othercontainer, or swapping it to the offhand with F, had to be built out of
Move Itemor the raw packet fabricator inUI Utils. Both are more work thanthe click they stand in for, and neither matches what the server sees from a
real player.
CLICK_SLOTgains modes, each sending what the vanilla screen sends forthe same input:
Left Click(default)PICKUP, button 0Shift ClickQUICK_MOVE, button 0FSWAP, button 40 — the offhand's button index inAbstractContainerScreenClick Slot is tagged
RENDER_INLINE_PARAMETERS.NodeGraph.rendersInline Parametersgates the parameter strip and the mode selector is drawn insideit, so without the tag the modes would exist but not be selectable.
The
click_slot_indexwrite-in parameter is removed and the parameter slotis relabelled
Selection->Slot. The node had two ways to name a slot andonly one of them could ever win; see below.
Verification
./gradlew :common:test -Pmc_version=1.21.11NodeClickSlotTestis added but has never been executed.verifyCompatibilityManifest verifyCompatibilityStructure verifyBuildGenerationRouting1.21/1.21.8/1.21.10/1.21.1126.1/26.2(-p mc26, both loaders)26.1.2. NeoForge on26.2fails withCould not find net.neoforged:neoforge:unsupported— pre-existing, same as #78 and #79.Only
commonis touched, so nothing here is version-sensitive on its face — butthe compile matrix is the check that would catch it if that assumption is wrong.
Notes For Review
Removing the write-in is not a behaviour change, and this is the part most
worth a second pair of eyes. The reasoning:
parameterHost(NodeType.CLICK_SLOT, ...)uses the(type, label, traits)overload, which passes
required = true.NodeExecutionCoordinatorfails anyClick Slot with nothing attached before the executor runs, so every Click
Slot that has ever executed had a Slot node attached.
preprocessAttachedParameterexports that node's values andapplyParameterValuesFromMapcopiesSlotover the host's own parameter.adjustParameterValuesForSlotis identity forCLICK_SLOT.redundant by construction, not merely duplicated.
With no host parameter left to copy into,
resolveClickSlotIndexreads the indexstraight off the attachment, applying
resolveVariableSelectionParameterNodefirst so a
Variablein the slot resolves the same way it already does for theselection type.
That same copy is how a slot gets marked handled, which is the sharp edge
here.
preprocessParameterNodetreats the boolean returned byapplyParameterValuesFromMapas "this attachment was consumed", and a host withno parameters of its own can never return
truefrom it. Dropping the write-intherefore made every Click Slot run report its own required Slot node as an
incompatible parameter.
NodeRuntimeParameterResolvernow claims the slotexplicitly when the owner is
CLICK_SLOTand the attachment providesINVENTORY_SLOT, in the same shape as the existingMOVE_ITEMandBREAKclauses beside it. Worth knowing generally: a parameter host that keeps no
parameters of its own needs one of these claims, or attachment-time compatibility
and run-time compatibility disagree.
Saved presets. Nothing migrates. The removed parameter never held a value the
attached node did not already supply, and it was never editable — before this
branch, Click Slot rendered no field for it, so the only way to name a slot was
the attachment. The mode is absent from old saves and falls back to the
constructor default
CLICK_SLOT_LEFT, which is the click those presets werealready sending. I have not loaded a pre-existing preset in a client to confirm
this end to end; the reasoning above is the argument, and
NodeClickSlotTestpins the null-mode fallback.
Why the field existed at all in this branch. The first draft kept
click_slot_indexas a mode parameter on all three modes, on the theory that anode with modes reads mode parameters instead of type parameters
(
NodeCatalog.initializeParameters) and dropping it would lose saved values.That was true of the mechanism but wrong about this node — the value was never
the write-in's to lose. Testing surfaced it as a visibly redundant second field
next to the slot.
Lang keys.
NodeMode.getDisplayNameignores the display strings in the enumconstructor and builds
pathmind.node.mode.<name>as a translation key, so allthree modes have
en_us.jsonentries plus.desc.