Releases: DemonZ-Development/Onlysleep
Releases Β· DemonZ-Development/Onlysleep
Release list
Onlysleep 1.3.0
[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: 101so 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-weatherandclear-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_PERCENTAGEAPI instead of the removed legacy string lookup. - Safe gamerule reloads: turning off
manage-gameruleor adding a world todisabled-worldsnow restores the original gamerule immediately instead of leaving it at101. - 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 returnednullafter 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.
- Replaced the live
- Sleeping players no longer wake up mid-skip in gradual mode:
- Rewrote
scheduleGradualSkipto keepworld.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.
- Rewrote
- Listener leak on
/onlysleep reload:AfkTrackerandOfflinePlayerTrackerno longer register duplicate event listeners on every reload (now properly unregistered). OfflinePlayerTrackerstale 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: replacedBukkit.getScheduler().runTask()(throws on Folia) with theSchedulerAdapterglobal 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) becauseisSleeping()is still false right after the bed-enter event. Now deduped against the authoritativesleepingPlayersset. - 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) intoSleepManager.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
[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 >= 0was always true on the first tick.
- 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
- 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 BukkitPlayerclass (which doesn't have that method). Now uses CMI's correct static API:CMI.getInstance().getPlayerManager().getUser(player).
- The CMI integration was calling
- Fixed Config Values Containing
#Being Stripped:- The
ConfigUpdaternaively stripped everything after#as an inline comment, breaking values likesymbol: "β #test". Now respects quoted strings.
- The
- 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
skipTasksfor proper mid-transition cancellation. activeTransitionsset tracks worlds currently in mid-transition to prevent spurious cancel/message events.HttpURLConnectioninUpdateCheckernow properly disconnected in afinallyblock (prevents socket leaks on 4-hour recurring checks).- Update checker recurring task is now stored and cancelled on
onDisable(). handleUpdatecommand dispatches async update results back to the main thread.AfkTracker.onPlayerMovenow null-checksevent.getTo()(is@Nullableon Paper).WorldUnloadEventlistener cleans up world state from maps to prevent memory leaks.- Added
SleepManager.cleanupWorld()for explicit per-world state cleanup.
Onlysleep 1.1.0
π 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, andgradualnight 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
configpackage - 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