mirror of
https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git
synced 2025-08-21 05:44:33 +00:00
[Bleeding] Implemented Block.getLightFromSky() and Block.getLightFromBlocks()
This commit is contained in:
parent
f7585e552d
commit
fb1cfea89e
1 changed files with 11 additions and 0 deletions
|
@ -7,6 +7,8 @@ import org.bukkit.block.PistonMoveReaction;
|
||||||
|
|
||||||
import net.minecraft.server.BiomeBase;
|
import net.minecraft.server.BiomeBase;
|
||||||
import net.minecraft.server.BlockRedstoneWire;
|
import net.minecraft.server.BlockRedstoneWire;
|
||||||
|
import net.minecraft.server.EnumSkyBlock;
|
||||||
|
|
||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
import org.bukkit.block.BlockState;
|
import org.bukkit.block.BlockState;
|
||||||
import org.bukkit.craftbukkit.CraftChunk;
|
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);
|
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) {
|
public Block getFace(final BlockFace face) {
|
||||||
return getRelative(face, 1);
|
return getRelative(face, 1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue