Skip to content

Release 1.2.0

Choose a tag to compare

@kccricket kccricket released this 23 Jun 03:56
Immutable release. Only release title and notes can be modified.
fb746fb

ClickSorted 1.2.0 adds a treemap sort method, configurable sort direction, an automatic update check, and fixes several sorting correctness bugs including an item-loss edge case.

Highlights

  • Treemap sort — a new TREEMAP sort method groups each item type into its own contiguous near-square block, sized to that type's stack count. The most numerous types claim the largest rectangles; smaller types fill in beside or below them; and when the inventory is nearly full, remaining types degrade to a gap-free linear fill so no slots are wasted.
  • Sort direction — each player can now choose which corner items are placed from (TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT) and whether rows or columns fill first (HORIZONTAL / VERTICAL), via /clicksorted set start-corner and /clicksorted set fill-axis. Both settings affect treemap placement as well as the linear sorts.
  • Automatic update check — on startup and after /clicksorted reload, the plugin queries the Modrinth API and logs a console notice if a newer release exists. Can be disabled with check_for_updates: false.
  • Item-loss fix — enchantments and other ItemMeta fields are now included in the sort-key merge-equality check, so identically typed but differently enchanted items are never merged.
  • Hover coupled to click methodsingle_click now forces sort-over-items off (it only ever triggers on an empty slot); control_drop forces it on. Switching click method adjusts the hover preference automatically, and trying to override it manually shows a clear message.

Breaking Changes

  • Minimum server version is now Paper/Folia 1.21.5

New Features

Treemap sort method

/clicksorted set sort-method treemap selects the new TREEMAP mode. Unlike NAME (linear alphabetical) and GROUP (linear by creative-tab bucket), TREEMAP assigns each item type a shelf-packed, contiguous near-square rectangle in the inventory grid. Types are ranked largest-first so the biggest stacks dominate the most visible area. The rectangle's shape is chosen to minimise wasted cells while staying close to square; types that can no longer fit cleanly fall back to filling free cells in reading order, so a nearly-full inventory degrades gracefully to a gap-free fill. TREEMAP is always available — no groups.yml required. The start_corner and fill_axis preferences (see below) control which corner the largest block anchors to and whether shelves of blocks grow horizontally or vertically.

Sort direction

Two new per-player preferences control how sorted items are written back into the inventory grid (for linear sorts) and how treemap shelves are oriented:

  • /clicksorted set start-corner <TOP_LEFT|TOP_RIGHT|BOTTOM_LEFT|BOTTOM_RIGHT> — which corner items are placed from (default TOP_LEFT).
  • /clicksorted set fill-axis <HORIZONTAL|VERTICAL> — whether rows (HORIZONTAL) or columns (VERTICAL) fill first (default HORIZONTAL).

Server admins set defaults with defaults.start_corner and defaults.fill_axis in config.yml. The new GridGeometry / SlotOrder / TreemapPacker classes implement the layout internally.

Automatic update check

On startup and after /clicksorted reload, UpdateChecker fires an async Modrinth API query. If a newer release version is available, two INFO-level lines are logged to the console with the version number and download links. Failures degrade silently to a debug log. Disable entirely with check_for_updates: false in config.yml.

Preference repair

A "preference repair" procedure runs on player join and resets any per-player PDC value that can no longer be parsed as its expected type (e.g. a stale enum name from an old version). Each reset preference sends the player a chat notice (prefResetInvalid in lang.yml) naming the preference, the bad value, and the new default.

Bug Fixes

  • Item loss from same-material stacks with differing meta — Merge equality now includes ItemMeta, so enchanted and plain tools are never collapsed together. Previously, merging a stack of stackable items with different enchantments could silently discard the extras. [PR #46]
  • Lifted stack not re-deposited on DOUBLE_CLICK — a double-click sort left the item on the cursor unreturned to the inventory if the click initiated the sort. The stack is now placed back before writing sorted results.
  • SINGLE_CLICK sort could fire over an occupied slot — the sort-over-items gate now enforces that single_click only triggers on an empty slot unconditionally (hover is forced off for this method).
  • Sort grid origin not row-aligned — now aligns the sort origin to the first full row of the inventory, preventing partial-row layouts at the top of large containers.
  • Real chest grids and fill-axis not honoured — the slot-order implementation now correctly reflects actual chest grid dimensions and respects the fill-axis setting end-to-end. [PR #46]
  • Log not null-safe before onEnable — the logger handle is now checked for null before early log calls during plugin load.

Other Improvements

  • Deduplicated enum/boolean PDC accessors in PlayerSortingPrefs using a shared accessor pattern; sortable_inventories is now backed by an EnumSet.
  • GridGeometry is now the single authoritative source for the mount-slot offset used in player inventory layout.
  • New lang.yml keys: setStartCornerTo, setFillAxisTo, hoverForcedByClickMethod, hoverGovernedByClickMethod, prefResetInvalid, invalidValue, statusStartCorner, statusFillAxis.
  • New lang.yml key: prefix — a configurable MiniMessage string prepended to every status, error, and alert message sent to players. Defaults to <gray>[<aqua>ClickSorted<gray>] . Set to "" to disable. Lock-GUI item names are not affected.
  • Unified command-feedback messaging: all player-facing set …/status/reload messages were reworded for a consistent voice and now default to white text. /clicksorted set … subcommands also send a clear invalidValue error when an argument can't be parsed, naming the bad value and listing valid options (previously invalid input was silently ignored). [PR #47]
  • Treemap grouping refined: durable items get their own block per meta variant while non-durable items (including bundles) group by material, with a stable within-block stack order (enchanted books ordered by primary enchantment), and rectangle selection now prefers squareness over minimal waste. [PR #48]
  • README and CLAUDE.md updated for sort direction, the update check, hover coupling, preference repair, and the new config/lang keys.

Compatibility

✔️ Paper/Folia 1.21.5 – 26.1.x
✔️ Java 21+

Upgrading

  1. Stop your server.
  2. Replace the old jar in plugins/ with this release.
  3. Start your server.

Note: The two new per-player preferences (start_corner, fill_axis) are read from config.yml defaults if a player has never set them. No manual migration is needed.

What's Changed

  • Add Modrinth-based update check by @kccricket in #45
  • Add TREEMAP sort method, sort direction (start corner + fill axis), and treemap layout engine by @kccricket in #46
  • Unify command feedback messages and add configurable prefix by @kccricket in #47
  • Refine treemap grouping/ordering so bundles and meta variants pack correctly by @kccricket in #48
  • Couple hover preference to click method, repair invalid prefs by @kccricket
  • Fix item loss from same-material stacks with differing ItemMeta by @kccricket
  • Fix re-deposit of lifted stack on DOUBLE_CLICK sort by @kccricket
  • Fix SINGLE_CLICK sort over occupied slots by @kccricket
  • Fix sort grid alignment and chest grid layout by @kccricket
  • Dedupe enum/boolean accessors and EnumSet sortables by @kccricket