SmoothSleep icon

SmoothSleep -----

Smoother, multiplayer friendly sleeping.




Only update to this version if you're using 1.17!

This update only disables NMS modification of the sleepTicks value as it has been renamed and/or moved in 1.17, causing exception spam.

This will cause vanilla sleep mechanics to interfere in some cases (allowing it to turn instant day if everyone online is sleeping).
----------, Jul 5, 2021

This is a very minor update that adds a config option to disable update checking. Not sure why I never implemented it before. Thanks to @Cha_Shao for pointing this out. Something this minor wouldn't generally prompt me to release a new version, but it felt important to include.

Just a heads up: I haven't tested this extensively since nothing significant was changed. If something breaks, let me know!
----------, Apr 30, 2021

Built against Java 11!
Use the link below to download a version built against Java 8 if you get an exception during startup

https://github.com/OffLuffy/SmoothSleep/releases/tag/v2.11.0-Java8

This release is not fully tested!
I don't run my own server or play much at all now, so the only testing has been feedback from a couple other server admins.

This version is being released primarily to fix the random tick speed issue that started becoming more frequent in recent server versions. I did not add the config option I talked about in the discussion (seems like the bug fix made it no longer necessary to do so).

Additionally (and since jpenilla on github did the work for me), there's now support for Purpur's AFK detection when Essentials or CMI aren't installed.

For whatever reason, previous versions of the jar had CMI API packaged with it. Now it doesn't (hence the massively reduced file size). Hoping this doesn't break compatibility with CMI.

As usual, if something is breaking, let me know!
----------, Feb 19, 2021

Finally, some new features! The biggest change in this version adds a speed multiplier that only kicks in when everyone (not sleep-ignored) is asleep. This should allow a little more flexibility for those who want night to pass slowly until everyone is sleeping. This setting is ignored if you have instant-day enabled. This could make the curve setting less useful, but I get the feeling it isn't used too much anyways. If you don't wish to use this feature, setting all-sleeping-speed-mult equal to the max-night-speed-mult will effectively be the same as the previous version.

Additionally, at the behest of a stranger on Discord, I've added:

1) Hex color code support to configurable messages. You can now use &#000000 or &#000 hex formats to specify text color. The shorter form is expanded internally like so: &#ABC = &#AABBCC

2) Boss bar styles have finally been added to the config. If an invalid style is given, the plugin will warn you in the console (listing valid styles) and revert the setting to 'SOLID'. Valid styles are: SEGMENTED_6, SEGMENTED_10, SEGMENTED_12, SEGMENTED_20, SOLID

---

The hex color codes are rather new to me, so let me know if something doesn't quite seem right. Likewise, if you find any issues, please post them in the discussion (and include your server and plugin versions, ideally from the /version and /version smoothsleep commands on your server). Enjoy!
----------, Aug 2, 2020

Releasing a small patch that allows hooking to the CMI plugin. If you don't use CMI, this update will not change anything for you other than the config section essentials-settings will be renamed to compatibility-settings. This is handled automatically by the plugin. I haven't tested these features thoroughly (I don't currently own CMI), although preliminary testing has been done with a big thanks to @Danne073 !

I don't necessarily recommend using CMI in conjunction with SmoothSleep since it has a similar system for sleeping. This may cause certain configurations to conflict. This update will simply allow SmoothSleep to ignore players in a similar fashion as the Essentials integration and use CMI's nicknames for built-in placeholders.

As per usual, let me know in the discussion if an update breaks something; Otherwise, enjoy!

Unrelated note: Someone pointed out to me recently that Github was not showing my changes. My IDE stopped pushing commits and wasn't telling me for whatever reason. It's been fixed now and the master branch should be in sync again with the current release on Spigot. Interim changes will happen on the dev branch.
----------, Jul 24, 2020

- Now compiled against Paper 1.16.1-R0.1
- Updated dependency versions (bStats, PlaceholderAPI, EssentialsX)
- Fixed a deprecated method responsible for applying potion effects
- Fixed a NullPointerException being thrown when reloading before TickHelper is instantiated.

Please report any bugs in the discussion!
----------, Jul 5, 2020

  • Weather should now clear in the morning if enabled in the config.
  • The plugin still ticks down weather duration internally while sleeping, but this doesn't seem to have any effect on the actual weather, so having weather duration decrease smoothly remains a wet dream (pun intended)
  • SmoothSleep is now compiled against Paper 1.15.2
Thanks to @deiphiz , @lexitehgallade , and @Akuyi for pointing out that the weather clearing was broken. It was, in fact, me completely omitting the code that would clear the weather.

No changes have been made in regards to phantoms. I can't replicate the issue on my side where the rest timer doesn't reset when sleeping. If you are having issues with them, please include a list of plugins (I strongly suspect another plugin is the culprit).

As per usual, enjoy!
----------, Apr 14, 2020

  • Small update to fix a warning message displayed if an invalid potion effect is used in the sleep-rewards section (kudos to @Cyats for finding it) -- No functional changes in this update.
----------, Nov 18, 2019

Very small update so that players in Spectator mode are now treated as sleep ignored (thanks to @JustEli for letting me know I overlooked that bit)
----------, Oct 29, 2019

v2.7.0 (previous snapshot released only on GitHub)
  • Added a method to set the 'base time speed' that SmoothSleep will operate with. This allows other plugins to modify time and be able to tell SmoothSleep what base speed to apply modifications to. Thanks to @NanoAi for this idea and testing the implementation.
v2.7.1
  • If configured to feed players overnight, SmoothSleep will now add saturation if the food level is maxed out to prevent hunger from depleting naturally. Thanks to @wolfling_ for pointing this out.
  • Modified some placeholders. Health bar and percents previously only considered max life to be 20, so changed it to accept other values. This may make the bar slightly less accurate, but it's a start.

Caveats:
  • The modified feed cycles will add 1.0 saturation level for each iteration that hunger is applied. This allows reaching max saturation of 20.0, which may be a little overpowered. It probably makes more sense to only allow it to add up to 1.0 saturation (or a configurable value). Of course, this will only affect you if you have the plugin configured to feed the players overnight.
----------, Oct 6, 2019

  • Includes the previous snapshot release (v2.6.2) to prevent NPCs from altering the sleeper count.
  • Now considers the Player's max health when healing overnight, instead of capping it at 20 (should account for max health above and below 20)
----------, Sep 15, 2019

  • Fixed the boss bar not being removed properly when the last sleeper leaves the bed before morning. (Thanks to @LoneDev for pointing out this issue)
  • Removed 'enable-data-share' from the default config, no longer being used (data sharing was removed in 2.6.0). It won't be removed automatically from existing configs, but it's safe to remove if you want to.
  • Let me know if I've broken something else!
Still planning for the next major version to be a complete re-write.
----------, Aug 28, 2019

  • Native version is rolled back to 1.13 for backwards compatibility. Hopefully this doesn't affect 1.14 servers performance-wise.
  • Can now modify game rule randomTickSpeed to allow faster crop growth, leaf decay, etc while sleeping. SmoothSleep will take the current randomTickSpeed and add a tick for each tick faster it happens to be accelerating night that tick. (not configurable yet).
    • This may mean that if you're already using a really high randomTickSpeed, it'll have a less apparent effect vs using the default randomTickSpeed of 3 (or just lower values in general).
  • min/max night multiplier calculations now work a little differently
    • One player sleeping (unless the only player online or only one not sleep ignored) will cause the min multiplier to be used instead of a multiplier between the min and max.
  • Villagers are now fully healed if they're in bed in a SmoothSleep-enabled world in the morning (had a report that villagers didn't heal with the plugin enabled, so this is just in case I broke that feature).
  • You can now use PlaceholderAPI placeholders in textual values in the config. Built-in placeholders are still supported, which means you can mix and match them. Built-in placeholders are also parsed first, so you should be able to use them within PAPI placeholders if it supports a value within the placeholder.
  • Added auto-complete support to some commands, namely /ssconf and /ssaddworld (which only lists worlds not already enabled)
  • Removed the data-transmit added in 2.5.0 - just turned out not to be terribly useful.
I've only tested this release in a 1.14.4 server. The native version just means that I've told Spigot to handle it with a 1.13 API compatibility. I can't guarantee that it'll work in a 1.13 server currently though.

If you have issues with this version, please let me know in the discussion!
Here are a few things that are helpful to include:
  • Any errors in the console
    • Even if the issue didn't happen during start up, see if there are start up errors. Sometimes a failure during initialization won't be obvious until later.
  • Server version and plugin version
    • Output from /version and /version SmoothSleep
  • Plugins you use along-side SmoothSleep
  • If you use a Bungeecord server that passes players to the server that uses SmoothSleep (this may have some effect on caching player data).
I'll update the overview page with new configuration settings soon!
----------, Aug 24, 2019

This patch is mostly to add a permission node for the new sleep rewards feature. The permission is 'smoothsleep.sleepreward', and is granted by default (hopefully).

I've also tweaked a few really minor things. Removed some debug output lines and such, so hopefully less spam for people who like keeping debug on. I've also set the default value of the notify on login option to false since it can be annoying, especially if I keep finding reasons to release small patches.

tl;dr - There are no bug fixes or such in this version vs 2.5.0, so don't feel compelled to update, just minor tweaks and a permission for sleep rewards.
----------, Jul 24, 2019

v2.5.0 for 1.14.4
  • Includes a new sleep-rewards feature (no longer just a broken fragment in the config)
  • Now, if enabled, transmits some basic server details to a web server (I'll edit the overview page soon with more info)
    • If the config was just generated, no data will transmit until next load, and a message will print to console notifying how to disable.
  • New events that are called when the plugin considers night to have started and ended. This allows me to update cached player permissions when night starts.
  • Updated dependencies to Paper 1.14.4, EssentialsX 2.17, bStats 1.5
  • Native API version bumped to 1.14.4
Enjoy!
----------, Jul 23, 2019

Releasing a version for 1.14.1 just to get things moving.

I'm still working on fixing an issue where it skips night instantly when there's a single player online and they sleep, but since it only seems to do so when only one person is online, it shouldn't cause huge problems at least.

If you find other issues, please let me know!
----------, May 15, 2019

Another patch, no new features.

  • Somehow completely overlooked changing weather when the time hits day. Added this back in. Unfortunately, I can't instantly change weather to my knowledge, so if it's storming, it'll still likely keep you in bed. It's best effort for now. Thanks to @CatPasswd for pointing this one out.
  • I was using a Paper-only method to clear titles which was throwing NoSuchMethodException on servers not using Paper. I've changed it now to a method that should exist on Bukkit, Spigot, and Paper. Thanks again to @muzyeh
----------, Mar 10, 2019

A patch for a NullPointerException thrown presumably when a player's data is removed while spawning waking particles (either by logging off or changing worlds). Thanks for pointing it out, @muzyeh

No new features here, hopefully just a bit less console spam. If you notice any more console spam generated by my plugin, please let me know!
----------, Mar 4, 2019

Completely restructuring of the plugin and tasks. Many things fixed, some hopefully improved, and a few new features.

I likely won't be able to go into super fine detail and list all the changes (for that, check out the github repo and the latest push differences), but otherwise, here's a few of the major changes!

  • Boss Bars - You can enable a boss bar which shows the progress of night and a configurable title supporting placeholders. The color of the bar is configurable (it can be blue, green, pink, purple, red, white, or yellow)
  • New Placeholders - I've added a few new placeholders that allow you to display the user's health and food level. They are {HEALTH}, {HEALTH_PER}, {HEALTH_BAR}, {FOOD}, {FOOD_PER}, and {FOOD_BAR} -- The BAR variables insert a 20-segment bar that can be any colored like normal text, but the empty portion of the bar is set to black. The PER variables will use a percentage (with the % sign after it) indicating the level. The normal variables will simply be 0-20.
  • Config Updater - I've moved around quite a few things in the config, and to prevent you from needing to regenerate it, the plugin should now update and migrate your old values for you. Instead of all the comments at the top, I've simply linked the overview page at the top of the config (which I will update when I get some time hopefully)
  • Action Bar Methods - The action bar has a few different methods of being sent depending on if you're using Bukkit, Spigot, or Paper. I'm not checking for which version and using the appropriate method. Doesn't change anything for the users, but hopefully it'll just work a bit better if you're using Spigot or Paper vs the NMS method required for Bukkit.
  • Update Notifier - The plugin will now notify users with the smoothsleep.notify permission if there's an update available on Spigot when they login. It checks for updates when the server is started or reloaded, and caches that for login events.
  • Particle Patterns - There's a new config option that can somewhat shape the particle effects that are displayed upon waking up in the morning. Available patterns are 'random', 'circle', and 'spiral'
As I've mentioned, everything I've done is part of a major re-write, so there's likely to be a few more bugs than usual. If you find something that doesn't work properly, please report it in the discussion page! I've tested as much as I could think to test with a simple alt account. Enjoy!
----------, Feb 17, 2019

  • Cache sleep ignore perm players to prevent checking perms every tick for every player at night (Thanks to @Steampunk_Sam for pointing this out)
  • Added action bar that display to all players online, letting everyone know when players are sleeping (configurable text with placeholders, like the titles)
  • Updated dependency to Bukkit 1.13.2

It's been a while since I've opened this, and apparently there were some things I was working on (one seemed to involve weather, but I've removed those changes, couldn't sort out what I was trying to do). And not gonna lie, don't remember adding the action bar thing, but it works, so enjoy!

As per usual, let me know if something isn't working properly, I can only test to a limited extent. Thanks!
----------, Jan 1, 2019

  • Added a new config option (night-speed-curve) which lets you tweak how the percentage of players sleeping affects the night speed. Please refer to the config section on the overview page for information about how this works and for a visual reference. The default value should mimic the old style. Thanks to _theminerdude_ aka Drathares @ NarniaMC for helping with this formula!
  • Fixed a bug that may have been around for a while: new options added to the config didn't insert the proper default value into older configs.
  • Updated the pom.xml to build against Bukkit 1.13.1
----------, Sep 12, 2018

- Fixed the 12 hour placeholder showing 0 for midnight
- Implemented custom logger
- Now checks spigot for latest version on startup and prints a warning if the latest spigot version isn't the installed version.
- The JAR file will no longer have the version in the file name so that it's not necessary to delete the old plugin when updating after this version (strictly for convenience)
----------, Sep 9, 2018

- Players can sleep during the day if it's storming, and vanilla mechanics should now apply, rather than being indefinitely stuck in bed.
- Added a command to add a world with default values (/ssaddworld)
- Added a command to configure world settings (/ssconf)
To be honest, thought I uploaded these changes already
Please report any bugs in the discussion! I get a feeling that I've left something half-finished >.>
----------, Aug 17, 2018

This version will work with both 1.12.2 and 1.13 -- I haven't tested extensively, but very basic attempt hasn't shown anything wrong.
  • Added smoothsleep.ignore permission that will allow players to bypass being counted as awake without needing another plugin to mark them as sleep ignored.
  • Added metrics. If you don't want to use the metrics on your server, set enable-metrics: false in the config or use /ssmetrics to toggle it.
  • Replaced several instances of iterating over Map keySets with entrySets to prevent doing several map look-ups for loop.
----------, Jul 31, 2018

Update for 1.13-pre7, added api-version: 1.13 in plugin.yml

I haven't properly bumped semantic versioning ever, but going to bump to major version 2 since plugins compiled against 1.13-pre7 API aren't necessarily compatible with 1.12.2 (untested)

Properly added config options for particle effects. Now particles will spawn 1 per tick instead of all in one tick, effectively making the particle effect have a duration. I'd recommend reading the configuration part of the overview for more details, like how specific particles won't work if they require extra data.

Removed outdated intro and added new option descriptions in config.yml
----------, Jul 22, 2018

  • Added a soft-dependency on Essentials.
    • Option to ignore AFK non-sleepers
    • Option to ignore vanished non-sleepers
    • New placeholders for Essentials nickname ({NICKNAME} and {NICKNAME_STRIP})
  • Options to adjust health and hunger overnight
  • Options for healing positive and/or negative potion effects in the morning if the player has slept for a configurable amount of in-game hours (including timescaled hours)
  • Overhauled the config handling in light of all the extra options I've been adding.
Some features were not thoroughly tested (AFK/Vanish ignore mostly). If they don't work, please let me know in the discussion or, if you prefer, submit an issue on the github page!

Latent note, I've also added some fancy particle effects when you're kicked out of bed in the morning. I hadn't really intended for this to stay. I had done it mostly to amuse myself, and then forgot about it. It's probably fine.
----------, Jul 17, 2018

  • Added several placeholders: {12H}, {24H}, {MIN}, {MER_UPPER}, {MER_LOWER}, {SLEEPERS}, {WAKERS}, {TOTAL}, {TIMESCALE} (These are documented on the overview page, and now allows you to use a 24-hour clock)
  • Made morning and sleeping subtitles and titles configurable with the ability to parse placeholders
  • Added the option to instantly set time to day if everyone is sleeping. (More instant than vanilla)
  • Used apache.commons.lang StrSubstitutor instead of manually using String replace for placeholders. This may be a negligible change, but seemed cleaner.
----------, Jul 14, 2018

Added quite a few more placeholders that can be used in the morning-subtitle config option. Here's a list of them as they are now: (Note that {PLAYER} has been replaced with {USERNAME}, if you still have {PLAYER} in your config, the plugin will automatically update it for you.)

{USERNAME}
The player's username (not always the one that is displayed in game)

{DISPLAYNAME}
The player's name as it is shown in game. May contain prefixes, color codes, etc.

{LEVEL}
The player's current level

{DAYS_LIVED}
The number of days that the player has lived

{REM_HOURS_LIVED}
The number of hours the player has lived after subtracting days

{REM_MINS_LIVED}
The number of minutes the player has lived after subtracting days and hours

{TOTAL_HOURS_LIVED}
The number of hours that the player has lived (total hours, doesn't subtract days)

{TOTAL_MINS_LIVED}
The number of minutes that the player has lived (total minutes, doesn't subtract hours or days)

{TIME_LIVED}
The time the player has lived in days, minutes, and seconds; formatted as '0d, 0h, 0m'

{WORLD}
The name of the world that the player is sleeping in

{SERVER_IP}
'server-ip' specified in server.properties

{SERVER_MOTD}
'motd' specified in server.properties (including colors)

{SERVER_NAME}
'server-name' specified in server.properties (including colors)

{SERVER_MOTD_STRIP}
'motd' specified in server.properties (stripped of colors)

{SERVER_NAME_STRIP}
'server-name' specified in server.properties (stripped of colors)


---

For those of you installing this plugin for the first time, the first run will have all this information in the config as comments, but as soon as it re-saves it later, those comments will disappear. Also note that I can't exactly vouch for the accuracy of the _LIVED placeholders, but in my limited testing, they seem to work.

When using placeholders that can be colored (display name, server name, and server MOTD) you may want to include a color character after the placeholder to prevent it from coloring the rest of your message.

One other thing I kinda fixed was that if you turned the speed multiplier up too much, it could possibly quite drastically skip the time which you are supposed to wake up. And since we're all such huge proponents of getting up on time, I've made it so that the plugin will no longer skip more time than it should (always stopping at 5:27am or so).
----------, Jul 6, 2018

v1.0.6 introduces a re-worked system, utilizing a minimum and maximum multiplier to determine the night speed

Additionally, there's now options to play sounds to players when they're woken up, and weather clearing.

Lastly, I've updated the Player#sendTitle to use the non deprecated overload, and removed the optional dependency on TitleAPI.

Tested (very quickly) on Bukkit, Spigot, and PaperMC v1.12.2
----------, Jul 4, 2018

Added an optional dependency on TitleAPI. If you have it installed, CarbonSleep uses it instead of Spigots sendTitle method, which should fix the flickering titles.

I've also added a per-world use-titles option to config.yml - This will be added to the config when this version initializes, defaults to true. This is mostly so you can disable titles entirely if they're flickering for you and you don't want to use TitleAPI.

I've tested this on my server running Spigot 1.11.2 and it seems to work both with and without TitleAPI. If ya have issues, be sure to hit up the discussion.
----------, Feb 11, 2017

  • Fixed the wake-up title displaying the wrong username if more than one player is sleeping/waking up.
  • Fixed the titles flickering due to title timings by executing a server command. This is executed and will print out the console when a player goes to sleep. I may be able to filter it out later, but not sure.
  • Although this doesn't change the plugin's function at all, I've converted CarbonSleep to a maven project, which accounts for the filename change (now has the version in the filename). Remember to delete the old CarbonSleep.jar when uploading this one if you don't change the name first.
----------, Dec 5, 2016

  • Dependency on Spigot-specific classes have been removed.
  • morning-subtitle's color is now configurable via '&' color codes. If you've used v1.0.1, then the morning subtitle won't have color in v1.0.2. Simply add color codes in to fix this as the built-in color is now removed.
This version should now work with any version of Spigot and Bukkit, provided there is no major API version change. should. If you have an error, let me know. Output of /version is helpful as well as any error logs!
----------, Nov 20, 2016

  • Removed dependency on Vault.
  • Removed NMS imports, should be more version-friendly now (still using a Spigot-only import, so doubt it'll work on just Bukkit). Previously using NMS helper classes to send titles, now using Player#sendTitle() and TextComponent.
  • Cleaned up a lot of public-static stuff in favor of somewhat more encapsulated data.
  • Added a config variable 'morning-subtitle' to allow some configuration of the greeting displayed upon reaching morning. This new option now offers a variable {PLAYER} that is replaced with the player's name. If you've somehow ALREADY gotten an old config on your server, the plugin should handle adding this new value to existing worlds in the config.
Thanks @IAlIstannen for the suggestions! (Think I got most of them at least)
----------, Nov 19, 2016

Resource Information
Author:
----------
Total Downloads: 44,826
First Release: Nov 19, 2016
Last Update: Jul 5, 2021
Category: ---------------
All-Time Rating:
55 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings