Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-6245

Implement a re-calculate lighting method.

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Incomplete
    • Icon: Minor Minor
    • None
    • None
    • 1.16.4
    • Yes

      It would be a useful method to be able to access via the spigot api to re-calculate lighting at a specific location. With mojang's rework of the lighting engine, there is an easy way to access the method via NMS so it shouldn't be a big burden to add to the spigot API.

      The following is how to do it via NMS

      public void updateLighting(Location location) {
          net.minecraft.server.v1_16_R2.World nmsWorld = ((CraftWorld) world).getHandle();
          nmsWorld.e().a(new BlockPosition(location.getBlockX(), location.getBlockY(), location.getBlockZ()));
      }

      with nmsWorld.e() getting you the lightingEngine object and lightingEngine.a(BlockPostion) marking that position to be re-calculated.

       

       

            Unassigned Unassigned
            Raster556 Raster556
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: