BedTime
Bedtime v1.3.1
Description
A simple plugin that notifies all players when someone goes to bed and kick idle players. Will also list the sleeping players to the players whom are in bed.
Features
- List players and their sleep status when entering a bed
- Will redisplay this list when the list is somehow changed
- Notify all players when someone enter a bed
- Players do not need to sleep and will not be kicked if set in the config
- Will kick players whom aren't in bed. Behavior:
- KICK-action: Kick idle players if all nonidle players are in bed(They will receive a kick message)
- COUNTDOWN-action: When a player enter a bed there will be initiated a countdown. When this countdown reaches zero all players whom aren't in a bed will be kicked. If all players leave their bed this countdown will be aborted.
- DISABLE-action: Disable kicking. The plugin will not kick any players.
- Behaves as expected on a multi world server.
Feature features
None at the moment. Give me a comment and maybe I'll implement it :)
Commands
- /bed: List players and their sleep status. Green = sleeping, yellow = nonsleeping and red = nonsleeping idle, blue = sleep status ignored.
- /bedcountdown <secs>: Sets the countdown time in seconds
- /bedidleaction <action>: Sets the idle action. Can be KICK, COUNTDOWN or DISABLE
- /bedidletime <idletime in seconds>: Time in seconds until a nonmoving player is considered to be idle
- /bedsleepignore <player name>: Player does not need to sleep/will not be kicked
- /bedsleepunignore <player name>: Player will need to sleep/will be kicked
Permissions
- bedtime.idleaction: Needed to use the /bedidleaction command
- bedtime.idletime: Needed to use the /bedidletime command
- bedtime.sleepignore: Needed to use the /bedsleepignore command
- bedtime.sleepunignore: Needed to use the /bedsleepunignore command
Default config
Config location: /plugins/BedTime/config.yml
- idletime: 10 (Time in seconds before a player i considered idle)
- idleaction: KICK (Kick behavior. Can be set to KICK, COUNTDOWN or DISABLE)
- countdown: 10 (Countdown time in seconds)
- sleepignore: (List of player whom does not need to sleep and will not be kicked)
Bugs / Known issues
- Will not kick idle players if idleaction is set to KICK and they become idle when all other players are sleeping
@Smartie
Not the current version(1.3.1).
My immediate thought is that it is possible to do this by ignoring the other players sleep state if a player enters a bed.
I will look into the mater :)
I'm looking for an addon that'll allow one person sleeping on our server to trigger the night turning to day. Is this something your plug-in can do?
@masamitu
I'm unable to reproduse this with 1.6.4-R1.0 and BedTime v1.3.1
2013-09-09 18:53:43 [WARNING] Could not properly handle event PLAYER_KICK: java.lang.IllegalAccessError: Synchronized code got accessed from another thread: java.util.concurrent.ThreadPoolExecutor$Worker at org.bukkit.event.NLTCListener.onPlayerKick(NLTCListener:0) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462) at net.minecraft.server.v1_6_R2.PlayerConnection.disconnect(PlayerConnection.java:152) at org.bukkit.craftbukkit.v1_6_R2.entity.CraftPlayer.kickPlayer(CraftPlayer.java:220) at paalbra.BedTime.BedTime.kickPlayers(BedTime.java:250) at paalbra.BedTime.BedTime.kickIdlePlayers(BedTime.java:198) at paalbra.BedTime.BedTime.takeAction(BedTime.java:267) at paalbra.BedTime.BedTimePlayerListener.onPlayerHasEnteredBedEvent(BedTimePlayerListener.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462) at paalbra.BedTime.ConfirmPlayerHasEnteredBed.run(ConfirmPlayerHasEnteredBed.java:26) at org.bukkit.craftbukkit.v1_6_R2.scheduler.CraftTask.run(CraftTask.java:53) at org.bukkit.craftbukkit.v1_6_R2.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 2013-09-09 18:53:43 [INFO] This error is logged only once: it could have occurred multiple times by now. 2013-09-09 18:53:43 [INFO] Potential failures may occur in other plugins handling this Event. 2013-09-09 18:53:43 [INFO] Please contact one of the authors of plugin 'BedTime': Paal Braathen
@Tisdan
I am unable to reproduce this issue with BedTime 1.3.0, craftbukkit-1.4.6-R0.3.jar and Java 1.6.0_21
What exact version are you using of the above?
What is in your BedTime/config.yml?
How many players are on the server when this happens?
By "logs out" you mean press "Disconnect" in the menu?
Does it happen every time a player disconnect?
Are you running any other plugins? Does this happen if the only running plugin is BedTime?
@paalbra
Got this error when a user logs out
@Tisdan
There isn't really a way to disable it at the moment, but you could just set the idletime to some million/billion seconds. I guess your players doesn't stay afk for many days? I think i will add a DISABLE action in a feature release tho :)
What was your config when you got this error? Do you know when it happened? Some one entered a bed, left a bed?
How can i completly disable KICK and Countdown? I just want to know if someone enters a bed... Sometimes my Players want fo fight and other players just go afk when they are in bed.
Edit: 19:49:12 CONSOLE:[SEVERE] Exception in thread "pool-1-thread-4" 19:49:12 CONSOLE:[SEVERE] org.apache.commons.lang.UnhandledException: Plugin BedTime v1.3.0 generated an exception while executing task 28
Bukkit 1.4.6 0.3
@paalbra
thank you very much! :-D
no problems with 1.4.2-R0.1
@brain00
Hey!
I've actually fixed this issue. I just held the BedTime v1.3.0 release a bit while testing it on my server.
New version is uploaded now and it is awaiting approval. I've only used it with Bukkit 1.3.2 R2.0, but i can't see any reason for it not working with 1.4 unless they've changed some kind of core features :)
server get NullPointerException, when a player leaves the server:
craftbukkit-version: 1.3.2-R2.0
So can you please update this plugin for 1.3.2-R2.0 or newer? (because i like this plugin)
Or can someone pls tell me an alternative?
@paalbra
Eh. Correction: The uploaded file was actually not working at all. There must have been some kind of error when i exported it.
But there was also a bug. I'll look into it. Thanks again.
@watarimon
Oh! Yes. How could I've missed that. There seem to be an issue because it takes some time before the playerlist in a world gets updated.
I'll remove the 1.2 version and try to upload an 1.2.1 version asap.
Thanks for the comment!
After upgrading to 1.2 this shows when every player quits.
[SEVERE] Could not pass event PlayerQuitEvent to BedTime
@raom
Not at the moment. The plugins as of now doesn`t really affect the way sleeping works(Which is global on the server).
But I will look into making the plugin support multiple worlds when I have the time :)
@MightyFlyRudy
I like the idea about some kinda countdown. Your thought is that a countdown starts as the first player gets into bed?
It seems this does not support multiworlds? I have Multiverse, and when someone went to sleep on the first world, the only player in another world got kicked for idling.
@paalbra
Thanks. Do you think you could have it so that if players don't get to a bed within a configurable time, they get kicked?
@MightyFlyRudy
Yes, the message is currently hard coded to: "[BedTime] All other players were sleeping. Autokick due to idling."
Does this plugin give the player a message telling them why they were kicked?