Harbor - A Sleep Enhancement Plugin! 1.6.3

Harbor is a plugin that redefines sleep within your Spigot server!

  1. TechToolbox
    Native Minecraft Version:
    1.14
    Tested Minecraft Versions:
    • 1.14
    • 1.15
    • 1.16
    Source Code:
    https://github.com/nkomarn/Harbor
    [​IMG]
    Ahoy, matey! Harbor is a Spigot plugin that redefines how sleep works in your server, making it easier for all the online players to get in bed quick and skip through the night!

    [​IMG]

    NOTE: When updating to version 1.6, your previous configuration files WILL NOT work.
    [​IMG]
    Harbor is designed to encourage players to sleep! It works best when installed in a survival SMP server, making it easier for players to skip the night and prevent Phantom attacks! Oh, it also does these things:

    - The night can be smoothly skipped if a percentage of players are sleeping (customizable percentage in configuration)
    - A counter of currently sleeping players is displayed to encourage other players to sleep.
    - Players are notified in the chat or action bar if someone is sleeping.
    - Players with the "harbor.bypass" permission can be excluded from the sleep count. Players in creative and spectator gamemodes can also be excluded.
    - AFK players can be ignored from the sleep count.
    - PHANTOMS! Those darn things can be disabled!

    If you need 1.8-1.13 support, the last version supported is Harbor 1.5.3. Harbor 1.6+ is 1.14+ only.

    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]
    NOTE: The video only covers features that were available in version 1.0 of the plugin, so there's way more available now!
    [​IMG]
    • firestartermc.com
    • play.lemoncloud.org
    • mc.ohneegaming.com
    • play.treebomc.com
    • friendsvanilla.net
    • silverstone.servegame.com

    [​IMG]
    I believe that all plugins should be totally configurable, and as such, every part of this plugin can be modified in the configuration file! Every message is customizable and has full support for unicode and color codes.

    Code (YAML):

    # Harbor - Sleep mechanics enhancement plugin
    # An open-source project by TechToolbox (@nkomarn)
    # https://github.com/nkomarn/Harbor

    # Important note regarding Essentials:
    # Please make sure you negate the permission "essentials.sleepingignored" to
    # prevent issues with Harbor and server operators when running Essentials.

    night-skip
    :
      enabled
    : true # Skip the night if a percentage of the players in a world are sleeping
      percentage
    : 50 # Percentage of players required to be sleeping to skip the night (0 - 100)
      time-rate
    : 70 # The amount of ticks added to the current time every tick when skipping the night
      daytime-ticks
    : 1200 # The time in ticks that Harbor considers day
      instant-skip
    : false # Instantly skip the night when the percentage threshold is reached instead of showing the full animation
      proportional-acceleration
    : false # Increase the night skipping speed based on the amount of sleeping players
      clear-rain
    : true # Clear rain (if it's raining) when the night is skipped
      clear-thunder
    : true # Clear thunder (if it's thundering) when the night is skipped
      reset-phantom-statistic
    : true # Treats everyone online as if they have slept in the last 3 days after the night is skipped (check out /gamerule doInsomnia on 1.15+)

    exclusions
    :
      ignored-permission
    : true # Exclude players with the permission "harbor.ignored" from the sleeping count
      exclude-adventure
    : true # Exclude players in adventure mode from the sleeping count
      exclude-creative
    : true # Exclude players in creative mode from the sleeping count
      exclude-spectator
    : true # Exclude players in spectator mode from the sleeping count
      exclude-vanished
    : true # Exclude vanished players from the sleeping count

    # Detect AFK players and automatically remove them from the required sleeping count
    # Essentials API is used for AFK detection when available- otherwise a fallback system is used
    afk-detection
    :
      enabled
    : true
      timeout
    : 15 # Time in minutes until a player is considered AFK

    # Blacklist for worlds- Harbor will ignore these worlds
    blacklisted-worlds
    :
     - "world_nether"
      - "world_the_end"
    whitelist-mode
    : false # Will treat the above list as a whitelist instead of a blacklist

    messages
    :
      chat
    :
        enabled
    : true
        message-cooldown
    : 5 # The amount of time in seconds before a player can send another bed enter or leave message
        player-sleeping
    : "&e[player] is now sleeping ([sleeping]/[needed], [more] more needed to skip)."
        player-left-bed
    : "&e[player] got out of bed ([sleeping]/[needed], [more] more needed to skip)."
        night-skipping
    :
         - "&eAccelerating the night."
          - "&eRapidly approaching daytime."
        night-skipped
    :
         - "&eThe night has been skipped."
          - "&eAhhh, finally morning."
          - "&eArghh, it's so bright outside."
          - "&eRise and shine."
      actionbar
    :
        enabled
    : true
        players-sleeping
    : "&e[sleeping] out of [needed] players are sleeping ([more] more needed to skip)"
        night-skipping
    : "&eEveryone is sleeping- sweet dreams!"
      bossbar
    :
        enabled
    : true
        players-sleeping
    :
          message
    : "&f&l[sleeping] out of [needed] are sleeping &7&l([more] more needed)"
          color
    : BLUE
        night-skipping
    :
          message
    : "&f&lEveryone is sleeping. Sweet dreams!"
          color
    : GREEN
      miscellaneous
    :
        chat-prefix
    : "&8&l(&6&lHarbor&8&l)&f "
        unrecognized-command
    : "Unrecognized command."

    # Spooky internal controls
    version
    : 1.6.2
    interval
    : 1
    metrics
    : true
    debug
    : false
     


    [​IMG]
    I am constantly thinking of ways to improve Harbor. As such, updates are usually pretty feature packed, so here's an extensive change log of all the things I've added, changed, or removed from Harbor:

    Version 1.6.2
    • Rewrote a majority of the codebase to optimize for performance. Changes include minimizing static variable use throughout the codebase and using Fastutil type-specific HashMaps where possible for the best performance.
    • Made the world checker task asynchronous.
    • Refactored the configuration file, making options more clear and easily accessible.
    • Added bossbar messages that display when players are in bed with progress until night skip.
    • Re-implemented chat messages for bed entry/leave.
    • Added a chat message cooldown for bed entry/leave, configurable in the config.
    • Added a [displayname] placeholder to chat messages.
    • Added an option to exclude vanished players from Harbor's counts.
    • Players with isSleepingIgnored are now ignored from Harbor's counts.
    • Added /forceskip to allow players to forcibly skip the night in their world if they have the "harbor.forceskip" permission node.
    • Added an instant night skip toggle, which allows the skip animation to be bypassed (mimics Harbor 1.5 and lower behavior).
    • Added proportional acceleration as a configuration option. Enabling this speeds up the night skip rate based on the amount of players sleeping out of the online player count (https://github.com/nkomarn/Harbor/issues/47).
    • Re-implemented lightweight fallback AFK kick system in case your server doesn't use Essentials.
    • Fixed night skip loops being triggered when weather and thunder clearing was disabled but night was skipped during a thunderstorm.
    • Added a world blacklist and whitelist.
    • Made weather and thunder toggles independent.
    • The time in ticks that Harbor considers as day time is now configurable.
    • Added a configurable night skip time tick change rate.
    • Added a warning system in case Harbor 1.6.2 is ran with the 1.6.1 configuration.
    • Removed auto updater.


    Version 1.6.1
    - Fix update notifier join lag!


    Version 1.6
    - Massively improved and simplified code! The whole plugin runs on a timer and uses newer API features
    - Improved auto-updater system
    - World blacklisting
    - Smooth night skip! The night now smoothly accelerates until daytime.
    - Removed NMS code, which slimmed down the plugin a lot
    - Essentials AFK integration!
    - Fixed configuration reloading
    - Fixed weird message loop that would occur with 1.5 versions of Harbor
    - Fixed permissions issues
    - And lots, lots more! Harbor 1.6 is a completely new plugin on the inside!


    Version 1.5.2
    - More fixes! Fixed the timer, which in turn will fix the night skip logic some and also make the actionbar actually work :)


    Version 1.5.1
    - Just plain old fixes. Nothing more nothing less.
    - Fixed updater to actually work (Spiget API seems to be broken for Harbor)
    - Fixed the night skip on player leave bug
    - Added fixes for new Spigot API changes

    Version 1.5
    - Recoded the WHOLE plugin, this time making a nice Util class and a bunch of other stuff to ensure smooth operation!
    - Added complete 1.13.2 - 1.14.2 support!
    - Added a feature to disable Phantom spawning (those darn things).
    - Made it possible to exclude players in creative and spectator mode.
    - Added an auto-updater! It'll notify you when a new update it out and allow you to automatically download and install the update!
    - Created an AFK player detection system, which will exclude AFK players from the needed count.
    - Added title messages in the morning, night, and when going to sleep.
    - Added a sleep delay that will make skipping the night less jarring.
    - Implemented a "/sleeping" command which will display a GUI with currently sleeping players in your world!
    - Finally fixed all math bugs. I think.
    - Changed the rounding used for calculating needed players from floor to ceil.
    - Made the repeated task less intensive on the server through the use of lambdas.
    - Added a configuration version check that will warn you if your configuration is out of date!
    - Implemented messages that display when a player leaves their bed.
    - And many, many more optimizations!


    Version 1.4.4
    - Fixed the OP/permission bypass feature!
    - Added a feature that allows you to disable sleeping completely (pretty sure it only works on 1.13.2 right now)


    Version 1.4.3
    - Fixed a Null Pointer Exception when operators would try to sleep!


    Version 1.4.2
    - Added support for 1.13.2
    - Removed the configuration version check as it was totally broken and rather useless


    Version 1.4
    - Recoded and optimized the whole plugin!
    - Added multi world support!
    - Fixed player bypass, now fully excluding players with permission "harbor.bypass" from counts of all types!
    - Made it so that weather clears when night is skipped!
    - Added a lot more messages to the configuration.
    - Literally remade the WHOLE configuration!
    - Added a command allowing for reloading the configuration ("/harbor reload")!
    - Implemented a debug option that prints extra messages to console for debugging purposes.
    - Added an action bar placeholder that displays the amount of players that are needed for the night to skip.
    - Added a feature that knocks players out of bed to prevent plugin glitches.
    - Added configuration version checking (old configurations will be incompatible)
    - Fixed the negative player count issue
    - Fixed some minor math bugs to make the plugin round better.


    Version 1.3.2
    - Added permission "harbor.bypass" which will allow players with it to skip the night!
    - Made it so that putting the messages as blank in config won't print blank lines in chat.


    Version 1.3.1
    - Prevented night skipping if only one player is online.
    - Fixed night skipping on server versions 1.12.2 and below (night would skip no matter what even if one player got into bed)


    Version 1.3
    - You can now change the amount of players that need to be sleeping to skip the night!
    - Fixed the action bar player counter (previously would get stuck at 1 player).


    Version 1.2
    - Harbor now supports all versions from 1.8 to 1.13.1!
    - The default sleeping check time has been lowered to 1 seconds in the config.
    - Fixed a bug where the amount of players sleeping would go below zero if the server was reloaded while players were in bed.

    Version 1.1
    - The night can now be skipped if more than half of the online players are sleeping.
    - Added optional chat messages (same as actionbar ones).
    - Added a chat message that displays which player went to bed.
    - The interval at which the plugin checks for players in bed can now be changed (can be set higher for weaker servers).
    - Added more toggles and messages to configuration.
    - Fixed bug where action bar messages would not show for a while after reloading the server.

    Version 1.0
    - When players enter a bed, a message is shown in the actionbar to inform other players that it is time to sleep.

    [​IMG]
    [​IMG]
    [​IMG]

Recent Reviews

  1. SecretLusico
    SecretLusico
    4/5,
    Version: 1.6.3
    This Plugin is overall great, but at this version i have a "little" bug.
    The rain can't skipped (the messages are spamming the chat), but nothing passed ... otherwise, as i said, the plugin is the best i have ever seen - Good Job!
    1. TechToolbox
      Author's Response
  2. xCurlyFry
    xCurlyFry
    5/5,
    Version: 1.6.3
    Fantastic Plugin, Being an Owner running a small Community Server, It's great to use this plugin as a "Skip Night" feature, 10/10 Plugin
  3. RedstoneFuture
    RedstoneFuture
    5/5,
    Version: 1.6.3
    It's a smart plugin with an understandable config. The animation, the bypass and the random text-messages works great. Thank you.
  4. victorlindox
    victorlindox
    5/5,
    Version: 1.6.3
    Nice Pluginnn <3 <3 <3 <3
    the best plugin there...............................,
  5. LucidREM
    LucidREM
    5/5,
    Version: 1.6.3
    definitely love this plugin. well done. great config and excellently executed. perfect addition to Minecraft.
  6. ezerotszaz
    ezerotszaz
    5/5,
    Version: 1.6.3
    Absolutely amazing plugin, easy and understandable configuration, and working fine. Definitely recommend it.
  7. MaxJFG
    MaxJFG
    5/5,
    Version: 1.6.2
    Nice Plugin. Its cool for all languages. I translate it To German for my Servers. +rep
  8. Cocoa
    Cocoa
    5/5,
    Version: 1.6.2
    Works great. Replaced SmoothSleep because of conflicts. I miss the boss-bar progress-bar, but I appreciate this plugin. Thanks!
  9. CaptainKirk55
    CaptainKirk55
    5/5,
    Version: 1.6.2
    This plugin is great! Love the night skipping animation. Do recommend it for survival servers.
  10. Ansandr
    Ansandr
    5/5,
    Version: 1.6.2
    The best plugin among its peers.
    I am especially pleased with the relevance of the plugin and support for the action bar