Git Product home page Git Product logo

sleep-most's People

Contributors

autonomouscat avatar davidtheexplorer avatar dependabot[bot] avatar leothawne avatar lesleyxyz avatar mrgeneralq avatar rainbowdashlabs avatar villmarksjenta avatar whitehoodhacker avatar yellowzaki 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

Watchers

 avatar

sleep-most's Issues

Insomnia Suggestion (cleanse with milk)

The ability to cleanse Insomnia with milk
It make more sense + it's more compatible minecraft friendly considering we can cleanse any potion effect with just milk

Day night cycle endless going

Reported by Jithvan

Whenever the nightcylce-animation is set to true, sometimes the time starts speeding up endless.
At this moment a root cause is not found.

plugin issue 1.19

Screenshot (15)
although the plugin has server interaction 1.19 like after sleeping overnight it will spam a rather long line on cmd, i'm afraid that when players sleep again at night it will spam on cmd causing server lag, hope this will be fixed soon~ plugin very cool!~

add the ability to use placeholders in messages.

add the ability to use placeholders in messages.

Example "&aGood morning, %medievalfactions_faction_prefix%!"

Being able to use other plugins that support placeholder API will allow the messages to fit the servers better.

Post jar files in Releases

Hey, it is really nice that you are posting updates on GitHub, it is very convenient. But could you upload jar file together with Releases too? So I can read the release from my feed reader and download the file directly from there.

Clock-animation/night-skipped goes faster the more players sleep

Suggestion: The more players that goes to bed, the faster the night goes by. (Original suggestion from Discord)

Example: If 1 player sleep, the clock-animation and nightcycle-animation (if enabled) goes by a bit slow, but if several players enter the bed, the animations goes by quicker, and day starts sooner.

/sm reset available for console

Is your feature request related to a problem? Please describe.
Not related to a problem

Describe the solution you'd like
Having the /sm reset available through the console with world specification

Describe alternatives you've considered
/

Additional context
/

Custom sounds

Make it possible to use custom sounds from custom resource packs

Lag Issue

Plugin sleep-most is performing a blocking I/O operation (Socket: https://api.spigotmc.org/legacy/update.php?resource=60623) on the main thread. This could affect the server performance, because the thread pauses until it gets the response. Such operations should be performed asynchronous from the main thread. If this happens on server startup, fixing it can drastically reduce startup time. Keep in mind to keep the code thread-safe. Report it to the plugin author

Inconsistent night skip check

Describe the bug
The check on how many people need to sleep has an inconsistency.

To Reproduce
Steps to reproduce the behavior:

  1. Set the players needed percentage to 0.4
  2. Have 3 players in the game, it becomes night, player 1 goes in bed, 1 more player needs to sleep.
  3. Player 3 leaves the game, changing the players needed to 1 but it will not skip the night
  4. Player 2 also goes in the bed, making players needed 2/1 and still not skipping the night
  5. Fixing by either player 3 joining again making 2/2 or player 1 and player 2 going out of the bed and re-entering

Expected behavior
Dynamically change the skip amount needed when players leave / join / enter or leave the bed, therefore skipping the night when player amount needed changes

Screenshots
N/A

Desktop (please complete the following information):

  • OS: Debian GNU/Linux 11 (bullseye)
  • Browser N/A
  • Version VERSION: 5.2.5

Additional context
N/A

xAntiAFK, afk exempt support

Is your feature request related to a problem? Please describe.
There is no possibility to setup AFK exempt while using the plugin xAntiAFK.

Describe the solution you'd like
A way to be able to setup AFK exempt for xAntiAFK the same way you would with essentials.

Describe alternatives you've considered
Changing back to essentials: I'd run into the problem of having less options for AFK detection and reactions.
Leaving it off: I'd run into the problem that a server with 4 players and 3 AFK, sleep would be impossible.

Additional context
https://www.spigotmc.org/resources/xantiafk-detect-all-afk-players-on-your-server-1-8-1-19.63466/
This is the spigot page for the plugin I was talking about: xAntiAFK

Tab-complete for /sm resetflag

/sm resetflag does not have a tab-complete.
/sm getflag and /sm setflag both has tab-complete.

Could be considered both a bug and suggestion, to be able to have tab-complete for resetflag aswell.
image
image

Dynamic Sky Light & Time of Day Length

Day/Night Cycle Length

Is it possible to modify this plugin to support settings for Day and Night length, something along these lines?

  • /sleepmost set day 0.5h -> day'll last for 30 minutes of real-time
  • /sleepmost set night 1h-> night'll last for 30 minutes of real-time

Sky Light parameter for map's compatibility

Also would be great if weather and time of a day/night cycle would affect server's side sky_lighting for integration with map's plugins like BlueMap

Screen: image

Missing message when trying to do commands when plugin is not enabled in that world

If you have forgotten to enable SleepMost in a world, you will not receive an error message when executing commands. When doing for example /sm sleep, no message appears in chat.

Expected behaviour: If plugin is disabled in that world, and a player tries to execute a player command, I expect a "Sleepmost is not enabled in this world" message.

[Feature Request] Exemption and Skipping Vanished Players

There should be a way to exempt players from the sleep counter. The permission should be sleepmost.exempt and players that are currently vanished (e.g. mods) should also be exempt. I use protocolvanish, but essential's vanish is also a popular type of vanish.

A debug command for easier debugging

I would like to have a debug command that shows a list of players that is included and excluded to calculations (or other important info). I would also like this list to display why they are included og excluded (maybe related to flags?).

For example:

AFK: player1, player2
OP: player1
Below y: player1, player2
Different world (potentially?): player1, player2, player3

Related enabled flags:
use-afk: true
exempt-below-y: 40

Bug

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Add option to disable update checker in config

Is your feature request related to a problem? Please describe.
I'm always frustrated when sleep-most does update check and I see it in my firewall and I can't disable it in any normal way. I want my network traffic free of unwanted requests.

Describe the solution you'd like
Add update-checker: true/false option to config that does not do any update check requests when set to false.

Critical: update check blocks the main thread

UpdateRepository.getLatestVersion() runs on or blocks the main thread, which causes the whole server to hang while the HTTP request is being processed. This can even lead to a complete crash if the request hangs indefinitely.

The update check needs to run asynchronously to avoid blocking the main thread, and a timeout should be specified to prevent this task from running indefinitely.

Bukkit.getScheduler().runTaskAsynchronously(pluginInstance, () -> {
        // ...update code, http request but with a timeout...
});

Also, the result of the API call should be cached for at least a few hours, as it is unlikely to change that often, and making too many requests adds unnecessary load (and in that case, makes the server even more vulnerable to the endpoint being down/slow).

In order to avoid other updater-related issues in the future, it would be nice to be able to disable update checks in config.yml.

Papper support

Hello, on the papper build the animation is instantaneous I guess animation is called at async going through all steps of animation at the same time.

Is it possible to add the support or change the method of making this animation?

Placeholder not working in boss-bar title

Describe the bug
The %required% placeholder does not seem to be parsing when used in the boss-bar title.

To Reproduce
Steps to reproduce the behavior:

  1. Edit boss-bar title in messages.yml
  2. reload sleep-most or restart server
  3. sleep in a bed

Expected behavior
%required% should show the number of people that currently need to sleep.

Screenshots
required_bossbar

New version missing 2 messages in messages.yml

Current version is missing 2 messages in messages.yml. These messages existed before the messages.yml, and was deleted by mistake.

night-skipped: '&bThe night was skipped!'

storm-skipped: '&bThe storm was skipped!'

Each time after the storm is skipped, the title "6:00" appears on the screen

Describe the bug
Each time after the storm is skipped, the title "6:00" (the same that appears after the night skip) appears on the screen for a short period of time.

To Reproduce
Steps to reproduce the behavior:

  1. Set weather to storm
  2. Go to bed
  3. Skip the storm
  4. See the title appearing for a second

Expected behavior
No title should appear.

Screenshots
If applicable, add screenshots to help explain your problem.
titlebug

Sleepmost/Bloodmoon Advanced related: /lay and /sm sleep skips the bm night

During a bloodmoon night you should not be able to sleep (unless enabled in bm config of course). If you have the /sm sleep permission or have gsit integration with /lay, you are able to skip the bloodmoon night by executing either of these commands.

Expected behaviour:
As a player I won't be able to skip the night during a bloodmoon, even by using those commands.

Ability to customize how long a day or night should be

I want to be able to customize how many (real time) minutes a day or night should consist of.
Default (real time) minutes is currently 7.5 minutes for each day and night. I want to be able to etc. have 10 minutes day and so on.

(Suggestion by J41MIE#7152 on discord)

"storm-sleep: false" blocking sleep though weather is clear

Occasionally players will find it impossible to sleep during clear weather with the plugin displaying the no-sleep-storm message as if the weather were set to thunderstorm. However, through testing we have determined that the sleep is blocked during apparently clear weather if a storm happens on the next game day.

This is reproducible by trying to sleep each in-game night until the plugin blocks it. On seed 4503599804565464, this occurs on night 116 (I believe weather patterns are seed-dependent). If you try to sleep after 18:33 game time on day 116, you should see this behavior, and after 00:00 game time on day 117, a thunderstorm will start.

The expected behavior is to be able to sleep during (apparently?) clear weather.

This occurs with version 5.1.1 of sleepmost and git-paper-137 (mc 1.19.2).

Disabling the plugin will not cancel the task, causing error when re enabling

Describe the bug
Disabling the plugin will not cancel the task, causing error when re enabling.
I tested it in version 5.2.5, and can avoid this problem by cancelTasks when closing the plugin.

To Reproduce
Use the plugin management plugin to disable the plugin, then restart it.

Additional context
Add any other context about the problem here.

[21:11:05] [Server thread/ERROR]: Error occurred while enabling sleep-most v5.3.0 (Is it up to date?)
java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@12733a89 rejected from java.util.concurrent.ScheduledThreadPoolExecutor@1fa117e[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 68]
        at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(Unknown Source) ~[?:1.8.0_301]
        at java.util.concurrent.ThreadPoolExecutor.reject(Unknown Source) ~[?:1.8.0_301]
        at java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(Unknown Source) ~[?:1.8.0_301]
        at java.util.concurrent.ScheduledThreadPoolExecutor.schedule(Unknown Source) ~[?:1.8.0_301]
        at me.mrgeneralq.sleepmost.bstats.MetricsBase.startSubmitting(MetricsBase.java:134) ~[?:?]
        at me.mrgeneralq.sleepmost.bstats.MetricsBase.<init>(MetricsBase.java:107) ~[?:?]
        at me.mrgeneralq.sleepmost.bstats.bukkit.Metrics.<init>(Metrics.java:74) ~[?:?]
        at me.mrgeneralq.sleepmost.Sleepmost.onEnable(Sleepmost.java:42) ~[?:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[JavaPlugin.class:git-CatServer-1.12.2-fed56812]
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:328) ~[JavaPluginLoader.class:git-CatServer-1.12.2-fed56812]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) ~[SimplePluginManager.class:git-CatServer-1.12.2-fed56812]

Make night-skipped-chat message toggleable to be sent only to players who slept

Describe the solution you'd like
As for now, the night-skipped-chat message is being sent to all players, even to those who didn't sleep in the current night. I suggest adding an option in the config to toggle whether this should be sent to all players, or only to those who slept and skipped the current night.

Alternatively, you can make 2 separate messages - the one sent depends on the player.

Annoying message

Hi, awesome and simple plugin!

Is there a way to stop this message from permanently appearing?

image

Feature Request - Play Custom Sounds From Texture Pack

Feature Explanation

Currently there are config values for sounds. Right now that only supports the Sound enum found in the server. Although the enum is just a more convenient way to programmatically play sounds. When using configuration files, it's better to just use the string-based key itself.

Snippet of Sound.java (API Docs - Sound Enum)

public enum Sound implements Keyed {
    AMBIENT_BASALT_DELTAS_ADDITIONS("ambient.basalt_deltas.additions"),
    AMBIENT_BASALT_DELTAS_LOOP("ambient.basalt_deltas.loop"),
    AMBIENT_BASALT_DELTAS_MOOD("ambient.basalt_deltas.mood"),
    AMBIENT_CAVE("ambient.cave"),
    ...
}

With the values of the enum being what they are, you can have the default config value be:

# Add sound effects after skipping the night or storm
sounds:
  night-skipped:
    enabled: false
    sound: ui.toast.challenge_complete
  storm-skipped:
    enabled: false
    sound: entity.wither.spawn
Old config for reference:
# Add sound effects after skipping the night or storm
sounds:
  night-skipped:
    enabled: false
    sound: UI_TOAST_CHALLENGE_COMPLETE
  storm-skipped:
    enabled: false
    sound: ENTITY_WITHER_SPAWN

Doing it this way should be easier for server owners to understand as well, as they don't necessarily understand why it has to be ENTITY_WITHER_SPAWN, which only makes sense if you're a developer and know enums.

Resources players could use then are naturally also tied to their Minecraft client version, but there are resources like:

They can then just use the command to play sound (command docs):

/playsound <sound> <source> <targets> [x] [y] [z] [volume] [pitch] [minimumVolume]

With the command they first test the sound they want works, then they can update the config value with that after.


Changes Required

Sound Method Being Used

Currently using playSound()-method that takes Sound enum as paramter. However, there is another method, which is the exact same that takes a String-value which can be used instead.

See:

Change Methods Getting Sound Effect

Currently ConfigService#getSoundNightSkippedSound() and ConfigService#getSoundStormSkippedSound() uses a try catch to parse the configured value into the enum.

  • Try/Catch here is not ideal, as you might want to throw the exception if this is wrongfully configured. Because when someone configures this and leaves the value incorrect, they expect it to work in game, but it won't, and there won't be any errors.
  • We don't need to use the Sound enum at all anymore, so this can just return a String instead.

Compatability with Supervanish?

If at nighttime someone selects a bed to sleep and there are i.e. 4 players on the server they see a text in the middle of the screen for a brief moment that says something like "1 of 4 sleeping".

On 1.19.2 when also having Supervanish installed, if an admin goes into vanish so tab shows 3 players the player that sleeps still sees the message telling them there are 4 players - this means they can tell if admin are in vanish.

Describe the solution you'd like
Compatability with supervanish and essentialsx vanish so that it does not display vanished players in this player count.
https://www.spigotmc.org/resources/supervanish-be-invisible.1331/

Describe alternatives you've considered
cannot think of any.

Additional context
I would add a screenshot but its so fast at happening.

Insomnia based on player instead of world

Today insomnia is world specific. This means that there is no option to clear insomnia from one player. Instead of having insomnia based upon world, it should be defined on player level so that I can individually decide who is in a state of insomnia.

Errors under Minecraft 1.20

Describe the bug
Error logs on Minecraft 1.20

To Reproduce
Steps to reproduce the behavior:
Version 5.2.5 under stable release Paper

[20:00:37 ERROR]: Could not pass event SleepSkipEvent to sleep-most v5.2.5
java.lang.NullPointerException: Cannot invoke "me.mrgeneralq.sleepmost.interfaces.IBossBarService.setVisible(org.bukkit.World, boolean)" because "this.bossBarService" is null
        at me.mrgeneralq.sleepmost.eventlisteners.SleepSkipEventListener.onSleepSkip(SleepSkipEventListener.java:105) ~[sleep-most-5.2.5.jar:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor120.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[paper-api-1.20-R0.1-SNAPSHOT.jar:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:81) ~[paper-api-1.20-R0.1-SNAPSHOT.jar:git-Paper-"3722877"]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.20-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[paper-1.20.jar:git-Paper-"3722877"]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[paper-1.20.jar:git-Paper-"3722877"]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:615) ~[paper-api-1.20-R0.1-SNAPSHOT.jar:?]
        at me.mrgeneralq.sleepmost.services.SleepService.executeSleepReset(SleepService.java:291) ~[sleep-most-5.2.5.jar:?]
        at me.mrgeneralq.sleepmost.eventlisteners.PlayerSleepStateChangeEventListener.lambda$onPlayerSleepStateChange$1(PlayerSleepStateChangeEventListener.java:122) ~[sleep-most-5.2.5.jar:?]
        at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.20.jar:git-Paper-"3722877"]
        at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483) ~[paper-1.20.jar:git-Paper-"3722877"]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1482) ~[paper-1.20.jar:git-Paper-"3722877"]
        at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:447) ~[paper-1.20.jar:git-Paper-"3722877"]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1396) ~[paper-1.20.jar:git-Paper-"3722877"]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1173) ~[paper-1.20.jar:git-Paper-"3722877"]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[paper-1.20.jar:git-Paper-"3722877"]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]

Option to sync sleep between worlds.

It would be helpful if I could specify in the config that I want to keep the world's time in-sync.
sync-worlds: true or something similar.

Or, to be more configurable, I'd have an entry under each world with the names of the other worlds sleep-most should time-skip whenever it is triggered for this world.

world:
  also-set: 
    - world2
    - world3

world2:
  also-set: 
    - world
    - world3

world3:
  also-set: 
    - world
    - world2

like this.

Failed to register TimeSkipEventListener

this is the error: [05:13:09 ERROR]: Plugin sleep-most v5.0.3 has failed to register events for class me.mrgeneralq.sleepmost.eventlisteners.TimeSkipEventListener because org/bukkit/event/world/TimeSkipEvent

I NEED FIX THIS T_T

Night skipped message showing twice

Describe the bug
When trying to sleep with the animation enabled, it would start running the animation for every player in addition to the required count. when the night is skipped, the message would show x additional amount of times (the count) the players went to sleep.

To Reproduce
Steps to reproduce the behavior:

  1. have night-cylce animation enabled (required count 1)
  2. go to sleep with 2 persons
  3. note how the chat says [2/1]
  4. wait for the night to be skipped and showing the message twice

Expected behavior
Show the message once, do not show the message [2/1] but nothing instead

image

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.