Light Cleaner 1.16.5-v1

Regenerates light levels in your world, fixing bugged lighting such as black cliffs

  1. TeamBergerhealer
    Tested Minecraft Versions:
    • 1.8
    • 1.9
    • 1.10
    • 1.11
    • 1.12
    • 1.13
    • 1.14
    • 1.15
    • 1.16
    Source Code:
    https://github.com/bergerhealer/Light-Cleaner
    Contributors:
    bergerkiller
    Requires BKCommonLib for the low-level API's

    Join our discord for plugin help https://discord.gg/wvU2rFgSnw

    Light cleaner is a simple plugin fulfilling a very powerful task: regenerating lighting. It does so running on a dedicated thread, using it's own optimized methods to minimize performance loss for the server. By operating on raw data it is easily capable of chomping through 200 chunks a second!

    As of 1.12-v2, it is now also possible to let the plugin automatically clean up light for newly generated chunks. This way there is no need to use the commands while players explore new areas of the world.

    Motivation
    A bug that has haunted minecraft forever is the infamous dark lighting found all over the place when chunks are generated. You'll find them in caves, against canyon walls, in the nether and even underground! All of this buggy-looking light ruins the aesthetics that makes Minecraft nature beautiful. Worse, the constant client-side fixing of this lighting drags client-side performance down, especially in the nether or extreme biomes.

    lightcleaner_demo.jpg

    No more! With a simple command this plugin will eagerly chomp away at millions of blocks, recalculating their light levels completely from scratch. It uses vanilla Minecraft block information for this, which means it will look just as intended.

    Another use is repairing light levels after plugins alter blocks in "fast" ways, such as WorldEdit. If blocks are altered while executing the slow server light regeneration function, it would take ages to change blocks. This plugin offers best of both worlds, allowing repairs after the fact.

    By utilizing a powerful algorithm combined with smart caching it is capable of regenerating this lighting much faster and more accurately. Lighting can be repaired for all the chunks in your view, or for all the chunks of a world. The main server thread is not stalled while doing these calculations.

    Commands
    This plugin offers the following commands:
    Code (Text):
    /cleanlight - regenerate lighting for all chunks you can see
    /cleanlight 12 - regenerate lighting 25x25 chunks around you
    /cleanlight world - regenerate lighting in the current world
    /cleanlight world world1 - regenerate lighting for world1
    /cleanlight abort - cancels any ongoing lighting operations
    /cleanlight status - checks up on the status of the repairs
    /cleanlight at [chunk_x] [chunk_z] [chunk_radius] (world) - regenerate lighting remotely (command blocks)
    Permissions
    Code (Text):
    Allows the player to regenerate lighting within player view radius
    lightcleaner.clean.view

    Allows the player to clean at any radius, even beyond view radius
    lightcleaner.clean.any

    Allows the player to regenerate for entire worlds (that's a lot of chunks!)
    lightcleaner.clean.world

    Allows the player to only clean an area of a specific radius or less.
    For example, radius 5 allows command /cleanlight 5 and /cleanlight 4, but not /cleanlight 6.
    lightcleaner.clean.radius.[radius]
    lightcleaner.clean.radius.5

    Allows the player to abort all lighting operations
    lightcleaner.abort

    Allows the player to check up on the status
    lightcleaner.status
    Configuration
    To turn on automatic cleaning of newly generated chunks, set the following in the config.yml:
    Code (Text):
    autoCleanEnabled: true
    To turn on automatic cleaning after players perform WorldEdit/FastAsyncWorldEdit operations, set the following in the config.yml:
    Code (Text):
    autoCleanWorldEditEnabled: true
    When remaining available memory (in MB) on the server drops too low, light cleaner will pause and save worlds to reduce memory until it can continue. If you run into out of memory problems, raise this value. If you feel it stalls for too long, lower it.
    Code (Text):
    minFreeMemory: 400
    When processing the plugin has to load large areas of chunks as fast as possible. With high concurrency it will queue a lot of chunks for loading at the same time, while with low it may wait a longer time. If you find the plugin affecting server performance too much, lower this value.
    Code (Text):
    asyncLoadConcurrency: 50
    If you have worlds that aren't persistently saved to disk, you may want to disable saving on these worlds. This also prevents the plugin from continueing lighting operations when the server is restarted.
    Code (Text):
    unsavedWorldNames:
      - worldname1
    FAWE
    FastAsyncWorldEdit has had some issues with glitched lighting after making changes to the world. You can turn on automatic cleaning after performing changes using FAWE in the config.yml. Please make sure to also disable the builtin cleaning in FAWE's config.yml if you do (mode: 0)!
    Code (Text):
    lighting:
      # If packet sending should be delayed until relight is finished
      delay-packet-sending: true
      async: true
      # The relighting mode to use:
      #  - 0 = None (Do no relighting)
      #  - 1 = Optimal (Relight changed light sources and changed blocks)
      #  - 2 = All (Slowly relight every blocks)
      mode: 0
      # If existing lighting should be removed before relighting
      remove-first: false
    Unfixable lighting glitches
    Minecraft completely deletes chunk slices (16x16x16 blocks) when all blocks in it are air. As a result, no lighting information can be stored in there. Blocks that touch these 'no-light' zones show up as very dark lighting sometimes. This is a Minecraft bug that can't easily be fixed. You can work around it by moving the surface touching this empty slice by one block, or by placing a block in the empty slice so it is no longer empty. A single barrier block can make minecraft see it as non-empty, allowing light to be saved.

    This is primarily a problem in nether worlds where empty slices default to a dark color, instead of light like in overworlds.

    Notes
    • This plugin requires BKCommonLib to be installed
    • This plugin is a continuation of "NoLagg Lighting", a component held back by issues that stall the main plugin from release.
    • Care was taken to not write any block information to the chunks. This is to prevent catastrophic losses of world data. Only light levels are updated.
    • Repairing worlds does incur a potential tick rate drop while loading and saving chunks from/to disk. This tick rate drop is minimized by limiting the amount of chunks loaded at once.
    • Do not enable the automatic cleaning function if your server is Minecraft version 1.14 or newer. Not only is it no longer required, it will cause endless chunks to be generated well past your world border. This is because the server generates 3-deep neighbouring chunks in the background for every chunk that is loaded.

    Donate
    If you really like my work and want to give something in return, feel free to donate something small to me using the link down below. Thank you! :)

    [​IMG]

Recent Reviews

  1. Prokyn
    Prokyn
    5/5,
    Version: 1.16.5-v1
    The plugin works very well. The installation is simple. The function of the plugin works immediately. Thanks!
  2. Eejit
    Eejit
    5/5,
    Version: 1.16.5-v1
    This has fixed so many issues that would have taken me ages to do otherwise, thanks for making such a great plugin!! :D
  3. PrinceBunBun981
    PrinceBunBun981
    5/5,
    Version: 1.16.5-v1
    Honestly, this plugin saves me hours of manually trying to fix lighting glitches. I don't know what I would do without it.
  4. Demon_I
    Demon_I
    5/5,
    Version: 1.16.5-v1
    Can I use this on a Fabric server? Phosphor messed my world all up and would love to use this to fix it.
    1. TeamBergerhealer
      Author's Response
      No, only Forge hybrid servers are supported. There was a Bukkit4Fabric experimental setup, but work on this had ceased
  5. NutmegNam
    NutmegNam
    5/5,
    Version: 1.16.5-v1
    Worked exactly as expected, simple and to the point, finally taking care of the dreaded lighting bugs!!
  6. NeroxiaMC
    NeroxiaMC
    5/5,
    Version: 1.16.5-v1
    Really good plugin, thank you bro ! This plugin saved my life, I searched a lot of plugins
  7. Pulsi_
    Pulsi_
    5/5,
    Version: 1.16.5-v1
    WOW, Whit FAWE i had a lot of issues with light, and now... WOW, I FIND THIS AWESOME PLUGIN AND SAVE MY LIFE!! THANKS!
  8. lokka30
    lokka30
    5/5,
    Version: 1.16.5-v1
    As seemingly most others in this reviews section, this has also solved my WorldEdit lighting issue on the Creative server I have set up for my friends and I to build on, especially where '//fixlighting' is weak or completely useless on.
  9. LimitedGames
    LimitedGames
    5/5,
    Version: 1.16.5-v1
    Verry nice plugin, fixed random worldedit light bugs to!
    Thank you! Keep up the great work
  10. DefinitlyEvil
    DefinitlyEvil
    5/5,
    Version: 1.16.5-v1
    A must-have plugin for your server if you use WorldEdit, this plugin can solve lot of painful black/dark areas of blocks after you do world editing.