Plugin, really simple. Disable change the time when sleeping.

Discussion in 'Archived: Plugin Requests' started by Lummox, Nov 21, 2012.

Thread Status:
Not open for further replies.
  1. I need a simple plugin (I think).

    I'm currently using several plugins that use the bed as "HomeSpawnPlus", "BedHealth" or "Seasons" (the latter makes no use of the bed, but I can set a "calendar" with a duration set for the day and night).

    Need a simple plugin that allows me to use the bed, which means you can sleep on it (to set my "Home" with the plugin "HomespawnPlus"), so as to be able to heal with the plugin "BedHealth", but I do not want to accelerate the time for transition from night to day.

    I want to disable the "fast time", ie if there is one player on the server, you can use the bed, but when I do, it does not change the time. Simply that lie flat, that vision is dark (as usual), but nothing else happens, time passes in the same way, is not altered in any case.

    Name of plugin: SleepDisable
    Commands: Unnecessary
    Permissions: Unnecessary

    You can create a configuration file with a single line:

    Allow change the time when sleep: True / False

    Appreciate it if anyone can make this simple plugin.

    Thanks and regards.
     
  2. Offline

    Trung_Lam

  3. Hello, thank you for creating the plugin! ;)

    But there is a problem, it works "half", that is, when I go into a bed, gradually loses vision, and in the end, gets up from the bed, and remains in night .... perfect, but I need that remains in bed.

    The player enters the bed, gradually loses vision, and when completely lost vision, it has to stay in bed until the player decides to press "esc" or "leave bed" to get out of bed. At this time, when the vision goes dark, automatically gets up, I want to disable this, it do not get up automatically.

    And a little thing in the settings, it should be the other way around:

    Allow change the time when to sleep: true
    # Time must change when you sleep, if this option is set to "true"

    Allow change the time when to sleep: false
    # The time does not change, if this option is false

    Right now is on the contrary :rolleyes:

    Thanks ;)
     
  4. Offline

    Trung_Lam

    Ill fix the config and update how the plugin works later today.
     
  5. Ok, thank you!

    ;)
     
  6. Offline

    Trung_Lam

  7. Offline

    MDavidHC

    oh! great plugin!! Thank you! :D
     
  8. Okay, I've noticed that if there is a single person on the server.

    That is, if more than one person, if one lies down, stays lying and does not get up. But if only one person goes to bed, then I automatically rises.

    It would be possible to do the same, when one person?, Ie always stay lying in bed, although this only on the server.

    Thank you.
     
  9. Offline

    Hoolean

    Trung_Lam

    Why not use .setSleepingIgnored()?
     
  10. I tell you the same thing I told you by private message :p
    To see if I can explain better: ((My English ....)

     
  11. Offline

    Trung_Lam

    I didn't know that existed, would have made the plugin so much better. I'm not familiar with the api, so things like this will happen =P. Ill fix it after Thanksgivings. Happy holidays
     
    Lummox and MrBluebear3 like this.
  12. Thanks!, ;)
     
  13. Offline

    Trung_Lam

    Will be completed tonight. I was with family sorry

    So Lummox, what you want is be able to stay in bed and not wake up until the user chooses to. I took a look at the .setSleepingIgnored() method, and it actually doesn't do what I initially thought it does. That method, will not make you stay in bed if you're on the server by yourself. I've spent a while now, and I cannot find a way to do this.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 30, 2016
  14. Is rare, if there are more people, if the player who stays in bed until the I decided, however, whether this alone is lifted automatically.

    Would it be possible to make the player stay in bed, a specified time?. For example:

    config.yml

    Allow change the time when to sleep: false
    Auto Getting Up: 5m
    # S = Seconds - M = Minutes - H = Hours

    With this, you specify the time it will take the player on "Auto get up".

    Can anyone help "Trung_Lam" with your plugin?, Or remake it to work well?.

    :'(

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

    lemon42

    I'll investigate to see if this is possible. If it is, I'll try to get a plugin to you in the next two days. If it isn't, I'll notify you. Seems like a good idea to me, and never saw it before. In any case, I'll get back to you before tomorow :)
     
  16. Thank you so much!, I will be attentive to your response.

    Greetings! ;)
     
  17. Offline

    lemon42

    I've been trying out multiple things and haven't been able to get anything working, without breaking sleep altogether (like, being able to leave the bed). If anyone finds a way to do this, please share so he can get his plugin, and also so I can take a look at the source :)

    Sorry! Hope someone will find a way! ;)
     
  18. Thanks for trying ;)

    If anyone is encouraged to try .... :'(
     
  19. Please, help.... :(
     
  20. There are no way to make what I am asking?

    I've got an idea ....

    The plugin of Trung_Lam works perfect if there are several players online. The problem is when there is only one player in line, who does not remain in bed, it automatically rises, when they pass a few seconds ... Instead if there are more people online, if you can stay in bed until the player decides.

    I have thought if there is a way to "trick" the server, creating a player "Fake". A player that is always online and count as an active player. Really though, is not physically. So the server thinks there is more than one player online, and the plugin of the Trung_Lam can work perfectly.

    This is possible?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 30, 2016
  21. Please can someone try? :'(
     
  22. Please, can someone try this?... :rolleyes:
     
  23. Offline

    shadowlif

    Please send me a full list(here or per PM) of all function for the Plugin, then i make a public Plugin with this functions.

    shadowlif
     
  24. MP Send!
     
  25. Offline

    Hoolean

    I'll give it a go; I know how isSleepingIgnored() works now ;D
     
  26. Thanks MrBluebear3!

    :p
     
  27. Offline

    Hoolean

    I think I have it working with more than one person but it is weird with just one person :(

    I'll look into it!
     
  28. At the "plugin" "Trung_Lam" same thing happens, it works perfect when multiple players online, but does not work if only one person.

    I had thought about creating a player "Fake"that is always online, but the "plugins" that exist as "VirtualPlayers", unable to "trick" the server ...
     
  29. Offline

    ceoepts

    Wut is theis??? If multiple players is online on a server and 1 sleeps then it wont turn day without or with plugins...
    Or am i wrong?

    Oh!
    Could'nt you only use citizens and create a npc... Or does it not work?
    (Did'nt work...)

    Pay a friend.
    XD kidding

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 30, 2016
Thread Status:
Not open for further replies.

Share This Page