LightAPI 5.2.0

Bukkit library for edit light levels

  1. EvilSpawn
    Tested Minecraft Versions:
    • 1.13
    • 1.14
    • 1.15
    • 1.16
    • 1.17
    • 1.18
    Source Code:
    https://github.com/BeYkeRYkt/LightAPI
    Contributors:
    Qveshn
    [​IMG]
    Description
    Bukkit library for edit light levels

    Features
    - Edit light levels in minecraft world

    Current supported platforms
    - CraftBukkit/Spigot (1.14.1 - 1.18)

    Current supported light engines
    - Vanilla engine (1.14.1 - 1.18)
    - Starlight engine (1.17.1 - 1.18)

    How to use
    Very simple.
    If you want to edit light level (with deferred policy):
    Code (Text):
    LightAPI.get().setLightLevel(String worldName, int blockX, int blockY, int blockZ, int lightLevel);
    After calling this function, your request is added to the queue and will be executed after a while with automatic sending to all clients (by default, after 1 tick).

    If you want more control, you can use:
    Code (Text):
    LightAPI.get().setLightLevel(String worldName, int blockX, int blockY, int blockZ, int lightLevel, int lightFlags);
    LightAPI.get().setLightLevel(String worldName, int blockX, int blockY, int blockZ, int lightLevel, int lightFlags, ICallback callback);
    LightAPI.get().setLightLevel(String worldName, int blockX, int blockY, int blockZ, int lightLevel, int lightFlags, EditPolicy editPolicy, SendPolicy sendPolicy, ICallback callback);
    Using the following parameters, you can:
    - lightFlags: choose which lighting layer to make changes on, as well as combine them;
    - editPolicy: choose a edit policy (apply changes right now, apply immediately taking into account the state of the server, or apply deferred (by default 1 tick)).
    - sendPolicy: choose a policy for sending lighting data to clients (send separate packets for each change or combine the same chunks within an interval (by default 2 tick)).
    - callback: get execution result codes about completed stages.

    If this is not enough for you, then you can use IBukkitExtension to get a Handler class.
    Code (Text):
    IBukkitExtension ext = (IBukkitExtension) LightAPI.get().getExtension();
    IHandler rawHandler = ext.getHandler();
    With this class, you get "raw" access to library elements.

    Commands
    - /lightapi - main command

    Known issues
    - (ALL) Custom lighting levels have no protection from in-game minecraft mechanics. Therefore, the light may disappear if a regular block is placed/broken nearby (within a radius of one block) or will it just happen.
    - (STARLIGHT) After unloading chunks, some custom lighting levels disappear from unloaded chunk.
    - (STARLIGHT) There may be problems with the IMMEDIATE edit policy set.
    - (STARLIGHT) At a random moment in time, the server may crash for unknown reasons.

    - GitHub

    Configuration
    Default configuration:
    Code (Text):
    general:
      debug: false
      enable-metrics: true
      enable-compatibility-mode: false
      force-enable-legacy: false
      specific-handler-path: none
      handlers:
        craftbukkit:
          factory-path: ru.beykerykt.minecraft.lightapi.bukkit.internal.handler.craftbukkit.HandlerFactory
    BukkitBackgroundService:
      corePoolSize: 1
    BukkitScheduledChunkObserver:
      tick-period: 2
    BukkitScheduledLightEngine:
      relight-strategy: DEFERRED
      tick-period: 1
      max-time-ms-in-per-tick: 50
      max-iterations-in-per-tick: 256
     
    general:
    debug - enables debug messages.
    enable-metrics - enables bStats metrics.
    enable-compatibility-mode - enables compatibility mode, where instead of editing lighting data, the plugin places blocks of light. Does not support Skylight editing. Works only with 1.17+.
    force-enable-legacy - enables support for legacy plugins (from ru.beykerykt.lightapi namespace).
    specific-handler-path - the path for forced loading of the handler.
    handlers.* - a list of platforms and their paths to the HandlerFactory.
    BukkitBackgroundService:
    corePoolSize - The number of threads allocated for internal tasks.
    BukkitScheduledChunkObserver:
    tick-period - The delay in server ticks before queue processing.
    BukkitScheduledLightEngine:
    relight-strategy - A strategy for recalculating lighting. The values can be as follows: DEFERRED - recalculation is performed after ALL changes are applied. FORWARD - recalculation is performed after EACH change.
    tick-period - The delay in server ticks before queue processing.
    max-time-ms-in-per-tick - The maximum time (in milliseconds) allocated for processing requests for each tick.
    max-iterations-in-per-tick - The maximum number of processed requests per tick.

    Example usage
    Code (Java):
    int blockLight = LightAPI.get().getLightLevel(worldName, blockX, blockY, blockZ,
                                                  LightFlag.BLOCK_LIGHTING);
    broadcastMessage("LightLevel: " + blockLight);
    int resultCode =
        LightAPI.get().setLightLevel(worldName, blockX, blockY, blockZ, lightLevel);
    switch (resultCode) {
      case ResultCode.SUCCESS:
        // The request was executed.
        break;
      case ResultCode.MOVED_TO_DEFERRED:
        // The request has been moved to the queue and will be executed after a
        // while.
        break;
      default:
        broadcastMessage("Something is wrong. Result code:" + resultCode);
        break;
    }
    - BeYkeRYkt's bukkit-example plugin
    - ???

    Maven
    https://jitpack.io/#BeYkeRYkt/LightAPI
    subproject: lightapi-bukkit-common
    Code (Text):
    <dependency>
         <groupId>com.github.BeYkeRYkt</groupId>
         <artifactId>lightapi-bukkit-common</artifactId>
         <version>5.1.0</version>
         <scope>provided</scope>
    </dependency>
    Special thanks
    - Qveshn (@bottomdumber) - for continuous support for Legacy version
    - and other contributors who create a pull requests and report errors found.

    Source code
    https://github.com/BeYkeRYkt/LightAPI
    License is MIT

    Metrics
    Plugin uses the bStats metrics.
    Privacy policy
    bStats license

Recent Updates

  1. 5.2.0
  2. 5.1.0
  3. 5.0.0

Recent Reviews

  1. mkdgarp
    mkdgarp
    5/5,
    Version: 5.2.0
    Great, the new update can be used on 1.18.2. Thank you very much. The plugin is very necessary for me.
  2. Detar
    Detar
    5/5,
    Version: 5.1.0
    This is a great plugin you can use. Can you update it to work on 1.18.2? I can't get it to work on 1.18.2
  3. mkdgarp
    mkdgarp
    5/5,
    Version: 5.1.0
    This is a must for glowing furniture. Thank you for creating it. Can you update it to work on 1.18.2?
  4. LoneDev
    LoneDev
    5/5,
    Version: 5.0.0
    Thanks for your hard work!
    This even works with Paper 1.17+. Very good.

    Good resource for both devs and admins
  5. IPECTER
    IPECTER
    5/5,
    Version: 5.0.0-preview
    I've been waiting for this update.
    I visited your GITHUB from time to time and I looked forward to it a lot.
    It works really well! Thank you!
  6. MelaniumAS
    MelaniumAS
    5/5,
    Version: 3.2.9
  7. Mario34TheBest
    Mario34TheBest
    5/5,
    Version: 3.2.9
    Good resource, but when you add 1.15-1.16 support? We all java programmers need it
  8. xuanzhou
    xuanzhou
    5/5,
    Version: 3.2.9
    Good!It's useful for developers and some server.I wanted to mark 50starsbut only 5.May I reposted it to mcbbs.net(The biggest forum of China)?I'll mark the original page and source code page.Look forward.Thanks!
  9. LordofLightning
    LordofLightning
    5/5,
    Version: 3.2.5
    For those of you who are unable to notice obvious important information. Please scroll up to the top, where you will find a large line in mostly red stating 'RESOURCE IS INACTIVE! SWITCH TO THIS FORK BY @bottomdumber !"

    In the future, don't leave bad reviews on abandoned resources, it won't help you in any way, it will only make other people despise you.
  10. TestMod
    TestMod
    1/5,
    Version: 3.2.4
    Please Update This Plugin!
    Please.
    I cant use it.
    Because DiceFurniture want this Plugin.