qshop-neoforge-26.1.2-1.9.0
Curse Maven Snippet
What's new
1.9.0 - 2026-12-04
Added
- Added an optional currency price display hook (
QShopAddonApi#registerPriceDisplay/CurrencyPriceDisplay), so a currency with denominations can be drawn as denomination text (for example2 金币 2 银币) instead of one flat smallest-unit number. Hooks are tried in registration order, and anullanswer keeps the previous formatting, so other currencies and addons without a hook are unaffected.CurrencyService.API_VERSIONis now1.2.0. - The hook returns a
Componentrather than aString, so denominations keep their own colours (a plain string could only express the 16 legacy§colours). It also receives the compact pixel budget, so a hook can adapt to whichever grid (7x3 or 8x4) is on screen, and it may overridecompactScaleto draw its currency at a smaller scale when its text is wider than QShop's ownnumber + 货币名. - The balance bar (bottom-left) now goes through the same hook: compact text on the button, full text in its tooltip.
Changed
- Shop prices now go through
CurrencyDisplays.format(currencyId, amount, compact, budgetPx, fallbackName)in one place: cell text, price tooltip, buy/sell tooltip lines, trade panel price row, purchase total and the balance bar. The amount itself is still kept in the smallest unit, so a display hook can never round a price or change a trade result. - A hook may now also choose the drawing scale for its own currency through
compactScale(currencyId); returning0keeps the historical behaviour, so a shop without the hook still draws prices at 0.6 with the originalcellW - 2clipping and looks exactly as before. When a hook does ask for a smaller scale, QShop clips at the unscaled font width ((cellW - 2) / scale) instead — the old fixedcellW - 2clip sliced the trailing unit off wider texts (18 银 60 铜was rendered as18 银 60). - The fallback currency name comes from the currency list the server syncs to the client (the
same
Currency.displayNameText()the shop already used), so a hook never changes which name is shown when it declines a currency. CurrencyRegistrygainedcompact(double)— the K/M/B abbreviation that used to be private toShopScreen— so the default formatting and any display hook share one implementation.
Fixed
qshop.gui.total_priceis now a single%splaceholder (合计: %s/Total: %s/Gesamt: %s), because the formatted price already carries the unit name.
All Relations
- All Relations
- Embedded Library
- Optional Dependency
- Required Dependency
- Tool
- Incompatible
- Include