Code Monkey home page Code Monkey logo

bettersleeping's Introduction

BetterSleeping (200.000+ downloads) Build status

This repository contains the source code of the free version of BetterSleeping. It is a Spigot plugin that will make sleeping on servers less of a hassle. Useful links:

Servers using v3: BetterSleeping stats graph

Check out BetterSleeping's full stats!

What this plugin does

Usually all players must sleep before a night/storm can be skipped on a multiplayer server. BetterSleeping allows this to be skipped when a given percentage of players is sleeping. Quite extensive configuration is included to suit your needs. The configuration includes, but is not limited to:

  • Set the night skip mode: will time pass faster or will it be set to day?
  • Set a percentage of players that must sleep to skip the night, or choose to set a static amount that must sleep
  • All messages can be customised in lang.yml, and by default several languages are supported (English, French, German, Dutch, Spanish, Portuguese, ...). Full list here
  • Give players buffs (potion effects) for sleeping or debuffs for not sleeping!
  • Disable phantoms
  • Display messages on screen instead of in the chat
  • ... And so much more! Check the wiki to see all options.

Tested Spigot versions

This plugin is functional and has been tested on several Spigot versions. Bukkit should be compatible too but no extensive testing has been done. You can see the latest and tested BetterSleeping version for every supported Spigot version in the table below. Newer updates than the mentioned BetterSleeping versions will probably be fully compatible but have not been tested (yet). Previous versions of BetterSleeping can be found under Releases.

Spigot BetterSleeping
1.12 3.0.4 download only here
1.13 3.0.4
1.14 3.0.4
1.15 3.0.4
1.16 3.0.6
1.17 4.0.2
1.18 4.0.2
1.19 4.0.2 (or newer)

How to contribute

Sometimes people ask how they can help, there is a lot you can do.

  • Leaving a review on the Spigot plugin page helps a ton! You'd make me happy and help future visitors make the right decision.
  • Grab the premium version
  • Starring this repository is much appreciated (on the top right of this screen)
  • You can make a suggestion (eg. a new feature). Join the Discord server to let me know or create a new issue!
  • If you know how to code, feel free to make a pull request and add your feature on your own!

bettersleeping's People

Contributors

5idereal avatar abhithedev200 avatar cype-dev avatar dependabot[bot] avatar eason329 avatar github-actions[bot] avatar ivillager avatar jonmagon avatar jt122406 avatar lostdusty avatar lucas-luchack avatar nuytemans-dieter avatar rainbowdashlabs avatar villermen avatar vladoliinyk avatar xenapte avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bettersleeping's Issues

Storm skip delay

If a storm (not night) is skipped, there is a slightly longer delay before players are kicked out of their bed by the game. To fix this BetterSleeping should perform a check and if there is a storm during the day when players sleep and subtract the extra wait time from the sleep_delay. This way, the configured time will be maintained (unless it is set to a low wait time).

Cancelled

How do I disable the cancelled message? I tried leaving it as blank and typing ignored but it didn't work

New placeholder: <user>

This tag will be replaced by the user that did an action, example: "user_x left their bed".

Simplify YAML files

Currently there are a lot of comments in the config files.
This is great to explain everything but they could and should be simplified a bit!

Refactor Management

Management should be split into LangManagement, ConfigManagement and BuffManagement.
This will give a better overview.

Expand 'enough_sleeping'

Expand 'enough_sleeping' in lang.yml to include how long the players have to wait before the night/storm is skipped (dependent on 'sleep_delay' in config.yml).

cancelled message is being sent when time is set to day

Not sure if anyone else is having this issue, but with I have BetterSleeping with multiworld support on, and the "cancelled" message is being sent after it already has turned to day. Not sure if this was always there or if it just appeared. Running 1.14.4 Paper Spigot. :)

~Zachrocks22 on Spigot

Bettersleeping.bypass edge case

When all online players have got bypass permissions, the night cannot be skipped. A solution should be found (ex: a command they can execute)

Easy language customization

Add a lang option in config.yml. This will load a default lang file.
Example, in config.yml:
lang: "EN" or lang "NL"
The next reload or /bs reload will replace lang.yml with the content of the chosen language file

More placeholders

    TAG       |     replaced by:
<username>    ~ The username of the person that did an action (CANCELLED)
<receiver>    ~ The username of the user that receives the message (PLANNED)

Config reset command

A new command /bettersleeping reset. That will reset the configuration files.
By default only OPs can use this command. bettersleeping.reset will be the permission.

Sleeping buffs

Players that have slept receive temporary buffs for (Healing, filling food bar, speed, etc...).

Support for plural/singular words in lang.yml

To remain configurability and provide grammatical correct messages, this will be included in lang.yml.
Words can be tagged with a singular and plural version as follows: <singular.plural>
For example:
old: " players are needed!"
new: " <player.players> are needed!"

BetterSleeping will now automatically grab the correct word.

Slow messages

An option that will reduce the amount of messages sent by BetterSleeping.
Example: every x amount of people that go to bed, will be broadcast instead of after every person that goes to bed.

Ignoring sleep_delay

Hi, I have an issue where when the last person required to sleep enters their bed the server immediately jumps to day, ignoring the 'sleep_delay' in the config. I have set this to various numbers with no change. It's especially weird when there's only one person on the server (when I first tested the plugin) as you don't appear to even get in the bed.

Hoping this is something you can fix. Thanks.

Not sleeping debuffs

Give players (configurable) temporary debuffs for not sleeping for a long period of time (Poison, mining fatigue, slowness, spawn monster...).

Sound effects

Add sound effects to notify players:
-You can sleep now
-Someone entered their bed
-Someone left their bed
-...

ConfigAPI improvements

If a configuration option is not found, the default value will be used. But in an ideal scenario, the missing option should be written to the default file. Server owners/admins wouldn't have to delete YAML file(s) anymore when new options are added.
Alternatively, missing configuration options can be reported to the console upon startup.

Perform testing before pushing the update

Just in case anyone is following the progress of this milestone: all should be finished but testing still needs to be done.
Adjustments may be made to improve the UX.
Bugs may still be found and fixed.

Reload compatibility with PEX and deluxechat

Upon /bs reload, the chat colors of pex and deluxechat break as stated by a user's bug report. A server restart or reload did fix the issues.
Presumably, it breaks configuration of all other plugins but no further data is available at this moment.

Buffs loading issue

I cant tell if anyone else is having this issue, when i set the buff level to 1 its giving the players the second level of that buff instead of the first, eg.
Makes the player run faster
speed:
time: 9600
level: 1
gives the player speed 2 for 8 minutes, this is happening to all of the buffs and i have no idea how to fix it

~Seymo5 on Spigot

On screen messages

Allow BetterSleeping messages to appear on screen (but not in chat). This will prevent spam.

Countdown timer

A countdown timer that counts down to nighttime, when people will be able to sleep. This way, the players are prepared.

Edit: This should be an option (default: false). When set to false, there should be no impact on server performance.

Add PAPI support

PlaceholderAPI, to bring lang customisation to a higher level.

Disable message

Add the ability for players to disable a specific message (command for players, something like: /bs hide message_name). This will be player specific (player x disables a message but player y still receives that message).

New tag <total_amount>

A tag that is replaced by the total amount of players that should be sleeping to skip the night or storm.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.