Skip to content

Releases: DemonZ-Development/Onlysleep

Onlysleep 1.3.0

Choose a tag to compare

@github-actions github-actions released this 12 Jul 11:03

[1.3.0] - 2026-07-12

This release makes advertised features work, hardens Folia thread safety, fixes gradual skipping, and closes reload and memory leaks.

Added

  • Automatic gamerule management: enabled worlds temporarily use playersSleepingPercentage: 101 so vanilla cannot race the plugin's configured sleep threshold. Each world's original value is restored when management stops, the world unloads, or the plugin disables.
  • World sleep sounds: configurable sounds now play when a player enters a bed, when weather is cleared, and when the night skip completes.

Changed

  • Version compatibility: the release JAR now compiles against Paper 1.20.4 with Java 21 bytecode, while CI compiles and tests every available Paper API target through Paper 26.2 alpha.
  • Independent weather controls: rain and thunder can now be cleared separately with clear-weather and clear-thunder.
  • Disabled gamemode filtering: disabled gamemodes are excluded from both the sleeping count and the eligible-player total.

Bug Fixes

  • Paper 26.1 startup crash: gamerule management now uses the typed GameRule.PLAYERS_SLEEPING_PERCENTAGE API instead of the removed legacy string lookup.
  • Safe gamerule reloads: turning off manage-gamerule or adding a world to disabled-worlds now restores the original gamerule immediately instead of leaving it at 101.
  • Dynamic world lifecycle: worlds loaded after plugin startup receive the configured override, while unloading worlds are restored and removed from tracked state.
  • Boss bar no longer shows "Unknown" when the initiating sleeper logs off mid-skip:
    • Replaced the live Bukkit.getPlayer(uuid) lookup (which returned null after the player logged out, falling back to "Unknown") with a per-world snapshot of the initiating player's name, populated at skip-start. The boss bar and deferred title both read from the snapshot, so attribution survives the player going offline.
  • Sleeping players no longer wake up mid-skip in gradual mode:
    • Rewrote scheduleGradualSkip to keep world.getTime() parked at the original night value for the entire animation. setTime() is now called exactly once β€” at the final tick β€” to snap to the morning target. This prevents vanilla's wake-up threshold (world.getTime() > 23458) from being crossed mid-animation, which previously caused players to be kicked out of bed before the skip's completion effects fired.
  • Listener leak on /onlysleep reload: AfkTracker and OfflinePlayerTracker no longer register duplicate event listeners on every reload (now properly unregistered).
  • OfflinePlayerTracker stale cache after reload: shutdown now resets the cached count so the "not loaded" sentinel works again.
  • Off-thread Bukkit calls in update checker: OP update notifications now dispatch to the main/global thread instead of running on the ForkJoinPool.
  • Folia crash on /onlysleep update: replaced Bukkit.getScheduler().runTask() (throws on Folia) with the SchedulerAdapter global task.
  • "Good morning" broadcast no longer leaks server-wide: skip/Weather-clearing messages are now scoped to the world that actually skipped, consistent with per-world sleep.
  • AFK double-count fixed: with count-afk-as-sleeping, a just-bed-entered player was counted twice (once in the sleeping set, once as AFK) because isSleeping() is still false right after the bed-enter event. Now deduped against the authoritative sleepingPlayers set.
  • Off-thread getOfflinePlayers() call: moved from ForkJoinPool to a scheduled global task (thread-safe on all server impls).
  • Thread-safe state: SleepManager maps and sets now use concurrent collections, preventing corruption on Folia region threads.

Technical Improvements

  • Broad server-version support: gamerule handling uses a version-aware typed API across the supported Minecraft 1.20.4–26.2 range.
  • Extracted shared night-time bounds (12542–23458) into SleepManager.NIGHT_START_TICK / NIGHT_END_TICK + isNight(), reused by the listener and PlaceholderAPI expansion.
  • getSleepingPlayers() returns an unmodifiable view for safe PAPI iteration under concurrency.
  • Added coverage for gamerule reconciliation, dynamic world lifecycle, disabled-gamemode exclusion, independent weather clearing, and gradual skip state.

Onlysleep 1.2.0

Choose a tag to compare

@sdemonzdevelopment-spec sdemonzdevelopment-spec released this 21 May 11:52

[1.2.0] - 2026-05-21

This release fixes critical bugs across the sleep skip system, AFK detection, config handling, and more.

πŸ› Bug Fixes

  • Fixed Gradual & Speed Skip Completing Instantly:
    • Rewrote the time-advance logic using a distance-traveled approach that correctly handles the nightβ†’midnightβ†’morning wrap-around. Previously, both modes behaved identically to instant skip because newTime >= 0 was always true on the first tick.
  • Fixed "Good Morning" Message Appearing During Night:
    • Deferred all completion effects (sounds, titles, messages, cleanup) into a callback that only fires after the gradual/speed timer actually finishes.
  • Speed vs Gradual Now Visually Distinct:
    • Speed mode (150 ticks/tick, ~2-3s timelapse) and gradual mode (default 30 ticks/tick, ~6-8s sunrise) now feel genuinely different.
  • Fixed Bed Leave Unconditionally Cancelling Skip:
    • Previously, any single player leaving their bed cancelled the skip for everyone, even if enough players were still sleeping. Now only cancels when the sleeping count drops below the threshold.
  • Fixed Spurious "Cancelled" Message During Gradual Skip:
    • When vanilla kicked players out of bed at dawn during a gradual transition, a "Player has stopped sleeping" message appeared right before "Good Morning!". Bed-leave events during active transitions are now ignored.
  • Fixed Player Quit Not Rechecking Sleep Status:
    • When a non-sleeping player quit, the total player count decreased but the sleep threshold wasn't rechecked. Now properly triggers a skip if the remaining sleepers meet the new lower threshold.
  • Fixed CMI AFK Detection Always Failing:
    • The CMI integration was calling getCMIPlayer() on the Bukkit Player class (which doesn't have that method). Now uses CMI's correct static API: CMI.getInstance().getPlayerManager().getUser(player).
  • Fixed Config Values Containing # Being Stripped:
    • The ConfigUpdater naively stripped everything after # as an inline comment, breaking values like symbol: "β– #test". Now respects quoted strings.
  • Fixed Misleading "No one needs to sleep" Message:
    • When a skip is already in progress, players now see "The night is already being skipped!" instead of the confusing "No one needs to sleep right now."
  • Removed Duplicate "Monsters Nearby" Message:
    • Vanilla Minecraft already shows its own "You can't sleep β€” monsters are nearby" message. The plugin's custom message stacked on top, causing players to see it twice.

πŸ› οΈ Technical Improvements

  • Gradual/speed timer tasks stored in skipTasks for proper mid-transition cancellation.
  • activeTransitions set tracks worlds currently in mid-transition to prevent spurious cancel/message events.
  • HttpURLConnection in UpdateChecker now properly disconnected in a finally block (prevents socket leaks on 4-hour recurring checks).
  • Update checker recurring task is now stored and cancelled on onDisable().
  • handleUpdate command dispatches async update results back to the main thread.
  • AfkTracker.onPlayerMove now null-checks event.getTo() (is @Nullable on Paper).
  • WorldUnloadEvent listener cleans up world state from maps to prevent memory leaks.
  • Added SleepManager.cleanupWorld() for explicit per-world state cleanup.

Onlysleep 1.1.0

Choose a tag to compare

@sdemonzdevelopment-spec sdemonzdevelopment-spec released this 21 May 10:33

πŸ“‹ Changelog

For the full changelog, visit the Onlysleep Wiki.


[1.0.0] - 2025-06-01

πŸš€ Major Changes

  • Complete rewrite with modular package structure
  • Folia support β€” Full compatibility with Folia's regionized scheduler
  • bStats integration β€” Anonymous usage statistics (ID: 31415)
  • Platform detection β€” Auto-detects Bukkit, Spigot, Paper, Folia

✨ New Features

  • One-Player Sleep β€” Default mode, or configure any percentage
  • Custom skip types β€” Support for instant, speed, and gradual night skips
  • Per-World Sleep β€” Per-world or global sleep counting
  • Weather Skip β€” Automatically clear storms and thunderstorms
  • Title/subtitle support β€” Configurable titles when night is skipped
  • Sound system β€” Fully configurable sounds for skip events
  • Visual Feedback β€” Boss bar, action bar, progress bar, and title support
  • AFK detection β€” EssentialsX and CMI integration
  • Disabled worlds β€” Per-world sleep disabling
  • Advanced player filtering β€” Creative mode, flying, spectator, and exempt controls
  • Better command system β€” /onlysleep status, /onlysleep update, tab completion
  • Update checker β€” Automatic update checks via Modrinth API with /onlysleep update
  • PlaceholderAPI β€” 19+ placeholders for integrations
  • Progress bar customization β€” Configurable symbols and length
  • Smart Player Filtering β€” Ignores AFK, spectators, exempt players, and more

πŸ› οΈ Technical Improvements

  • SchedulerAdapter β€” Folia-compatible task scheduling with fallback
  • Multi-version compatible β€” Works on Minecraft 1.16.5+
  • Dedicated config package β€” ConfigManager in config package
  • Command package β€” Clean command separation
  • Listener package β€” Event handling in dedicated package
  • Manager package β€” Core logic separation
  • Utility classes β€” PlatformAdapter, SchedulerAdapter, UpdateChecker, AfkTracker
  • bStats shading β€” Proper bStats relocation to avoid conflicts
  • Resource filtering β€” Dynamic version in plugin.yml

πŸ“ Documentation

  • Comprehensive README.md with banner image
  • Modrinth description (MODRINTH.md)
  • Spigot BBCode listing (SPIGOT.md)
  • Hangar description (HANGAR.md)
  • Full GitHub Wiki with 12 pages
  • CHANGELOG.md

Initial Release

  • Basic one-player sleep functionality
  • Configurable sleep percentage
  • Per-world support
  • Boss bar display
  • Basic command system