[MISC] SleepAnnounce v1.2.2 - Sleep/Awake Announcer/Report [1.4.5-R0.2]

Discussion in 'Inactive/Unsupported Plugins' started by sgtbigman, Mar 25, 2011.

  1. Offline


    SleepAnnounce - Sleep/Awake Announcer/Report
    Version: v1.2.2
    PermissionsBukkit, MultiVerse, and DispNameChanger support!

    A simple plugin to check who is asleep or not in your server. Made/updated with the request and great suggestions of JTR1988, further requests of michael05242002, and other great suggestions/tips by others of the bukkit community:cool:. My first plugin.

    Features (open)

    • Configurable sleep/awake announcements.
    • Configurable listing of players asleep/awake.
    • config.yml for easy configurations.
    • Op-only setting if PermissionsBukkit is not detected.

    Commands (open)

    • /sleeping [all|worldname]:
      • Lists players sleeping (and awake if this is set in the config) on current world (all worlds if from command line).
      • <all> or <*> option displays all players in all worlds in the server.
      • <worldname> option. Replace with actual name of world. Displays players in the specified world.
        • Shorthand capability.
      • Aliases:
        • /sl, /slp, /sleep
    • /announce <sleep|awake>:
      • Change whether sleep/awake announcements are displayed.
        • If on, switches to off (and vice versa).
      • Alias:
        • /an

    Permissions (open)

    • sleepannounce.list.default - Allows a player to use /sleeping without [all|world].
    • sleepannounce.list.all - Allows a player to use /sleeping all.
    • sleepannounce.list.world - Allows a player to use /sleeping worldname, where worldname is replaced with the actual name of the world.
    • sleepannounce.announce.sleep - Allows a player to toggle the sleep announcement.
    • sleepannounce.announce.awake - Allows a player to toggle the awake announcement.
    Parent nodes:

    • sleepannounce.list.* - Allows player to use all /sleeping variants.
    • sleepannounce.announce.* - Allows player to use all /announce variants.
    • sleepannounce.* - Allows player to use all SleepAnnounce commands.

    Changelog (open)

    Version 1.2.2
    • Updated code to work with latest build.
    Version 1.2.1
    • Fixed announcement bugs (coloring conflict with DispNameChanger).
    • Added the ability to use shorthand on /slp [worldname] command.
    • Added
    • as an alternative to the [all] in /slp [all].
    Version 1.2.0
    • Added PermissionsBukkit support!
    • Removed Permissions 3.x support.
    • Added DispNameChanger support!
    • Cleaned up code.
    Version 1.1.0

    • Added MultiWorld support!
    • /sleep - now displays only those players in the sender's world (if the sender is a player).
      • If the sender is not a player, /sleep displays all players in all worlds.
    • /sleep all - displays all players in all worlds.
    • /sleep <worldname> - Displays players in specified world.
    Version 1.0.0

    • Added Permissions support!
    • If SleepAnnounce/config.yml does not exist, the .jar creates/fills it now.
    • Add /announce <sleep|awake> command which allows players/admin to change whether sleep/awake announcements are broadcast to the server.
    • Some code cleanup.
    • First "Major" release: Everything requested is in the plugin now.
    • Thank you for your continued help/support!
    Version 0.3.6

    • Changed version format to Major.Minor.Non-critical
    • Fixed spacing between playername1,playername2 to playername1, playername2
    • Also added a comma at end of awake players list before sleeping players list.
    • Tested against latest craftbukkit build (677) - Works.
    • Non-critical update - just fixed a little display error.
    Version 0.35

    • Cleaned/Tidied up the config file for ease of reading/use.
    • Used updated Craftbukkit code which deals directly with beds! (They must have known what I was working on and what you guys wanted). :p
      • This helped with announcements working as they should.
    • Added aliases to the /sleeping command: /sl, /slp, and /sleep.
    • Added an announcement for awaking players (toggable). ({Player} has awoken.)
    Version 0.3

    • Added config file (/SleepAnnounce/config.yml) to allow easy configuration by admins.
    • Updated code to work with config file and work with latest recommended build (617).
    Version 0.2

    • Added ability to turn announcements on/off and check status (on/off).
    • Added ability to display sleeping/awake players in a colored list (red: sleeping/green: awake). If /sleeping color off, default two lists display (sleeping: (names) & awake: (names)).
    Version 0.1

    • Release

    Download SleepAnnounce v1.2.2
    Source Code

    Latest build: Compatible with CB[1.4.5-R0.2].
  2. Offline


    Two thumbs up, great job!
  3. Offline


    All right, great! Glad I could help! and don't be afraid to let me know of any other ideas/suggestions.
  4. Offline


    Works very nicely. The "/sleeping" command is very helpful, especially on a server with a lot of people. If possible, maybe you could make the "/sleeping" command just bring up a list of all players currently online and have it so the players asleep are a certain color, like gray, and the players awake are white. You could probably come up with a better color scheme, just an idea. Although, some may like the one you have, that displays the players "Sleeping:" and players "Awake:" separately, so maybe have an option to pick which format you want in a config? Just an idea.
  5. Offline


    Looks like the thread OP doesn't meet the guidelines yet for submitting a plugin; take a look at my plugin threads to get an idea of the correct formatting to use @sgtbigman .

    Good luck!
  6. Offline


    JTR - I will definitely look into your suggestion. I could see where both methods could be useful depending on the user.

    fever - I'll have to look over your threads for help. I iz noob :]

    Thanks for the feedback!
  7. Offline


    I like this, I would prefer an option to turn the "[ user ] has gone to sleep" off, also, for JTR's suggestion, grey isnt a good color, as that is the color AFK people turn in a few plugins. I would say a different color would work nicely :)
  8. Offline


    Hmm, right, maybe red players awake and blue players asleep would be better. The only problem is there would have to be some kind of key to allow players to know this. Maybe the players asleep would have normal white color and the players awake would have red as a way to draw attention to them. The best option would be to allow the user the ability to choose what they want I suppose.
  9. Offline


    great ideas. I'll look at implementing them this week. Thanks!

    Update: v0.2

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 13, 2016
  10. Offline


    Seems to be working well. Keep up the good work!
  11. Offline


    Glad to hear! I'll work on letting the admin set the properties through a config later this week. Thanks for the feedback!
  12. Offline


    No problem man, looking forward to the next update.
  13. Offline


    I love this mod, we use it on our ECO/Survival server, and it makes synchronizing bedtime across our multiple towns a piece of cake. Can anyone confirm that this works with 602?
  14. Offline



    I have tried running it on my server which I just updated to 602, and it sadly doesn't work. sgtbigman still needs update it.
  15. Offline


    Alright, cheers for getting back to me. :) Certainly worth waiting for!
  16. Offline


    No problem :) Indeed it is!
  17. Offline


    no permissions? When I sleep I get: "You don't have permission to use that command"
  18. Offline


    Here's my to-do list:
    - Update to 602
    - Permissions
    - Config file

    Sorry for the wait: I'm writing papers for classes (fun fun)
    I will work on this list ASAP.
    Thank you for all of your kind words and helpful feedback! :)

    Just to let you all know, I've decided to wait for the next build that is compatible with v1.4 update for Minecraft before I update my code. I apologize for any inconvenience, but I thought that this would keep everyone on the same page once the kinks are worked out for Bukkit/Craftbukkit. Thanks for your patience and understanding.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 13, 2016
  19. Offline


    Good idea. I was wondering though, what types of things are you planning to make configurable in the config file?
  20. Offline


    Well I remember you mentioning earlier that maybe I should allow the admin to set up how /sleeping lists the players using a config file (Use the default list or colored list, and if the colored list, maybe allow for color specifications). I'm still learning the ropes of plugin programming for bukkit, but I hope to do that kind of config soon. Any other suggestions for the config file and what not? Just let me know.
  21. Offline


    Yea, being able to change the colors and text would be great man. People really seem to love being able to modify plugins. I have some suggestions about this:

    You could add the player has gone to sleep message, and make that fully customizable with color and text format. Some people might like "Player is sleeping." or "Player is asleep" who knows? Would be cool to change to whatever though.

    Maybe you should make the default list color (the one with both the Awake: and Sleeping: lists) customizable too. I know some servers display the player names in chat as colors other than white. I've seen red names before. It would allow for a more uniform server text color-scheme, if you know what I mean. Maybe add some comas between the names too. For example, so it shows "/Sleeping: JTR1988, Sgtbigman". A problem with this, I have noticed though, is when you implement custom color changing, to the player names for instance, the commas change the color set to the player name, because they come immediately after. Maybe just make the commas by default white?

    Also, maybe being able to change the color of the Awake: and Sleeping: texts, or the actual texts themselves for that matter. Some people may like Asleep: and Not Asleep:, for example. Or, some people may like it so it just displays only the sleeping: list and not the awake one. Even, if possible, an admin could set it to say something like, "There are currently 2 / 20 players asleep: JTR1988, Sgtbigman." for example, sort of like a player list.

    Another thing, for the color list (the one with players asleep and awake by the colors of their names) it would be cool to have a sort of key to allow users to know what color signifies what. For example, something like: Color key: Sleeping / Awake.

    I know these are a lot of suggestions. The plugin works great how it is, I just thought to give you some things to work on that aren't really necessary but would improve the plugin in the long run. I don't know anything about coding plugins but I think these would be small easy things to implement and actually be sort of like exercises for you to do, and could help in preparation for more advanced things like making it so you could sleep during the day and wake up at night.;) Thanks though man, keep up good work!
  22. Offline


    That's really awesome! Thanks, it helps so much in my server:D(build 493)
    Now my players in my server are used to sleeping at night :)
  23. Offline


    JTR - Wow great ideas! I'll work on them for sure.

    michael - Glad it works for you and helps on your server!
  24. Offline


    Is an update for 617 build coming out soon?
  25. Offline


    Requesting an update =)
  26. Bug Report using the 1.4 build of Bukkit.

    2011-04-03 19:36:39 [SEVERE] Nag author: '<NoAuthorGiven>' of 'SleepAnnounce' ab
    out the following: onPlayerCommandPreprocess has been replaced with a new signat
    ure, (PlayerCommandPreprocessEvent)

    Let me know if you need more info and I can test this again.
  27. Offline


    same. The /sleeping (checking function) works but the announce function does not work.
    Error shown like Nipplesoftheruture's one.(617 build is used)
  28. Offline


    update very soon guys...sorry for the wait. Should be up in a couple hours or tomorrow morning. Just working out some bugs. Thanks for your patience!

    one more bug to work out with the announce message, then release 0.3 tonight....I promise :cool:

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 13, 2016
  29. Offline


    Awesome, looking forward to it!
  30. Offline


    v0.3 released!
    - The /sleeping command now works if you send it from the server or in-game.
    Let me know what you think.
    Enjoy! :)

    Still yet to do:
    - Permissions (right now the /sleeping command is only allowed if one is an op).
    - Allowing editing of the config file from within the game/server instead of having to manually change the file.

Share This Page