Topographer.Renderer.GetLight C# (CSharp) 메소드

GetLight() 개인적인 정적인 메소드

private static GetLight ( TAG_Compound sections, int x, int y, int z ) : byte
sections Minecraft.TAG_Compound
x int
y int
z int
리턴 byte
        private static byte GetLight(TAG_Compound[] sections, int x, int y, int z)
        {
            byte light = 15;

            int section = (int)Math.Floor(y / 16.0);

            if (sections[section] != null)
            {
                int offset = ((y % 16) * 16 + z) * 16 + x;
                light = ((byte[])sections[section]["BlockLight"])[offset >> 1];
                if (offset % 2 == 0)
                    light = (byte)(light & 0x0F);
                else
                    light = (byte)((light >> 4) & 0x0F);
            }

            if (light > 15)
                light = 15;
            else if (light < 4)
                light = 4;
            return light;
        }