Skip to content

Refactor/input helper improvements - #128

Open
0xar-ds wants to merge 26 commits into
v1.0.0from
refactor/input-helper-improvements
Open

Refactor/input helper improvements#128
0xar-ds wants to merge 26 commits into
v1.0.0from
refactor/input-helper-improvements

Conversation

@0xar-ds

@0xar-ds 0xar-ds commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

after feat/+1.21.11 (i will rebase it so it becomes 26.2, 26.3 once consumed dependencies have vers for 26.3)

  • Get the players' purse from SkyblockAPI's CurrencyAPI 90d2ded
  • Decouple the base *InputHelper from the concrete strategies (AmountStrategy, this time) b17bf74
  • Extend the logic of InstantBuyAmountHelper so it properly counts the fillable player inventory space 19f8808
  • Fix copy pasted InstantBuyAmountHelper#getButtonItemText b15f139
  • Memoize SignInputHelpers' resolved input 48ca013
    • Mostly to dedupe computation on render calls, but will also allow us to introduce a AdjustableWorkingValue such that we could plumb Mouse Scroll events to have the user feature of "adjusting a resolved input" when hovering over a input helper
      • Not including this so we have features to release post 1.0.0, same reason for which I'd argue [v1.0.0] [Feature] Orders overlay #123 should be post v1.0.0 and we should keep v1.0.0 as of a major refactor/reiteration of the codebase and its features, not an addition of new ones
  • Reset State upon sign handled 5bb8a8a
  • Standard event subscription for SignManager::SignQueueDispatcher a1aba4a

0xar-ds added 21 commits August 22, 2026 14:57
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
shadowJar was deprecated

Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
otherwise we have issues with holders initialization

Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
…x computational logic

Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
…context

Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
…g path

Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
Signed-off-by: 0xar-ds <sadden-rope-sleek@duck.com>
@0xar-ds
0xar-ds force-pushed the refactor/input-helper-improvements branch from 8779aba to a1aba4a Compare September 6, 2026 01:52
@mkram17

mkram17 commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Not including this so we have features to release post 1.0.0, same reason for which I'd argue #123 should be post v1.0.0 and we should keep v1.0.0 as of a major refactor/reiteration of the codebase and its features, not an addition of new ones

Good plan.

mkram17 and others added 3 commits September 6, 2026 18:16
The chest closing is the same server-side transition that opens the sign, so
clearing the queue on ContainerCloseEvent races the very sign open it exists to
serve. It usually loses that race harmlessly — SkyblockAPI posts the event a
tick behind the clientbound close packet, which lands it after the open-sign
packet handler in the same task drain — but nothing guarantees the two packets
arrive in one drain, and when they don't the sign silently goes unfilled.

Each handler now carries a deadline and is skipped once past it, which bounds a
handler waiting on a sign that never opens without depending on packet ordering.
Claiming the sign with CONSUMED now also discards the rest of the queue, which
is what runOnNextSignOpen already documented and what the close-clear had been
doing incidentally.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014iXqZFi27zfBERVHkLAjuj
WorkingValue cached whatever resolveInput returned, including the -1 that
getPriceForPosition yields when the bazaar reply has not landed yet. That froze
the button on -1 for the rest of the container load and typed it into the sign;
before memoization every render recomputed, so a transient miss healed itself.

resolveInput now reports failure as an empty Optional and WorkingValue caches
only a value that resolved, so a later render retries. A helper with no market
data renders a blank stack size rather than -1, and clicking it no longer opens
a sign it cannot fill. computeMaxValue returns OptionalInt for the same reason:
BuyOrderAmountHelper divided the purse by that -1, and by a price of 0 it would
have typed Integer.MAX_VALUE.

getPriceForPositionOptional carries the distinction; getPriceForPosition keeps
its -1 sentinel for the callers that only display a price.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014iXqZFi27zfBERVHkLAjuj
…er-improvements

# Conflicts:
#	build.gradle.kts
#	gradle.properties
#	settings.gradle.kts
#	src/main/java/com/github/mkram17/bazaarutils/features/gui/buttons/CancelOrderAndSearch.java
#	src/main/java/com/github/mkram17/bazaarutils/utils/minecraft/gui/widgets/TextDisplayWidget.java
#	src/main/java/com/github/mkram17/bazaarutils/utils/minecraft/item/groups/ItemGroups.java
#	stonecutter.gradle.kts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants