Sleep Vote (See Ore)

This thread will no longer be updated. See the page on the Sponge Ore Repository instead.

3 Likes

Nice!

Will this be similar to this one?
https://www.spigotmc.org/resources/better-beds.1824/

I like it, great idea !

Yes, it is similar to it, albeit with less features.
Now that youā€™ve linked me to it, Iā€™ll try to add some of those features in! :smiley:

1 Like

New version released! v0.4.0
Changelog

  • Fixed a bug where a player could trigger a sleep vote despite not being in range of a bed
  • Fixed a bug where the vanilla sleeping mechanic overrides the pluginā€™s, preventing the displaying of the wakeup message and instead displays the exit_bed message for all players currently sleeping
  • Moved configuration file to /config/sleepvote/sleepvote.conf
  • Added more configurable messages
  • Optional chat prefix ā€œ[SleepVote]ā€ for SleepVote messages
  • Option to log all voting status messages to the console (e.g. ā€œ[world] Player has went to bed! 1/100 (1%)ā€)
  • Added 4 second delay to the initiation of the playerā€™s vote after they right-click a bed (to give the animation a bit of time)
  • Added a reload command (ā€˜/sleepvote reloadā€™) to reload the pluginā€™s configuration without needing to restart the server. - Also works with ā€˜/sponge reloadā€™

Made for Sponge API 5.1.0 and Minecraft 1.10.2

1 Like

Iā€™ve been busy lately due to school.
But, Iā€™m hoping to be able to get version 0.5.0 out by the end of the next month!
Some features include:

  • Nucleus integration for detecting (and optionally ignoring) AFK players
  • A new ā€˜hidemeā€™ command to hide yourself from the plugin
  • Smooth/animated time transitions! No longer being added due to practicality reasons and issues with night-sleep time coherence.
2 Likes

Maybe you could add a permission to bypass. Like an admin logged and vanished would have the sleepvote.bypass and would not be counted in the required percentage.

The problem with detecting vanished players is that Iā€™m not sure of a way to do it.
Nucleus is the only plugin (as far as I know) that has the ā€˜vanishā€™ functionality, but its API does not appear to have any way of letting other plugins see which player is vanished and which is not.

So for now, Iā€™ve added a ā€˜/sleepvote hidemeā€™ command to workaround that.
If an admin wants to be completely hidden, they would execute ā€˜/vanishā€™ and then ā€˜/sv hidemeā€™ or ā€˜/sleepvote hidemeā€™ right afterwards.

Detecting when a player executes the command ā€˜/vanishā€™ wonā€™t be a good alternative.
I would need some fool-proof way of knowing for sure if the player is vanished or not.
Otherwise a problem may occur in which Nucleus thinks that the player isnā€™t vanished while my plugin thinks that the player is vanished, or vice versa. This could happen in a number of ways.

Vanishing was not the main idea. In fact, any player with node sleepvote.bypass should not be included in the percentage :slight_smile:

This way, it doesnā€™t require admin to type /sleepvote hideme when players want to sleep.

The ā€˜hidemeā€™ command will persist on relogs and server restarts, so having a separate permission that offers the same functionality is a bit redundant. But, you just gave me a great idea on how to better implement it!

1 Like

A new version has been released! v0.5.0

  • Added sounds that play on the wakeup, enter and exit bed messages
  • Added two new commands: ā€˜sleepvote hideā€™ and ā€˜sleepvote muteā€™
  • The ā€˜sleepvote hideā€™ command toggles whether a player is hidden from the plugin. The same effect can be accomplished by giving/taking away the permission ā€˜sleepvote.hiddenā€™
  • The ā€˜sleepvote muteā€™ command toggles whether a player will hear sounds played by the plugin. The same effect can be accomplished by giving/taking away the permission ā€˜sleepvote.muteā€™
  • Added a configuration option to completely disable/enable sounds
  • Added configuration options to ignore players with certain game modes
  • Added Nucleus integration for the ability to ignore AFK players

Built for Sponge API 5.1.0 and Minecraft 1.10.2. It is forward compatible with Sponge 6.0.0 and Minecraft 1.11.2.

A new version has been released! v0.5.1

  • Allows the use of 0.0 percent for the variable ā€œrequired_percent_sleepingā€, in which case it will use a minimum requirement of 1 player sleeping

Built for Sponge API 5.1.0 and Minecraft 1.10.2
Forward compatible with Sponge API 6.0.0 and Minecraft 1.11.2

A new version has been released for Sleep Vote, it is available for download here.


  • Fixed a bug in which the configuration file was not created on the first startup

Made for Sponge API 5.1.0 and Minecraft 1.10.2
Forward compatible with Sponge API 6.0.0 and Minecraft 1.11.2

Hey Icohedron,

Thanks for the great plug-in! Iā€™m currently having an issue where as an op I am hidden from sleepvote by default and I canā€™t find a way to change it. If I sleep in a bed, nothing happens, but if I /sleepvote hide it tells me I am no longer hidden and then it works. The next time I sleep I am hidden again. Am I missing something in the config file so that I can set it to unhidden by default?

The status of being hidden is determined by the permission ā€˜sleepvote.hiddenā€™. Since ops, by definition, have all permissions, they therefore also have this permission which hides them from the plugin.

The only way to work around this is to use a permissions plugin (I personally recommend LuckPerms but any permissions plugin should work). After setting up a permissions plugin, the next time you execute the ā€˜/sleepvote hideā€™ command it should continue to persist.
The command is just another way of enabling/disabling the ā€˜sleepvote.hiddenā€™ for yourself, no matter which permissions plugin you use.

Awesome! Iā€™m pretty new to plug-ins as I jumped into modded servers in 1.7 when bukkit died.Thanks for the tip!