Spigot SmoothSleep 2.11.2

Smoother, multiplayer friendly sleeping.

  1. [​IMG]

    There is a bug. Sometimes messages appear after you get up from bed.
  2. Not really enough information to go on here. Since I haven't seen anyone else mention this, I'd guess it was a plugin conflict. Another plugin or command block is likely altering the title duration or fade out time.
  3. How do i do so this works in all worlds without needing to input each world?
  4. There hasn't been much reason for me to add that feature so far. If your worlds already exist and there are just too many of them, then there's not much else to do other than to add them manually. I feel like there was a reason I didn't allow all worlds initially, but I can't currently recall why.

    If your worlds are being generated dynamically, that's a slightly different issue. Last I checked, there was no way for me to see when new worlds are created without depending on other plugins that manage worlds. My suggestion to someone else in this situation was to see if the plugin generating the worlds had the option to run a command when the world is created. If so, you can use /ssaddworld to enable that world. Since the config has quite a few options, I imagine it could get to be quite large if worlds are created frequently (and I might not have it setup to remove non-existent worlds).

    It's just not something that's been requested much.
  5. Hey @OffLuffy , thanks for this plug-in. I was wondering if it is possible to add a percentage according to users connected so that the night starts to pass.
  6. Honestly it's been some time since I've touched the plugin or did much in Minecraft in general. There's a good chance I won't be updating this for a while since I'm out of the groove (always a chance I'll get back into it later).

    In the mean time, if this is a critical feature for you, I'd recommend checking out Harbor. I've never used it, so can't vouch for it. The configuration looks much simpler at any rate!
    • Friendly Friendly x 1
  7. Oh no that's unfortunate I really love your plugin I think it's a really detailed and creative plugin. I love the boss bar and animations etc. If you could update this to 1.16 I would even be more than happy to pay for it! It's well made I'm sure people wouldn't mind paying for it.

    Although it does seem to be working in 1.16 with no issues so far
    #287 Onewingseraphim, Jun 28, 2020
    Last edited: Jun 28, 2020
    • Friendly Friendly x 1
  8. Glad to hear! I tried writing this to be mostly future proof, so unless something about bed or sleep mechanics change, then it wouldn't need major changes. If you give it a try and notice something doesn't work, do let me know! If it seems to work for everyone, I can just mark it as supporting 1.16.
    • Like Like x 1
  9. Hi there, I'm finding that the min-night-speed-mult and night-speed-curve values aren't being used. Sleep is always happening at the maximum speed. I only have one world specified in my file. Can you see a problem with this text?
    min-night-speed-mult: 3
    max-night-speed-mult: 9
    night-speed-curve: 0.5

    Also, when you say one can set the curve to 0 or 1 do you mean 0.0 or 0/1.0 or 1? I've tried different curve factors and always the sleep speed is at max.

    Thank you :)
  10. This could be permissions. If the other players that aren't sleeping have permission to ignore sleep, it won't count them. If you end up adjusting those permissions, you'd need to have players re-join for the new permissions to take effect. If someone is sleep ignored, they can still sleep and count (only ignores them if they're awake). In any case, if only one person is being counted, then it'll use max speed.

    The curve value can be any value between 0 and 1. When it's 0.5, the ratio of players sleeping scales the night sleep linearly. When it's lower, the night speed scales up slower initially, then faster as more players sleep. As the curve value get's closer to 1, it takes fewer initial sleepers to scale the speed up more quickly. If it's exactly 0, the speed will stay at minimum until everyone is sleeping. When it's exactly 1, any player will cause it to be full speed.
  11. *facepalm* Uhh "I thought I removed that permission" (TM). I will remove that permission and re-test. Really sorry for being a nimrod! I'll have to wait for some people to play on the server on Saturday.

    Also, even with the smoothsleep.sleepreward permission set, I can't get the potion effect to work. I've tried both uppercase HEALTH_BOOST and lowercase health_boost. The user is no longer ignored, and also not an admin. Any ideas?

    Thank you!! Both for your help and patience.
    #291 techula, Jul 4, 2020
    Last edited: Jul 4, 2020
  12. So there's a few conditions that need to be met before a sleep reward effect is given. Will try to enumerate them:
    - The player needs to be ejected from the bed by the plugin. If they're not in bed in the morning, they're not considered.
    - Needs sleep-rewards.potion-effects.enabled set to true in the world's options in config.yml
    - Player has smoothsleep.sleepreward permission (which you said is the case, just be sure to re-log if you make permission changes)
    - The potion name needs to be valid. The plugin checks on startup and prints a warning in the console if it finds an invalid one
    - The player needs to have slept longer than the value configurable under sleep-rewards.potion-effects.required-hours-sleep
    - The duration specified for the effect needs to be greater than 0.

    If night is passing instantly in your tests and you have Essentials installed, you may also need to make sure it isn't interfering (red note at the top of the overview page). If Essentials takes over, I doubt the plugin will do much of anything.

    If all of that seems to be in order, make sure no errors are printed to the console when the plugin is waking up players. If it's throwing an error, it could be interrupting the code that applies the effect.
    #292 OffLuffy, Jul 4, 2020
    Last edited: Jul 4, 2020
  13. Confirmed:
    - The game ejected me from the bed
    - Potion effects are enabled in the config
    - Luckperms permission was set for the regular-player profile
    - Logged in as a normal, not-op, not-owner, regular player
    - I can't tell if the potion name should be upper case like the default LUCK or if it's lower case. But I tried both without success.
    - I'm not using essentials or similar plugins.
    - I had tested with night passing fast and also instantly with same result.

    This is what the potion effect part looks like:
    enabled: true
    required-hours-sleep: 2
    show-effect-particles: false
    duration: 180
    amplifier: 1

    I looked at my latest startup log and didn't see an error. So the next thing to do when players aren't around is to put a fake name in there and look for the error to confirm I can find it.

    Thank you for sticking with this :)
  14. Bit stumped then. The effect names aren't case-sensitive in this case, and health_boost is a valid one as best as I can tell. If the plugin finds an invalid one, it should log as a warning, so be sure that logging-settings.log-warning is enabled. Also assuming that if other options are applying that it's not an issue with the world name (this plugin doesn't like to work if you use worlds with spaces in the name).

    There's one potential issue with the plugin using a method that's been deprecated, granted it looked to be deprecated in 1.15 as well. So I think I'll post an update soon just updating dependencies and resolving that deprecated bit. I'll give it a quick test before releasing, but let me know if sneakier bugs crop up. Should be live in a few minutes assuming the test goes well.

    As an addendum, the effect duration is in ticks. So 180 ticks gives them about 9 seconds of health boost. Just multiply it by 20 to get it in seconds.
    #294 OffLuffy, Jul 5, 2020
    Last edited: Jul 5, 2020
    • Like Like x 1
  15. OffLuffy updated SmoothSleep with a new update entry:

    v2.9.1 (Bug fixes for 1.16+)

    Read the rest of this update entry...
    • Like Like x 1
  16. Thank you very much for the update. I think at this point I have to conclude the issue is somewhere else in my system. Perhaps it's a spigot/paper issue, or some other plugin is being weird. It works perfectly well aside from potion effects so I will continue to use and enjoy it. My players love how the night moves in a fast but natural way and I love the flexible configuration.

    I did confirm that the log warning is visible when I use an incorrect effect name.
    I'm sorry I couldn't deliver you a victorious harruh after all your time spent here tonight but it's all sincerely appreciated!

    Thank you ~ Techula
    #296 techula, Jul 5, 2020
    Last edited: Jul 5, 2020
    • Friendly Friendly x 1
  17. hey ,maybe it is stupid , but why I can't load the plugin?
    [14:34:06 INFO]: [SS] Enabling SmoothSleep v2.9.1
    [14:34:08 ERROR]: Error occurred while enabling SmoothSleep v2.9.1 (Is it up to date?)
    java.lang.NullPointerException: null
    at com.luffbox.smoothsleep.lib.ConfigHelper.isValidPotionEffect(ConfigHelper.java:547) ~[?:?]
    at com.luffbox.smoothsleep.lib.ConfigHelper.reload(ConfigHelper.java:513) ~[?:?]
    at com.luffbox.smoothsleep.lib.ConfigHelper.<init>(ConfigHelper.java:96) ~[?:?]
    at com.luffbox.smoothsleep.DataStore.<init>(DataStore.java:33) ~[?:?]
    at com.luffbox.smoothsleep.SmoothSleep.onEnable(SmoothSleep.java:44) ~[?:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[patched_1.12.2.jar:git-Paper-1618]
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:316) ~[patched_1.12.2.jar:git-Paper-1618]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) ~[patched_1.12.2.jar:git-Paper-1618]
    at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugin(CraftServer.java:395) ~[patched_1.12.2.jar:git-Paper-1618]
    at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugins(CraftServer.java:344) ~[patched_1.12.2.jar:git-Paper-1618]
    at net.minecraft.server.v1_12_R1.MinecraftServer.t(MinecraftServer.java:442) ~[patched_1.12.2.jar:git-Paper-1618]
    at net.minecraft.server.v1_12_R1.MinecraftServer.l(MinecraftServer.java:403) ~[patched_1.12.2.jar:git-Paper-1618]
    at net.minecraft.server.v1_12_R1.MinecraftServer.a(MinecraftServer.java:341) ~[patched_1.12.2.jar:git-Paper-1618]
    at net.minecraft.server.v1_12_R1.DedicatedServer.init(DedicatedServer.java:289) ~[patched_1.12.2.jar:git-Paper-1618]
    at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:616) ~[patched_1.12.2.jar:git-Paper-1618]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_251]
  18. I'm not the expert, but is it supposed to work with 1.12? And have you checked that your config file matches the latest format? Maybe you've got a potion effect listed that is specified differently?
    • Agree Agree x 1
  19. It is seriously doubtful that this will still function with 1.12. There has been a few minor changes to the API since then and I don't support older versions. You may be able to use an older version somewhere around v2.2, but some features would likely have changed or be missing entirely. Reset the config if you decide to use an older version or it could turn into a mess.
  20. well, i get it