[MISC] SleepNotify v1.9- Know when a player goes to bed. [1.2.5 R2]

Discussion in 'Inactive/Unsupported Plugins' started by vaxoc, Aug 7, 2011.

  1. Offline

    vaxoc

    SleepNotify has now moved to BukkitDev!
    Only BukkitDev is supported.
     
    sgtbigman likes this.
  2. Offline

    chernobyl360

    hey welcome to Bukkit Forums! Nice to see you wanna develop plugins!

    Suggestions:

    Configs - Configurable messages / healing/damage/color/Bilingual.another challenge for you to try!
    Multiworld - another challenge!
    Permissions - allow certain players to send message when entering bed. just a challenge for you :D
     
  3. Offline

    CainFoool

    A.k.a. The pedo plugin!
     
  4. Offline

    vaxoc

    Haha okay! I think I'll try to get Permissions implemented ASAP. I'm not sure how to do the others...Looks like I have some reading to do! :D
     
  5. Offline

    chernobyl360

  6. Offline

    vaxoc

    Okay cool. One more thing, I thought I knew how to do it, but what I did to try to implement permissions apparently only works with operators... what code could I insert to implement the permissions plugin? Here is the code I currently have to include permissions:
    Code:
    if (!player.hasPermission("sleepnotify.alert")) {
                return;
            }
    And in my plugin.yml...
    Code:
    permissions:
      sleepnotify.alert:
        default: op
        description: Any user with this permission will have an alert shown for when they go to bed or wake up.
     
  7. Offline

    chernobyl360





    Code:
    import org.bukkit.Bukkit;
    import org.bukkit.Server;
    import org.bukkit.entity.Player;
    import org.bukkit.event.player.PlayerBedEnterEvent;
    import org.bukkit.event.player.PlayerBedLeaveEvent;
    import org.bukkit.event.player.PlayerListener;
    
    public class SleepNotifyPlayerListener extends PlayerListener
    {
      public void onPlayerBedEnter(PlayerBedEnterEvent event)  {
    public static PermissionHandler permissionHandler;
        Player player = event.getPlayer();
        if (SleepNotify.permissionHandler.has(player, "Bed.Enter")) {
        Bukkit.getServer().broadcastMessage(player.getName() + " has gone to sleep");
      }
    
      public void onPlayerBedLeave(PlayerBedLeaveEvent event)
      {
        Player player = event.getPlayer();
        if (SleepNotify.permissionHandler.has(player, "Bed.Leave")) {
        Bukkit.getServer().broadcastMessage(player.getName() + " has woken up");
      }
    }
    it might be a good idea to learn how to " Read " java.

    basically what this is saying is when player enters the bed and he/she has - 'Bed.Enter' node he/she will get that message.

    ill let you try and setup the main class to allow the playerlistener to incoperate permissions. if u need help PM me...
     
  8. Offline

    vaxoc

    I'm thinking about adding commands, but not sure what commands would be useful with this plugin...:confused:
     
  9. Offline

    Nikademus

    Any plans on making Permissions optional, since that plugin is now inactive?
     
  10. Offline

    vaxoc

    Possibly...well, I've been trying to but for some reason it's not working correctly if I try it. I will go and look back at the code in a few days. (I can't right now cause school has started again for me :()
     
  11. Offline

    Tealk

    can you add "Broadcasts the names of everyone who isn't sleeping" please
     
  12. Offline

    vaxoc

    That seems a little difficult. Of course, I'll try! :D But I cannot work on plugins at the moment due to school :(
     
  13. Offline

    Tealk

    Ok thanks
     
  14. Offline

    vaxoc

    Okay! Sorry for that long delay. I have added OP Support! :D
     
  15. Offline

    Nikademus

    Can this be a configurable option? I'm the only op, and I would like players to also know when I get into bed.
     
  16. Offline

    vaxoc

    Possibly. I will look into it after a few days. I won't be able to do it for a few more days.
     
  17. Offline

    godsyn

    Will you please remove the space from the config directory? No other plugins use a space; it is also easier on Linux users.
     
  18. Offline

    vaxoc

    Yes. I will probably have this fixed by tonight. Haha, sorry I didn't know it was like this :confused:

    ***EDIT*** Sorry, it may be 2 or 3 days before I can get this. After re-reading what you asked, it may be a little while longer than what I had previously thought. Nonetheless, it should be done soon! :)
     
  19. Offline

    sgtbigman

    Feel free to look at my code and try out my plugin at this thread: SleepAnnounce

    Just an FYI, SleepAnnounce has configurable sleep/awake announcements, listing of players asleep/awake, PermissionsBukkit, MultiVerse, and DispNameChanger support, etc. I just wanted to let you know since your plugin seems to be heading in the same direction. Have fun coding!
     
  20. Offline

    vaxoc

    Thanks! :) That was actually a huge coincidence...I was just checking out your plugin! Haven't looked at the code yet... I've actually implemented A config setting that sets wheter or not to show alerts for OPs, it just hasn't been released yet. I would like to squeeze a few more features for the next release. Yes, my plugin also has configurable messages as of v1.2. Feel free to test my plugin! I will most likely post source code soon!

    UPDATE TO EVERYONE: I will have SleepNotify updated for RB #1185 Tomorrow! I cannot do it right now, as it is getting late where I am, and I should call it a night. This shouldn't take long! Also, I may include a few requests/fixes when I do this.:)

    ***EDIT*** I have tested with RB 1185 and it works. I decided not to include the fixes that way I should have some "meat" for the next version (which should be out this weekend if not tonight!:D)

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

    vaxoc

    OP Alerts now toggleable in config.yml! :D
    Config directory now has no spaces! :D

    Enjoy version 1.3 everyone!
     
  22. Offline

    vaxoc

  23. Offline

    vaxoc

    I have updated SleepNotify for Bukkit RB #1240!
     
  24. Offline

    vaxoc

    Hey, I've done the inverse of this. I've added the ability to show who is sleeping because this would probably be more useful. I may add a /awake command later on. Sorry for that month delay..
    Enjoy v1.4 Everyone! Big thanks to sgtbigman for helping with the /sleeping command!
     
  25. Offline

    teawrecks

    I just installed this today. It doesn't seem like it's removing names of people sleeping from the list. For example if I type /sleeping right now, I get every person, with repeats, who has gone to sleep since I've installed the plugin.
     
  26. Offline

    vaxoc

    Hmm...that's weird. It worked on my server just fine...but I believe you as I am not the best dev. I will look into this tomorrow because it is getting late here and I should go to bed soon. Also, what permission system do you use with it? (If applicable)
     
  27. Offline

    teawrecks

    PermissionsBukkit. And thanks for the quick reply =)
     
  28. Offline

    vaxoc

    Your welcome for the quick reply. :) As for your problem, I just ran the plugin on a test server with PermissionsBukkit, and didn't find any problem like you described. One problem I did run into (and I'll fix this in the next release) was that the plugin didn't seem to want to work with the "permissions.*" permission. Do you have it configured like this? If so make sure you explicitly add the permissions listed above.
    But wait! Also, I found something that could be causing your problem (and this should be fixed in next release as well.) I just realized (as I was typing this post :)) that if you have only given the group/person the permission "sleepnotify.sleep" and not the "sleepnotify.wake" permission, this will cause the plugin to add their name to the list when they go to sleep, but not take it off when they wake up. (and it will keep doing this, causing repeats) Make sure this is not the case. Like I said, that should be fixed soon. One more thing: if you still run into problems, make sure the permission you have for the group is "sleepnotify.wake" or "sleepnotify.sleep" NOT "permissions.sleepnotify.wake/sleep"
     
  29. Offline

    teawrecks

    The latter one is what's happening =)
    Yeah, I enjoy not having to type "in bed" every night, but i didn't see the point in flooding the chat when everyone wakes up. I assume that's what would happen, I didn't actually try it though.
     
  30. Offline

    vaxoc

    Okay! I have made a lot of progress on v1.5. All I have to do now is fix the config and it will be out, fixing the issue. Hopefully it will be out within the next few days. Thanks!
     

Share This Page