Inactive [MISC] AnyoneSleep v1.3 - Any player sleeping skips the night [935]

Discussion in 'Inactive/Unsupported Plugins' started by R3ality, Apr 13, 2011.

  1. Offline


    AnyoneSleep - Any player sleeping skips the night!
    Version: v1.3 (CraftBukkit build #935)

    This small plugin allows ANY player to skip the night time of the server by sleeping in a bed (without having to wait for ALL other players to get into beds aswell). If some of the players are AFK (or deep in their mines without a bed) other active players don't have to endure night time while waiting for everyone to use a bed.

    • Any player can skip the night by sleeping in a bed.
      • No need to wait for any other players to get into bed.
      • Multi-world support. Sleeping is world-based!
    • Support for the Permissions plugin (tested with 3.1.5b and 2.7.4, usage is optional)
      • Multi-world permissions support (including nether)!
    • In-game commands
      • To check current status of the plugin
      • To enable/disable sleeping altogether
    • Uses a configuration file to persistantly keep settings.
    Download: [​IMG] AnyoneSleep v1.3 (.jar only)

    • Download and place "AnyoneSleep.jar" file into the "plugin" directory of the server.
    • Start/restart the server to have the plugin loaded (or use a plugin manager)
    • (optional) Make changes in the configuration file
      Read the "Configuration File" section below for details..
    • (if using Permissions) Grant desired permission nodes to users or groups
      Read the "Permissions" section below for details..
    Permissions / Configuration file:
    Show permissions and configuration info (open)

    Permissions plugin usage is optional. If you are not using it the plugin will default to using the regular "ops.txt" (all commands will be enabled for all ops). If you are using permissions but you do not want it to apply to this plugin there is an option to make the plugin "static" via the configuration file (read below)

    The plugin utilizes the following permission nodes:

    anyonesleep.toggle - allow player to toggle sleeping for the server
    Commands enabled: /as toggle

    Special additional permission:

    anyonesleep.cansleep - allow player to sleep even if sleeping is disabled for the server


    Configuration file:

    In case the configuration file doesn't exist it is created automatically with default values when the plugin is loaded. This means you probably don't need to worry about it at all!

    Configuration file uses the .yml format (no tabs and be careful with spaces!) and will be at "plugins/InstaBreak/config.yml". The default (with added comments) is as follows:
        dynamic: #These dynamic configuration settings can be changed with in-game commands aswell (read more in the commands section above).
            enableforall: true #When set to "true" any player can pass the nigth using a bed. When set to "false" only ops (or players with special permission node) can sleep!
    Show changelog (open)
    AnyoneSleep v1.3, released on June 19th
    • Fixed multi-world sleeping!
      Plugin should now correctly handle a situation if two players in different worlds sleep at (roughly) the same time.
    • Word-based announcement
      "Player took a nap" message is now world-based (as opposed to being server-wide).
    AnyoneSleep v1.2, released on June 17th
    • Made sleeping non-instant!
      Player will sway in bed for roughly 5 seconds. Mobs can disrupt sleeping
    • Added in game commands!
      Command to disable sleeping for the whole server in case admin wants it to be night time. This can also be set in the configuration file.
    • Added Permissions plugin support!
      Check the "Permissions" section above for more details..
    • Added a configuration file!
      This plugin now utilizes a configuration file to persistantly keep settings. Check the "Configuration file" section above for more details..
    AnyoneSleep v1.1, released on May 11th
    • Fixed the two issues explained in detailed in this post here.
    • Added a server-wide announcement in case a player sleeps to pass the night.
      This will only occur if there are more than one players in the server..
    • Plugin no longer depends on the isSleepingIgnored() feature added since CraftBukkit #671
      Should work with any CraftBukkit version..
    AnyoneSleep v1.0
    • Initial version
    Known issues / Future ideas:
    Show issues and ideas (open)
    Known issues:
    • Non-sleeping players (who have never slept in a bed) get a number of mobs spawned around them. fixed in v1.1
    • Players (who have their spawn point set to their bed by sleeping) get teleported to their beds if time skips to the morning (in the result of any random player sleeping). fixed in v1.1
    Future ideas:
    • Make a server-wide announcement if the night is skipped by a player sleeping (and who) done in v1.1
    • Maybe implement functionality to disable sleeping for some players (in case someone abuses it)? not needed since v1.2
    • Make sleeping more like the un-modified sleeping (fade to black, stay in bed longer, allow mobs to disrupt sleeping) done in v1.2
    • Make sleeping toggleable by in-game command done in v1.2
    Like this plugin?
    Why not make a donation to show your support! Any amount will be appreciated! :)
    heblol and Pim1234 like this.
  2. R3ality: Does this plugin work in 1.2 non-recommended builds?
  3. Offline


    Sure would like to use this plugin again on my updated server :)
  4. Offline


    Is or Will the server be updated for 1.2.3?
  5. Offline



    I proudly present a patched version 1.4!
    • Update to support new event system
    • Permissions updated to bukkit standard
    • Configuration redone
    • Command code renewed
    • Optimizations
    Credit goes still to R3ality ! If he is not okay with this release, I'll remove it asap. Please tag me then! :)
    With enough demand, I can fork/maintain this plugin.

    Have fun!
  6. so now it works in 1.2.3? :) awesome job. Ill use it for sure!
  7. Offline


    Yes, tested it quickly on Beta 2 of 1.2.3 ;)
    Worked for me.
  8. Offline


    If R3ality is not active on this plugin anymore and anyone is looking for a more recently released official plugin, I just updated Sleep to 5.0.0. It has the ability to set the configuration to force sleep if even just the count of 1 player is in bed and I've been doing all my testing on the latest 1.2.4 builds.

    It might be nice to condense the sleep based plugin community eventually to avoid confusion, and increase reliability.

    If R3ality has any issues with me posting this here, I'll delete this post immediately.
  9. Offline


    Yes ive seen that plugin one of those that annoy me by installing extra plugins , they seem to be imbedded in the main jar. ( was surprised they got through the firewall ).
    Its a pain when your updating and unexpected plugins that you are not aware of existing suddenly
    start spewing errors :(
  10. Offline


    omega3141 - I totally understand your concern. I guess it's just the way I learned to manage my code rather than duplicating it among all my plugins independently. I'll be the first to admit I need to learn to design my plugins to function more independently to help appease server operators.

    Regarding your firewall concern, the other two plugins MessageManager and PlayerActivity are both embedded in the Sleep jar directly. It's like a zip file where it contains it all together. Then Sleep just extracts them if they aren't already on your server. There is no external downloading of files as part of that process. I know it doesn't make it any less unsettling however if you aren't expecting it.

    Thank you for your honest feedback! :)
  11. Offline


    Im sorry if im very noob at these things, but i have an little broblem. Only players with op:s can use bed, how can i fix this? :)
  12. Offline



    Yes, the most plugins are working with OPs only, if no permissions system is installed.
    You should take e.g. a look at PermissionsEx (PEX) or bPermissions.
    They are at the moment the best permission plugins.

  13. Offline


    Thanks, i tried that PEX and wrote code:

    default: true
    - modifyworld.*
    rank: '1000'
    - anyonesleep.jar

    prefix: '&c(Admin)&7'
    - default
    - anyonesleep.jar
    rank: '900'
    - anyonesleep.jar
    - Admin

    But still its not working, it says "You are not allowed to sleep" like before. And i checked that code too with Online YAML Parser :).
  14. Offline



    The permission is not

    - anyonesleep.jar


    - anyonesleep.cansleep
  15. Offline


    Thank you so much! Working perfectly :)[yellowflower]
    xGhOsTkiLLeRx likes this.

  16. Code:
    2012-05-28 21:42:56 [WARNING] [AnyoneSleep] [ERROR] For some reason the player trying to sleep is already marked as sleeping?! Please report this to the plugin developer!

    i keep getting this :D every now and then.
  17. Offline


    Have you restarted your server?
    I'm not sure, since it's not my plugin.
    But the player sleep check fails.
    Additionally, force all player to sleep, once...
    (Maybe disable AnyoneSleep for this time)

    I looked into the source again:
    Should be fixed, if the server is restarted
  18. ya i noticed just like few mins ago that after reset the "error" dissappears.. and its really RANDOM when it shows up :D not daily, mby like once a month or so? :D
  19. Offline


    This is caused while leaving the server in bed.
    If a player goes to bed, he is added to a list.
    And somehow (maybe because of end of stream error) the user isn't removed from that list.
    So an error appears, because the player is already in the list of sleeping people but was never removed...
    When you shutdown the server the list of "sleeping" players is cleared.
    Thats how you can fix this error!

Share This Page