LightAPI 3.2.5

Bukkit library for create invisible light source

  1. EvilSpawn
    Tested Minecraft Versions:
    • 1.8
    • 1.9
    • 1.10
    • 1.11
    Source Code:
    https://github.com/BeYkeRYkt/LightAPI
    [​IMG]


    RESOURCE IS INACTIVE! SWITCH TO THIS FORK BY @bottomdumber !


    Description:

    This small library help you to create an invisible light sources.

    Features:
    - Create/Delete invisible light source.

    Support CraftBukkit implements :
    - CraftBukkit/Spigot (1.8.8 - 1.10)
    - PaperSpigot (Only 1.8.8)
    - Paper (1.9+)
    - TacoSpigot (1.9+)
    - Cauldron (1.7.10) <Experimental Support>

    Basic methods:
    - LightAPI

    • createLight(World, blockX, blockY, blockZ, lightLevel, async); - Creates light on this location and the level of light. If async state is set to "true", then the request will be created and added to the processing queue.
    Code (Text):
    LightAPI.createLight(location.getWorld(), location.getBlockX(), location.getBlockY(), location.getBlockZ(), 15, true);
    If you have Location, you can use this:
    Code (Text):
    LightAPI.createLight(location, 15, true);
    • deleteLight(World, blockX, blockY, blockZ, async); - delete light on this location. If async state is set to "true", then the request will be created and added to the processing queue.
    Code (Text):
    LightAPI.deleteLight(location.getWorld(), location.getBlockX(), location.getBlockY(), location.getBlockZ(),  true);
    If you have Location, you can use this:
    Code (Text):
    LightAPI.deleteLight(location,  true);
    • collectChunks(Location loc); - Collects and returns a list of changed chunks.
    Code (Text):
    LightAPI.collectChunks(player.getLocation());
    • updateChunk(ChunkInfo info); - It sends the modified chunk players.
    Code (Text):
    LightAPI.updateChunk(info);
    Advanced Methods:
    - ServerModManager

    • registerServerMod(ServerModInfo info); - Registration of the new platform. ServerModInfo contains a map with classes for initialization NMSHandler under the version of CraftBukkit implementation.
    Code (Text):
    // Example code from LightAPI 3.0.0
    ServerModInfo spigot = new ServerModInfo("Spigot");
    spigot.getVersions().put("v1_8_R3", CraftBukkit_v1_8_R3.class);
    spigot.getVersions().put("v1_9_R1", CraftBukkit_v1_9_R1.class);
    spigot.getVersions().put("v1_9_R2", CraftBukkit_v1_9_R2.class);
    spigot.getVersions().put("v1_10_R1", CraftBukkit_v1_10_R1.class);
    ServerModManager.registerServerMod(spigot);
    • unregisterServerMod(String modName); - Unregistration of CraftBukkit implementation.
    Code (Text):
    ServerModManager.unregisterServerMod("Spigot");
    • getNMSHandler(); - initialized NMSHandler after enable main plugin.
    Code (Text):
    ServerModManager.getNMSHandler();
    Events:
    - SetLightEvent
    - DeleteLightEvent
    - UpdateChunkEvent

    Commands:
    - /lightapi - main command
    - /lightapi update - connect to GitHub and check update

    Configuration:
    Code (Text):
    # LightAPI v3.2.0-dev Configuration
    # by BeYkeRYkt
    version: 3 //version config
    update-delay-ticks: 2 //frequency processing query in ticks
    max-iterations-per-tick: 400
    updater:
      enable: true
      repo: BeYkeRYkt/LightAPI
      update-delay-ticks: 40
      view-changelog: false
     
    Example code:
    Special versions:

    Known issues:
    • Cauldron on the wider area of the light sometimes does not work.
    • Sometimes, after the installation of light it disappears.
    • Sometimes, the light can not disappear.
    • When you'll frequently update the chunks, the server begins to lags.
    Source code:
    License is MIT.
    https://github.com/BeYkeRYkt/LightAPI

    If you find any bugs, I ask you to write about it in this thread.

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

Recent Updates

  1. LightAPI now is inactive
  2. 3.2.4
  3. 3.2.3

Recent Reviews

  1. 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.
  2. TestMod
    TestMod
    1/5,
    Version: 3.2.4
    Please Update This Plugin!
    Please.
    I cant use it.
    Because DiceFurniture want this Plugin.
  3. mar_robHD
    mar_robHD
    1/5,
    Version: 3.2.4
    Please Update IT!

    Sonnst mache ich es!!!

    Ich muss es dann Decompilen!
    mar_robHD
  4. jupiter1390
    jupiter1390
    5/5,
    Version: 3.2.4
    Need update for 1.12.1. It doesn't work with 1.12.1, also lightsource does :( d
  5. Cuthmf
    Cuthmf
    5/5,
    Version: 3.2.4
    Not work here, please helpme.

    MY CODE:

    new BukkitRunnable() {

    @Override
    public void run() {
    for (Player p : Bukkit.getServer().getOnlinePlayers()) {
    if (p.getInventory().getItemInOffHand().getType() == Material.TORCH) {
    LightAPI.createLight(p.getLocation(), 15, true);
    for (ChunkInfo info : LightAPI.collectChunks(p.getLocation())) {
    LightAPI.updateChunk(info);
    }
    }
    }
    }
    }.runTaskTimer(Main.getPlugin(Main.class) , 1,10);
    new BukkitRunnable() {

    @Override
    public void run() {
    for (Player p : Bukkit.getServer().getOnlinePlayers()) {
    if (p.getInventory().getItemInOffHand().getType() == Material.TORCH) {
    Location location = p.getLocation();
    LightAPI.deleteLight(location.getWorld(), location.getBlockX(), location.getBlockY(), location.getBlockZ(), true);
    LightAPI.createLight(p.getLocation(), 15, true);

    for (ChunkInfo info : LightAPI.collectChunks(p.getLocation())) {
    LightAPI.updateChunk(info);
    }

    }
    }
    }
    }.runTaskTimer(Main.getPlugin(Main.class), 5, 20);
    }
    }
  6. Pas02
    Pas02
    5/5,
    Version: 2.0.1
    Please update to Spigot 1.9.4!!! Very nice Plugin!!!
    -------------------------------------------------------------------------
  7. FreeWall
    FreeWall
    5/5,
    Version: 2.0.1
    Also need an 1.9.4 update, please.
    -----------------------------------------------------------------
  8. AsVaidas
    AsVaidas
    5/5,
    Version: 2.0.1
    Mabey an update to 1.9.4? I need it as fast, as posible
    ---------------------------------------------------------------------------
  9. evilLamer
    evilLamer
    5/5,
    Version: 1.4.2
    Thanks man it's perfect :)
  10. Aditya
    Aditya
    5/5,
    Version: 1.4.2
    Great, nice work dude. Keep this updated for ever, we don't wanna loose this awesome piece of code. It's amazing! :)