Insomnia
This project requires SQLibrary 7.1+ plugin in order to function.
Features
Some players don't like to sleep. Give 'em a reason to, with Insomnia. Players who stay up more than one night will get a message, and start suffering from confusion - they're underslept. Adds a touch of realism to your survival or hardcore server.
During the day the insomnia fades, but comes back at dusk. Each night the insomnia gets progressively worse - yikes!
Using Insomnia? Give those players sweet dreams ... or nightmares with Dream Messages!
Commands
There are no commands for this plugin.
Permissions
insomnia.play
Players have insomnia.play by default. If you want to block it, use a negative node (ie -insomnia.play for ops, etc).
Configuration
There are seven settings in the configuration file.
debug
Set this to true if you'd like to see more detailed output in the console or server log. By default this is turned off.
language
There are five languages that are localized for this plugin: English, Italian, French, German, and Spanish. Simply change the language code (en-us, fr, de, es-mx, and Pirate) and reload the server and you're good to go.
ignoreBelowLevel
This setting is not functional yet.
mustSleepAfter
Specify the days after which a player must sleep to skip feeling the effects of insomnia. Defaults to 1.
worlds
A list of worlds that Insomnia works in. Don't list non-normal worlds like The End or The Nether, since they don't permit sleeping anyway.
showMessages
Defaults to true. Turn this off, and players won't see "You awake feeling fully refreshed!" or "You are becoming increasingly underslept ..." messages for that extra dose of realism.
version
Don't mess with this one, k? It's so players with older versions of Insomnia have their config file get upgraded without having to mess about with making a new one.
Source Code
Source is available upon request.
Is there a way to not need sqlibrary? it seems to be out of date, I run spigot 1.8.8
@ralphhogaboom
I can translate the messages into Russian.
If possible, аdd a separate language file for translation plugin posts to another language.
@Kasperbjerby
Yep, sent you an invite to the repo on BitBucket. Hope to see a patch from you soon, mate.
Players without the insomnia.play permission (op's) still get the negative efftects and messages about insomnia increasing every night? Can you fix that? I also feel like a players insomnia state should reset on death so if that option would be added i would be happy :)
Or can i just have the source? I have worked with bukkit plugins before so i can just make the changes myself..
@ralphhogaboom
Thank you that would be great.
@jhs232
In that case, the player who is in bed will not have the effects of insomnia while in bed - so, for example, weakness or slowness or confusion will go away. If they get up during the night, the effects will come back.
If the player in bed waits it out, when sunrise happens, the player in bed wakes feeling refreshed. The other player now has a night of insomnia; the next night their effects will increase.
By default, players that regularly sleep who occasionally miss a night won't feel any ill effects. Much like real life, where if we miss a night's sleep once in awhile we can mostly make it through the next day OK. So it works out to be actually quite playable, if players are mindful about getting sleep regularly, that they can skip it once in awhile.
The other players who stay up will eventually suffer the effects of insomnia, and start sleeping more regularly.
In my experience, other players put the pressure on to get to bed. It has changed the culture on my server, so now everyone sleeps, everyone maintains a home now.
I like the idea of the plugin a lot, but I was wondering howbwould it Work if one player was sleeping and another wasn't? (They wouldn't sleep through the night.)
@B8con
Aright - that's kind of how it's set up in the 0.5 version.
If at any point a player enters a bed, and exits the bed because of sunrise (in otherwords, they exit because day happens) then the insomnia counter is cleared.
For version 0.6 I'll plan on having this be a configurable option. That way server owners can set if players need to sleep the whole night, or 75%, or half the night, or just click the bed at least once a night.
@ralphhogaboom
I think that if they just get in the bed or stay in the bed for x amount of time it should clear.
@B8con
Right now, the plugin checks that a player has slept more than half the night. If so, on day it will clear their insomnia counters.
Can you tell me more about how you'd like it to function? Like, if they sleep at all that night, it should clear insomnia?
Could you make so you don't have to fully sleep(make it day) because if there are multiple people on the server and not everyone is sleep you can't get rid of the effects.
@yurisuika
Yeah, I can do that. I'll put it in the config in the next version. Thanks for the suggestion.
Really neat idea! I'm all about realism. As such, I also don't like plugins giving chat messages, so could it be possible to have a config option to disable players from being messaged about their insomnia? I'd definitely use it if so.
@ralphhogaboom
works great i can't wait for the next update ;D
@DrakeSnodgrass
Cheers, thank you for trying it out. I've uploaded a new version - fixed the dependency issue. Give it a go again and let me know how it works.
having issues getting this to work i have both insomnia and sqlibrary 7.1 and keeps saying wrong dependency
03.03 14:29:20 [Server] INFO at org.bukkit.plugin.PluginDescriptionFile.makePluginNameList(PluginDescriptionFile.java:1047) [Spigot18.jar:git-Spigot-38b8866-275603d] 03.03 14:29:20 [Server] INFO Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Iterable 03.03 14:29:20 [Server] INFO at java.lang.Thread.run(Thread.java:745) [?:1.7.0_71] 03.03 14:29:20 [Server] INFO at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:498) [Spigot18.jar:git-Spigot-38b8866-275603d] 03.03 14:29:20 [Server] INFO at net.minecraft.server.v1_8_R1.DedicatedServer.init(DedicatedServer.java:152) [Spigot18.jar:git-Spigot-38b8866-275603d] 03.03 14:29:20 [Server] INFO at org.bukkit.craftbukkit.v1_8_R1.CraftServer.loadPlugins(CraftServer.java:288) [Spigot18.jar:git-Spigot-38b8866-275603d] 03.03 14:29:20 [Server] INFO at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:133) [Spigot18.jar:git-Spigot-38b8866-275603d] 03.03 14:29:20 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:159) [Spigot18.jar:git-Spigot-38b8866-275603d] 03.03 14:29:20 [Server] INFO at org.bukkit.plugin.PluginDescriptionFile.<init>(PluginDescriptionFile.java:232) [Spigot18.jar:git-Spigot-38b8866-275603d] 03.03 14:29:20 [Server] INFO at org.bukkit.plugin.PluginDescriptionFile.loadMap(PluginDescriptionFile.java:955) [Spigot18.jar:git-Spigot-38b8866-275603d] 03.03 14:29:20 [Server] INFO at org.bukkit.plugin.PluginDescriptionFile.makePluginNameList(PluginDescriptionFile.java:1051) [Spigot18.jar:git-Spigot-38b8866-275603d] 03.03 14:29:20 [Server] INFO org.bukkit.plugin.InvalidDescriptionException: depend is of wrong type 03.03 14:29:20 [Server] INFO [14:29:20 ERROR]: Could not load 'plugins/Insomnia.jar' in folder 'plugins'