From 9a7f982668168aa8b634ebcc53a6d42433719708 Mon Sep 17 00:00:00 2001
From: CraftBukkit/Spigot <noreply+git-craftbukkit@papermc.io>
Date: Sun, 2 Jan 2011 18:30:46 -0800
Subject: [PATCH] Block.getLightLevel()

By: sk89q <the.sk89q@gmail.com>
---
 .../org/bukkit/craftbukkit/CraftBlock.java    | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftBlock.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftBlock.java
index 43ca3fbaa6..77407749d9 100644
--- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftBlock.java
+++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftBlock.java
@@ -11,6 +11,7 @@ public class CraftBlock implements Block {
     private final int z;
     protected int type;
     protected byte data;
+    protected byte light;
 
     protected CraftBlock(final CraftWorld world, final int x, final int y, final int z, final int type, final byte data) {
         this.world = world;
@@ -19,6 +20,19 @@ public class CraftBlock implements Block {
         this.z = z;
         this.type = type;
         this.data = data;
+        this.light = (byte)world.getHandle().i(x, y, z);
+        this.chunk = (CraftChunk)world.getChunkAt(x << 4, z << 4);
+    }
+
+    protected CraftBlock(final CraftWorld world, final int x, final int y,
+            final int z, final int type, final byte data, final byte light) {
+        this.world = world;
+        this.x = x;
+        this.y = y;
+        this.z = z;
+        this.type = type;
+        this.data = data;
+        this.light = light;
         this.chunk = (CraftChunk)world.getChunkAt(x << 4, z << 4);
     }
 
@@ -122,6 +136,15 @@ public class CraftBlock implements Block {
     public int getTypeID() {
         return type;
     }
+    
+    /**
+     * Gets the light level between 0-15.
+     * 
+     * @return light level
+     */
+    public int getLightLevel() {
+        return light;
+    }
 
     /**
      * Gets the block at the given face