Skip to content

StoneLib 2.2.0

Latest

Choose a tag to compare

@github-actions github-actions released this 29 Sep 07:03
b3c90be

StoneLib 2.2.0 brings native Bedrock forms, Folia-ready scheduling and a set of new gameplay modules, and fixes memory leaks in the scheduler, cooldowns and dialogs that could eventually exhaust memory on busy servers.

New

  • Bedrock forms. Bedrock players now automatically receive the equivalent native form for every FormDialog. BedrockForms sends modal, button-list and custom forms through Floodgate when it is installed, and does nothing when it isn't, so servers without Floodgate never load its classes. FormDialog.prompt() builds button dialogs.
  • Paper and Folia scheduling. PlatformScheduler provides entity, region, global and async scheduling on Paper's regionised schedulers, so one code path serves both Paper and Folia.
  • Safer versioned configs. VersionedConfig checks that the server's file parses before migrating it. A file that fails to parse is never overwritten: the error is logged with its position and the bundled defaults are used until a reload finds it fixed. Comments survive set().
  • Combat tags. CombatTagService tracks which players are in combat, with enter and leave listeners.
  • Block ownership. BlockOwnership, ExpiringOwners and BlockPositions track who owns blocks, with expiry and a true nearest-owner search.
  • Invites. InviteRegistry manages expiring invitations with anti-spam rules.
  • Debounced file writes. DebouncedFileWriter coalesces writes and saves them atomically off the main thread.
  • Update checks. UpdateChecker and Versions check GitHub releases asynchronously.
  • Clickable buttons. Buttons builds components that run or suggest a command when clicked.

Improved

  • MessageService can read messages from a section of another file, accepts older %name% placeholders, and exposes the prefix.
  • CommandRouter has configurable feedback for its own replies, an onNoArguments handler and player-only sub-commands (SubCommand.playerOnly()). Tab completion never returns null.
  • ConfigUpdater treats a config file with no config-version as version 1, so later migrations still apply to it, and writes the version as a number instead of the string '2'.

Fixed

  • Scheduler memory leak. SchedulerService kept every task it scheduled until cancelAll(), so finished tasks and everything they captured stayed in memory for the life of the plugin. On a busy server this could end in OutOfMemoryError. Finished tasks are now released, and supplyAsync skips its callback if the plugin was disabled in the meantime.
  • Cooldown buildup. CooldownService now sweeps expired entries, so players who never return don't accumulate.
  • Dialog callbacks. FormDialog callbacks now expire after 30 minutes instead of Paper's 12-hour default, so unclicked buttons no longer hold on to what they captured.
  • Closing Bedrock forms. Closing a Bedrock form now runs the dialog's exit handler, matching Escape on Java. GUIs that reopen from the exit handler previously stayed closed for Bedrock players.