diff options
author | Mike Primm <mike@primmhome.com> | 2011-12-29 13:31:21 -0600 |
---|---|---|
committer | Erik Broes <erikbroes@grum.nl> | 2012-01-17 19:45:23 +0100 |
commit | fb1cfea89e46f198d683b045586437ef09ed311f (patch) | |
tree | 939673a9a068968cb817398bee72159e4a6144a1 | |
parent | f7585e552d2ff2cf5fbec7a255b6358d60d2513a (diff) | |
download | craftbukkit-fb1cfea89e46f198d683b045586437ef09ed311f.tar craftbukkit-fb1cfea89e46f198d683b045586437ef09ed311f.tar.gz craftbukkit-fb1cfea89e46f198d683b045586437ef09ed311f.tar.lz craftbukkit-fb1cfea89e46f198d683b045586437ef09ed311f.tar.xz craftbukkit-fb1cfea89e46f198d683b045586437ef09ed311f.zip |
[Bleeding] Implemented Block.getLightFromSky() and Block.getLightFromBlocks()
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java index d899b96b..80ffc421 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -7,6 +7,8 @@ import org.bukkit.block.PistonMoveReaction; import net.minecraft.server.BiomeBase; import net.minecraft.server.BlockRedstoneWire; +import net.minecraft.server.EnumSkyBlock; + import org.bukkit.*; import org.bukkit.block.BlockState; import org.bukkit.craftbukkit.CraftChunk; @@ -109,6 +111,15 @@ public class CraftBlock implements Block { return (byte) chunk.getHandle().world.getLightLevel(this.x, this.y, this.z); } + public byte getLightFromSky() { + return (byte) chunk.getHandle().a(EnumSkyBlock.SKY, this.x & 0xF, this.y & 0x7F, this.z & 0xF); + } + + public byte getLightFromBlocks() { + return (byte) chunk.getHandle().a(EnumSkyBlock.BLOCK, this.x & 0xF, this.y & 0x7F, this.z & 0xF); + } + + public Block getFace(final BlockFace face) { return getRelative(face, 1); } |