Repository navigation
Conversation
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.
Summary
Implements the "Apply Hand Scale" feature requested in #3, fixes two GUI bugs
introduced during development, and corrects a crash caused by a wrong mixin
target method name.
Changes
New feature — Apply Hand Scale toggle
A new "Apply Hand Scale: ON/OFF" toggle button has been added to the settings
panel, styled identically to the existing "Ignore Haste" button.
player's bare arm renders at vanilla size. This is the existing behaviour.
HELD_ITEM_SCALE.This is visible when holding nothing. When holding an item, the arm geometry
is rendered by a separate entity-renderer pipeline that is outside the scope
of
ItemInHandRenderer; the item itself still scales correctly in all cases.Config persistence
ItemTweaksConfiggains a newAPPLY_HAND_SCALEboolean field (defaultfalse). It is read from and written toconfig/swing.jsonalongside theexisting fields, and is reset by the Reset button.
New mixin —
ItemInHandRendererArmMixinTargets
AvatarRenderer#renderRightHandandAvatarRenderer#renderLeftHand(the only methods that render the first-person arm mesh). Applies a
push/scale/pop around each call when
APPLY_HAND_SCALEis enabled.GUI scrolling — rewritten, no longer broken
The previous scroll implementation called
this.init()insidemouseScrolled, which re-added every widget to the list on each tick withoutclearing it first. This caused widgets to stack on top of each other
(visible as duplicated/overlapping controls).
The scroll system has been replaced with an in-place repositioning approach:
init().repositionScrollableWidgets()method callssetX()/setY()directlyon each widget reference and sets
widget.visible = falsefor any widgetfully outside the clipping window.
mouseScrolledcallsrepositionScrollableWidgets()— neverinit().scrollOffsetis clamped to[0, MAX_SCROLL]usingMth.clamp.Known limitation
"Apply Hand Scale" does not visually affect the arm while the player is holding
an item. When holding an item, the arm skin is rendered by the entity-renderer
pipeline (
LivingEntityRenderer→ player model layers), which is entirelyseparate from
ItemInHandRenderer. Scaling the arm in that context wouldrequire injecting into the entity renderer and is out of scope for this PR.
Closes #3